[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2020-07-05 Thread Peter Wu


Peter Wu  added the comment:

I just ran into this issue on Linux when piping a binary file to stdin resulted 
in a UnicodeDecodeError while trying to read a byte from the stream. Passing 
/dev/stdin is a workaround that does not require modifications to an 
application.

As for the proposed PR 13165, I'd suggest to gracefully fallback to normal 
stdout/stdin if the buffer is not available. That approach is also followed in 
the fileinput module, and takes care of the note for library developers in the 
documentation at https://docs.python.org/3/library/sys.html#sys.stdin

Not feeling particular strong about the graceful handling, but I hope that the 
test code can be simplified in that case.

--
nosy: +lekensteyn

___
Python tracker 
<https://bugs.python.org/issue14156>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22322] Zip files created by `git archive` result in a SyntaxError (due to comment?)

2014-09-01 Thread Peter Wu

New submission from Peter Wu:

Files created by `git archive` are not understood by the Python interpreter. 
This could be caused by the additional comment (for the commit hash) in the 
file.

echo 'print(1)'  __main__.py
git init  git add __main__.py  git commit -m init
git archive --format=zip HEAD  y.zip
python y.zip

Packing it with `zip x.zip __main__.py  python x.zip` works.

--
components: Extension Modules
messages: 226230
nosy: lekensteyn
priority: normal
severity: normal
status: open
title: Zip files created by `git archive` result in a SyntaxError (due to 
comment?)
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22322
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22188] test_gdb fails on invalid gdbinit

2014-08-12 Thread Peter Wu

New submission from Peter Wu:

I had a stale ~/.gdbinit file which tried to executed python code causing an 
exception. The tests should probably run with `-nx` or `-nh` to avoid reading 
~/.gdbinit.

--
components: Tests
messages: 225245
nosy: lekensteyn
priority: normal
severity: normal
status: open
title: test_gdb fails on invalid gdbinit
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22188
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com