Gregory P. Smith [Sun, 11 Nov 2012 07:35:15 +0000 (23:35 -0800)]
Rename a local variable for readability and change a "this can't
happen" print() call into a RuntimeWarning as it should've been in the
first place. Because nothing should ever cause unexpected stdout output.
Gregory P. Smith [Sun, 11 Nov 2012 07:33:56 +0000 (23:33 -0800)]
Rename a local variable for readability and change a "this can't
happen" print() call into a RuntimeWarning as it should've been in the
first place. Because nothing should ever cause unexpected stdout output.
Gregory P. Smith [Sun, 11 Nov 2012 07:33:17 +0000 (23:33 -0800)]
Rename a local variable for readability and change a "this can't
happen" print() call into a RuntimeWarning as it should've been in the
first place. Because nothing should ever cause unexpected stdout output.
Nadeem Vawda [Sun, 11 Nov 2012 01:24:37 +0000 (02:24 +0100)]
Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).
Nadeem Vawda [Sun, 11 Nov 2012 01:21:22 +0000 (02:21 +0100)]
Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).
Nadeem Vawda [Sun, 11 Nov 2012 01:14:36 +0000 (02:14 +0100)]
Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).
Gregory P. Smith [Sat, 10 Nov 2012 23:13:20 +0000 (15:13 -0800)]
Fix test_urllib broken by my previous commits. The assumptions it was
testing were added as part of the issue10050 change that caused the
wrong behavior in the first place. now all test cases agree on the
behavior.
Gregory P. Smith [Sat, 10 Nov 2012 23:12:55 +0000 (15:12 -0800)]
Fix test_urllib broken by my previous commits. The assumptions it was
testing were added as part of the issue10050 change that caused the
wrong behavior in the first place. now all test cases agree on the
behavior.
Gregory P. Smith [Sat, 10 Nov 2012 21:44:50 +0000 (13:44 -0800)]
Fixes issue #16409: The reporthook callback made by the legacy
urllib.request.urlretrieve API now properly supplies a constant
non-zero block_size as it did in Python 3.2 and 2.7. This matches the
behavior of urllib.request.URLopener.retrieve.
Gregory P. Smith [Sat, 10 Nov 2012 21:43:44 +0000 (13:43 -0800)]
Fixes issue #16409: The reporthook callback made by the legacy
urllib.request.urlretrieve API now properly supplies a constant
non-zero block_size as it did in Python 3.2 and 2.7. This matches the
behavior of urllib.request.URLopener.retrieve.
Victor Stinner [Sat, 10 Nov 2012 11:07:39 +0000 (12:07 +0100)]
Issue #16444, #16218: Use TESTFN_UNDECODABLE on UNIX
Check if data is decoded by os.fsdecode() (filesystem encoding with
surrogateescape error handler, PEP 383), not by UTF-8 or the filesystem
encoding in strict mode.
Use TESTFN_UNDECODABLE in test_cmd_line_script.test_non_ascii() on UNIX.
Victor Stinner [Tue, 6 Nov 2012 23:36:38 +0000 (00:36 +0100)]
Close #16311: Use the _PyUnicodeWriter API in text decoders
* Remove unicode_widen(): replaced with _PyUnicodeWriter_Prepare()
* Remove unicode_putchar(): replaced with
PyUnicodeWriter_Prepare() + PyUnicode_WRITER()
* When handling an decoding error, only overallocate the buffer by +25%
instead of +100%
Victor Stinner [Tue, 6 Nov 2012 23:10:14 +0000 (00:10 +0100)]
Issue #16414: Fix test_os on Windows, don't test os.listdir() with undecodable
With the ANSI code page 932, os.listdir(b'\xe7') return an empty list (instead
of failing), whereas os.listdir(b'\xff') raises a FileNotFoundError.
It looks like a Windows bug: b'\xe7' directory does not exist,
FindFirstFileA(b'\xe7') fails with ERROR_FILE_NOT_FOUND (2), instead of
ERROR_PATH_NOT_FOUND (3).
Victor Stinner [Tue, 6 Nov 2012 22:33:46 +0000 (23:33 +0100)]
Issue #16414: Fix support.TESTFN_UNDECODABLE and test_genericpath.test_nonascii_abspath()
* support.TESTFN_UNDECODABLE was decodable if the filesystem encoding was
cp932
* test_genericpath.test_nonascii_abspath() didn't work on Windows if the
path was not decodable (ex: with cp932)