[issue11649] startElementNS in xml.sax.saxutils.XMLGenerator ignored encoding

2011-03-23 Thread Gunnar Aastrand Grimnes
New submission from Gunnar Aastrand Grimnes : The startElementNS method in the XMLGenerator ignores the encoding set. it does: self._out.write(' xmlns:%s="%s"' % (prefix, uri)) whereas it should have done: self._write(' xmlns:%s="%s"' % (prefix,

[issue11649] startElementNS in xml.sax.saxutils.XMLGenerator ignored encoding

2011-03-25 Thread Gunnar Aastrand Grimnes
Gunnar Aastrand Grimnes added the comment: I came across the bug when trying to write XML documents to StringIO objects. This does not work, since the output contains a mix of unicode and str objects, and StringIO gets confused. A better alternative is to use io.BytesIO, since all output

[issue30385] Segfault on OSX with 3.6.1

2017-05-17 Thread Gunnar Aastrand Grimnes
New submission from Gunnar Aastrand Grimnes: This script, using requests and multiprocessing, will segfault on MacOS 16.4.0 with python 3.6.1. In 3.6.0 it runs fine. The program is reduced from a much larger program, some weird things need to be present to trigger the crash. For instance the

[issue30385] Segfault on OSX with 3.6.1

2017-05-17 Thread Gunnar Aastrand Grimnes
Gunnar Aastrand Grimnes added the comment: I am unable to reduce it to a small(ish) test-case like for 3.6.1, but I can also get 2.7.1 to seg fault in my original program, and the stack trace is similar: Process: Python [4023] Path: /usr/local/Cellar/python

[issue30385] Segfault on OSX with 3.6.1

2017-05-22 Thread Gunnar Aastrand Grimnes
Gunnar Aastrand Grimnes added the comment: Adding env no_proxy='*' does indeed fix it! Thanks a lot! I guess it's pretty hard to fix. Or even to detect, so that one could log a warning before dying :( -- ___ Python

[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-03 Thread Gunnar Aastrand Grimnes
New submission from Gunnar Aastrand Grimnes: When reading large files with fileinput, it will work as expected and only process a line at a time when used normally, but if you add an hook_encoded openhook it will read the whole file into memory before returning the first line. Verify by

[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-03 Thread Gunnar Aastrand Grimnes
Gunnar Aastrand Grimnes added the comment: The problem lies in codecs.py here: http://hg.python.org/cpython/file/ae7facd874ba/Lib/codecs.py#l581 -- ___ Python tracker <http://bugs.python.org/issue20

[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-05 Thread Gunnar Aastrand Grimnes
Gunnar Aastrand Grimnes added the comment: Agreed that a doc-fix is the first step. Shall I make another issue for the fix in fileinput? I also wonder if the comment in codecs is not too negative - it is not easy to get it 100% right, but the method just above readlines is readline, which

[issue20528] fileinput module will read whole file into memory when using fileinput.hook_encoded due to codecs.StreamReader.readlines

2014-02-06 Thread Gunnar Aastrand Grimnes
New submission from Gunnar Aastrand Grimnes: When reading large files with fileinput, it will work as expected and only process a line at a time when used normally, but if you add an hook_encoded openhook it will read the whole file into memory before returning the first line. Verify by