Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(164235)

#18876: Problems with files opened in append mode with io module

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 3 months ago by erik.m.bray
Modified:
6 years, 3 months ago
Reviewers:
pitrou
CC:
AntoinePitrou, haypo, r.david.murray, Charles-Fran├žois Natali, devnull_psf.upfronthosting.co.za, erik.bray, csabella
Visibility:
Public.

Patch Set 1 #

Total comments: 2

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/test_fileio.py View 1 2 chunks +16 lines, -1 line 0 comments Download
Modules/_io/fileio.c View 1 7 chunks +13 lines, -9 lines 0 comments Download

Messages

Total messages: 1
AntoinePitrou
6 years, 3 months ago #1
http://bugs.python.org/review/18876/diff/9104/Lib/test/test_fileio.py
File Lib/test/test_fileio.py (right):

http://bugs.python.org/review/18876/diff/9104/Lib/test/test_fileio.py#newcode327
Lib/test/test_fileio.py:327: self.assertEqual(_FileIO(TESTFN, modes[0]).mode,
modes[1])
Not closing the FileIO object explicitly will print out a ResourceWarning. You
could use a "with" statement to alleviate that.

http://bugs.python.org/review/18876/diff/9104/Modules/_io/fileio.c
File Modules/_io/fileio.c (right):

http://bugs.python.org/review/18876/diff/9104/Modules/_io/fileio.c#newcode323
Modules/_io/fileio.c:323: #ifdef O_APPEND
The original "#ifdef O_APPEND" was probably misguided or overly cautious, let's
not add any other ones :-)
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+