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

#25788: fileinput.hook_encoded has no way to pass arguments to codecs

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 10 months ago by lac
Modified:
1 year, 7 months ago
Reviewers:
storchaka
CC:
terry.reedy, r.david.murray, devnull_psf.upfronthosting.co.za, berkerpeksag, storchaka, lac, curioswati, Joseph Hackman
Visibility:
Public.

Patch Set 1 #

Total comments: 3

Patch Set 2 #

Patch Set 3 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/fileinput.rst View 1 2 1 chunk +9 lines, -3 lines 3 comments Download
Doc/whatsnew/3.6.rst View 1 2 1 chunk +6 lines, -0 lines 1 comment Download
Lib/fileinput.py View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
Lib/test/test_fileinput.py View 1 2 2 chunks +20 lines, -1 line 0 comments Download
Misc/ACKS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
Misc/NEWS View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 2
storchaka_gmail.com
http://bugs.python.org/review/25788/diff/16473/Lib/fileinput.py File Lib/fileinput.py (right): http://bugs.python.org/review/25788/diff/16473/Lib/fileinput.py#newcode415 Lib/fileinput.py:415: def hook_encoded(encoding, errors='strict'): Default "errors" value for open() is ...
1 year, 7 months ago #1
storchaka_gmail.com
1 year, 7 months ago #2
http://bugs.python.org/review/25788/diff/17094/Doc/library/fileinput.rst
File Doc/library/fileinput.rst (right):

http://bugs.python.org/review/25788/diff/17094/Doc/library/fileinput.rst#newc...
Doc/library/fileinput.rst:194: *encoding* to read the file. *errors* is an
optional string that specifies how
Line is too long. It is recommended to use two spaces after a sentence-ending
period. The mention of binary mode was not relevant, hook_encoded is used in
text mode.

I'll use simpler wording.

http://bugs.python.org/review/25788/diff/17094/Doc/library/fileinput.rst#newc...
Doc/library/fileinput.rst:200:
fileinput.FileInput(openhook=fileinput.hook_encoded("iso-8859-1",
errors="replace"))``
Bad example. Decoding "iso-8859-1" never fails. Should be used an encoding that
can't decode arbitrary byte sequence, e.g. utf-8.

http://bugs.python.org/review/25788/diff/17094/Doc/library/fileinput.rst#newc...
Doc/library/fileinput.rst:203: Added the *errors* keyword argument.
Changed to "Added the optional *errors* parameter.".

See https://docs.python.org/3/faq/programming.html#faq-argument-vs-parameter .

http://bugs.python.org/review/25788/diff/17094/Doc/whatsnew/3.6.rst
File Doc/whatsnew/3.6.rst (right):

http://bugs.python.org/review/25788/diff/17094/Doc/whatsnew/3.6.rst#newcode146
Doc/whatsnew/3.6.rst:146: :func:`~fileinput.hook_encoded` now supports the
*errors* keyword argument.
Added "(Contributed by Joseph Hackman in :issue:`25788`.)".
Sign in to reply to this message.

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