summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-04 12:09:08 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-04 12:09:08 (GMT)
commit3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7 (patch)
tree0cae2e90e716369ea660d7e00d9ad266f0454970 /Lib/test/test_mmap.py
parent95c0700effc69b6b41a4a4ca104ee6b65a42be23 (diff)
downloadcpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.zip
cpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.tar.gz
cpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.tar.bz2
Issue #5391: mmap.read_byte() should return unsigned value [0, 255]
instead of signed value [-127, 128].
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r--Lib/test/test_mmap.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 54a43f9..f78fed9 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -534,6 +534,15 @@ class MmapTests(unittest.TestCase):
m.seek(8)
self.assertRaises(ValueError, m.write, b"bar")
+ def test_non_ascii_byte(self):
+ for b in (129, 200, 255): # > 128
+ m = mmap.mmap(-1, 1)
+ m.write_byte(b)
+ self.assertEquals(m[0], b)
+ m.seek(0)
+ self.assertEquals(m.read_byte(), b)
+ m.close()
+
if os.name == 'nt':
def test_tagname(self):
data1 = b"0123456789"