mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #12451: Open files in binary mode in some tests when the text file is not
needed. Remove also an unused variable (blank) in test_threading.
This commit is contained in:
parent
eaf399e335
commit
a6d2c769fb
5 changed files with 16 additions and 18 deletions
|
@ -62,7 +62,7 @@ class TestFcntl(unittest.TestCase):
|
|||
|
||||
def test_fcntl_fileno(self):
|
||||
# the example from the library docs
|
||||
self.f = open(TESTFN, 'w')
|
||||
self.f = open(TESTFN, 'wb')
|
||||
rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
|
||||
if verbose:
|
||||
print('Status from fcntl with O_NONBLOCK: ', rv)
|
||||
|
@ -74,7 +74,7 @@ class TestFcntl(unittest.TestCase):
|
|||
|
||||
def test_fcntl_file_descriptor(self):
|
||||
# again, but pass the file rather than numeric descriptor
|
||||
self.f = open(TESTFN, 'w')
|
||||
self.f = open(TESTFN, 'wb')
|
||||
rv = fcntl.fcntl(self.f, fcntl.F_SETFL, os.O_NONBLOCK)
|
||||
if sys.platform not in ['os2emx']:
|
||||
rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue