[issue32723] codecs.open silently ignores argument errors

2018-01-31 Thread Xiang Zhang
Xiang Zhang added the comment: Honestly speaking I am not interested in Python3. I think codecs.open will be deprecated one day in Python3 and Victor has raised it long ago. See #8796. And in Python2, codecs.open is still in use. errors could still function when you are writing, encoding, jus

[issue32723] codecs.open silently ignores argument errors

2018-01-30 Thread Josh Rosenberg
Change by Josh Rosenberg : -- versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue32723] codecs.open silently ignores argument errors

2018-01-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: On rereading the docs for Python 3 codecs.open, it doesn't seem to document the whole "no encoding means no codecs.StreamReaderWriter wrapping behavior" at all. First off, any fix would only apply to Python 3 (I've removed 2.7 from the versions). Both Python

[issue32723] codecs.open silently ignores argument errors

2018-01-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: Ah, my mistake. That said, when you're not passing an encoding, you're still just calling regular open, it's not doing any special codecs.open wrapping (on Python 2, this meant you weren't decoding the input at all, on Python 3 it means you're decoding with t

[issue32723] codecs.open silently ignores argument errors

2018-01-30 Thread Xiang Zhang
Xiang Zhang added the comment: I don't understand Josh. Looking from the code only when *passing* encoding binary mode is forced, although in the comment it's saying always. >>> f = codecs.open('/tmp/a', 'w') >>> f For example I want to use 'replace' instead of 'strict' for default encoding,

[issue32723] codecs.open silently ignores argument errors

2018-01-29 Thread Josh Rosenberg
Josh Rosenberg added the comment: On both Py2 and Py3, calling codecs.open without passing an encoding argument is equivalent to adding 'b' to the mode string and calling the built-in open function directly; it returns a plain binary mode file object. The errors parameter is meaningless becau

[issue32723] codecs.open silently ignores argument errors

2018-01-29 Thread Xiang Zhang
Change by Xiang Zhang : -- title: codecs.open -> codecs.open silently ignores argument errors type: -> behavior ___ Python tracker ___ _

[issue32723] codecs.open

2018-01-29 Thread Xiang Zhang
New submission from Xiang Zhang : >>> import codecs >>> f = codecs.open('/tmp/a', 'w', errors='replace') >>> f.errors 'strict' Passing errors to codecs.open without encoding doesn't work. Can't get this from doc and I don't think it should silently ignore the passing argument. -- compo