mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-69528: Distinguish between file modes "wb+" and "rb+" (GH-137834)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
This commit is contained in:
parent
60df1d7e0c
commit
02c1abfc54
7 changed files with 27 additions and 10 deletions
|
|
@ -960,8 +960,8 @@ def test_attributes(self):
|
|||
|
||||
f = self.open(os_helper.TESTFN, "w+", encoding="utf-8")
|
||||
self.assertEqual(f.mode, "w+")
|
||||
self.assertEqual(f.buffer.mode, "rb+") # Does it really matter?
|
||||
self.assertEqual(f.buffer.raw.mode, "rb+")
|
||||
self.assertEqual(f.buffer.mode, "wb+")
|
||||
self.assertEqual(f.buffer.raw.mode, "wb+")
|
||||
|
||||
g = self.open(f.fileno(), "wb", closefd=False)
|
||||
self.assertEqual(g.mode, "wb")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue