[New-bugs-announce] [issue5391] mmap: read_byte/write_byte and object type

Hirokazu Yamamoto report at bugs.python.org
Sat Feb 28 12:02:29 CET 2009


New submission from Hirokazu Yamamoto <ocean-city at m2.ccsnet.ne.jp>:

On Python3000, mmap.read_byte returns str not bytes, and mmap.write_byte
accepts str. Is this intended behavior?

>>> import mmap
>>> m = mmap.mmap(-1, 10)
>>> type(m.read_byte())
<class 'str'>
>>> m.write_byte("a")
>>> m.write_byte(b"a")

Maybe another possibility. read_byte() returns int which represents
byte, write_byte accepts int which represents byte. (Like b"abc"[0]
returns int not 1-length bytes)

----------
components: Extension Modules
messages: 82903
nosy: ocean-city
severity: normal
status: open
title: mmap: read_byte/write_byte and object type
type: behavior
versions: Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5391>
_______________________________________


More information about the New-bugs-announce mailing list