[issue20387] tokenize/untokenize roundtrip fails with tabs

2015-06-20 Thread Dingyuan Wang
Dingyuan Wang added the comment: Sorry for the inconvenience. I failed to find this old bug. I think there is another problem. The docs of `untokenize` said The iterable must return sequences with **at least** two elements, the token type and the token string. Any additional sequence elements

[issue20387] tokenize/untokenize roundtrip fails with tabs

2015-06-26 Thread Dingyuan Wang
Dingyuan Wang added the comment: I mean the patch only restores tabs in indentation. The reports above should be corrected. Tabs between tokens and other race conditions can't be restored exactly providing the token stream. This won't affect the syntax. I wonder if it's also a bug or a wont

[issue24447] tab indentation breaks in tokenize.untokenize

2015-06-13 Thread Dingyuan Wang
New submission from Dingyuan Wang: If a script uses tabs for indentation, tokenize.untokenize won't restore original indentation correctly from the second line of the indentation level, and thus breaks the file. This affects all Python versions. Test code: python2 -c 'import sys, tokenize

[issue25624] shutil.make_archive makes invalid directory entries

2015-11-14 Thread Dingyuan Wang
Dingyuan Wang added the comment: $ mkdir foo; touch foo/a.txt; python3 -c "import shutil; shutil.make_archive('foo', 'zip', base_dir='foo')"; unzip -t foo.zip Archive: foo.zip testing: foo/ error: invalid compressed data to inflate testing:

[issue25624] shutil.make_archive makes invalid directory entries

2015-11-14 Thread Dingyuan Wang
New submission from Dingyuan Wang: The _make_zipfile in shutil uses ZIP_DEFLATED compression by default, and the fix introduced by #24982 adds directory entries. In zipfile.ZipFile.write, directories is added as 0 file_size, 0 compress_size, regardless of the compression method. Deflate

[issue25624] shutil.make_archive makes invalid directory entries

2015-11-14 Thread Dingyuan Wang
Dingyuan Wang added the comment: My patch for this. -- keywords: +patch Added file: http://bugs.python.org/file41039/storedirectory.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue23962] Incorrect TimeoutError referenced in concurrent.futures documentation

2015-12-05 Thread Dingyuan Wang
Changes by Dingyuan Wang <abcdoyle...@gmail.com>: -- nosy: +gumblex ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23962> ___ _

[issue25624] shutil.make_archive makes invalid directory entries

2015-11-21 Thread Dingyuan Wang
Dingyuan Wang added the comment: Yes, patching zipfile is enough. I wrote a test using `unzip -t` to check the zip. ZipFile.testzip can't detect this kind of error because zlib.decompressobj(-15) will decode b'' to b'' without errors. -- Added file: http://bugs.python.org/file41120

[issue28985] sqlite3 authorizer codes constants not up to date

2016-12-15 Thread Dingyuan Wang
New submission from Dingyuan Wang: We have the sqlite3.set_authorizer function, where the first argument to its callback is one of the Authorizer Action Codes that the SQLite documentations defines[1]. However, the constants in the sqlite3 module is not up to date. The code in _sqlite

[issue29242] Crash on GC when compiling PyPy

2017-01-11 Thread Dingyuan Wang
New submission from Dingyuan Wang: When compiling the PyPy default branch [1] on a Debian testing machine with Python 2.7.13, cpython randomly crashes. (gdb) bt #0 update_refs () at ../Modules/gcmodule.c:332 #1 collect.lto_priv () at ../Modules/gcmodule.c:924 #2 0x5562a804