[issue30823] os.startfile("") craches Python 2.7, 3.4, 3.5 in Windows 7

2017-07-01 Thread morris wang
Changes by morris wang : -- title: os.startfile("") craches Python 2.7, 3.4, 3.5 -> os.startfile("") craches Python 2.7, 3.4, 3.5 in Windows 7 ___ Python tracker <http://

[issue24827] round(1.65, 1) return 1.6 with decimal

2017-07-30 Thread Huan Wang
Huan Wang added the comment: Hello, I was confused by the decimal module. The problem is that I want to from decimal import Decimal, ROUND_HALF_UP def rounded(number, n): ''' Round the digits after the n_th decimal point by using decimal module in python.

[issue24827] round(1.65, 1) return 1.6 with decimal

2017-07-30 Thread Huan Wang
Huan Wang added the comment: Hi Mark, Thank you for your reply. I went over again the answer from Zachary Ware published on 2015-08-08 09:36. I got the point that it is better to use string type of number. >>> from decimal import Decimal, ROUND_HALF_UP >>> Decimal(&qu

[issue31281] fileinput inplace does not work with pathlib.Path

2017-08-25 Thread Zhiming Wang
New submission from Zhiming Wang: Consider import fileinput import pathlib with fileinput.input(files=(pathlib.Path('in.txt'),), inplace=True) as fp: for line in fp: print(line, end='') which results in Traceback (most recent ca

[issue31281] fileinput inplace does not work with pathlib.Path

2017-08-25 Thread Zhiming Wang
Changes by Zhiming Wang : -- pull_requests: +3245 ___ Python tracker <http://bugs.python.org/issue31281> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang
New submission from Zhiming Wang : This is a regression in Python 3.7: $ BROWSER=w3m python3.6 -c 'import sys; import webbrowser; print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)' 3.6.7 (default, Nov 24 2018, 09:47:01) [GCC 4.2.1 Compatible

[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang
Change by Zhiming Wang : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue35308> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35308] webbrowser regression: BROWSER env var not respected

2018-11-24 Thread Zhiming Wang
Change by Zhiming Wang : -- keywords: +patch pull_requests: +9946 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35308> ___ ___ Py

[issue35615] "RuntimeError: Dictionary changed size during iteration" when copying a WeakValueDictionary

2018-12-29 Thread Fish Wang
New submission from Fish Wang : I come across this issue recently when developing a multi-threaded PySide2 (Qt) application. When I'm calling .copy() on a WeakValueDictionary, there is a high chance that my application crashes with the following stack backtrace: -- Traceback

[issue35615] "RuntimeError: Dictionary changed size during iteration" when copying a WeakValueDictionary

2018-12-30 Thread Fish Wang
Fish Wang added the comment: Thanks for your reply. I'm preparing a PR. However, I'm not sure how to write a reliable test case to trigger the crash outside my application. I will submit the PR for now, and see if anyone on the mailing list has a better idea of what a reliable

[issue35615] "RuntimeError: Dictionary changed size during iteration" when copying a WeakValueDictionary

2018-12-30 Thread Fish Wang
Fish Wang added the comment: Just submitted a PR against the master branch on GitHub. > This can be apply to 3.8? I think so. -- ___ Python tracker <https://bugs.python.org/issu

[issue35615] "RuntimeError: Dictionary changed size during iteration" when copying a WeakValueDictionary

2018-12-30 Thread Fish Wang
Fish Wang added the comment: Just checked weakref.py on different branches, I think this bug exists in Python 2.7, 3.4, 3.5, and 3.6 as well. -- ___ Python tracker <https://bugs.python.org/issue35

[issue33618] Support TLS 1.3

2019-02-15 Thread Zhiming Wang
Change by Zhiming Wang : -- nosy: +zmwangx ___ Python tracker <https://bugs.python.org/issue33618> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36047] socket file handle does not support stream write

2019-02-19 Thread wang xuancong
New submission from wang xuancong : Python3 programmers have forgotten to convert/implement the socket file descriptor for IO stream operation. Would you please add it? Thanks! import socket s = socket.socket() s.connect('localhost', 5432) S = s.makefile() # on Python2, the follo

[issue30575] Python interpreter crashes on macOS

2017-06-05 Thread Yibo Wang
New submission from Yibo Wang: I am writing python wrapper for rust library, everything goes fine until execution finishes. "Python quit unexpectedly" [1]25805 segmentation fault python3 To reproduce, download code from GitHub repo provided by this blog(https://kushalda

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
New submission from Fengyang Wang: Reduced reproduction: class X: r = [1, 2, 3] z = [(i, j) for i in [4, 5] for j in r] fails with "NameError: name 'r' is not defined". The expected behavior would be for r to be resolved as the r in the class namespace. Note in co

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
Fengyang Wang added the comment: By the way, in Python 2.7 at least, this was working. -- ___ Python tracker <http://bugs.python.org/issue30577> ___ ___ Python-bug

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
Fengyang Wang added the comment: It looks like this is a duplicate of http://bugs.python.org/issue11796 Sorry for the noise. -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/issu

[issue30575] Python interpreter crashes on macOS

2017-06-09 Thread Yibo Wang
Yibo Wang added the comment: It's a bug from cffi because the interpreter won't crash when using ctypes only without cffi. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs

[issue36224] Python quit unexpectedly error

2019-03-08 Thread Xin Wang
New submission from Xin Wang : I face the same error with https://bugs.python.org/issue36154, but the solution is not work for me. So I want to show you my error. I'm on a Mac running Mojave, version 10.14.3. I installed Python 3.7.2. I am using vscode. It is work fine in command

[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Xianbo Wang
New submission from Xianbo Wang : The urlparse function in Python urllib returns the wrong hostname when parsing URL crafted by the malicious user. This may be caused by incorrect handling of IPv6 addresses. The bug could lead to open redirect in web applications which rely on urlparse to

[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-05-08 Thread Ying Wang
Ying Wang added the comment: I would like to take a stab at this as a first-time CPython contributor. -- nosy: +Ying Wang ___ Python tracker <https://bugs.python.org/issue36

[issue36620] Documentation missing parameter for Itertools.zip_longest

2019-05-08 Thread Ying Wang
Ying Wang added the comment: @rhettinger should this issue be closed if no action is to be taken? If so, should I manually close the pull request referencing this issue, or will that be automatically handled by the Python bug tracker

[issue24564] shutil.copytree fails when copying NFS to NFS

2019-05-16 Thread Ying Wang
Change by Ying Wang : -- keywords: +patch pull_requests: +13279 ___ Python tracker <https://bugs.python.org/issue24564> ___ ___ Python-bugs-list mailin

[issue36850] shutil.copy2 fails with even with source network filesystem not supporting extended attributes

2019-05-16 Thread Ying Wang
Change by Ying Wang : -- pull_requests: +13280 ___ Python tracker <https://bugs.python.org/issue36850> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-21 Thread Zhiming Wang
New submission from Zhiming Wang : Python 2.7 could be significantly slower (5x in some cases) when compiled with clang 3.x or 4.x, compared to clang 5.x. This is quite a problem on macOS, since the latest clang from Apple (which comes with Xcode 9.2) is based on LLVM 4.x. This issue was

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Zhiming Wang
Zhiming Wang added the comment: My benchmarks above do contain py37 (master) stats. -- ___ Python tracker <https://bugs.python.org/issue32616> ___ ___ Python-bug

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-06 Thread Zhiming Wang
Zhiming Wang added the comment: Turns out python 2.7.10 doesn't suffer from the performance issue even when compiled with stock clang 4.x, and upon further investigation, I tracked down the commit that introduced the regression: commit 2c992a0788536087bfd78da8f2c62b30a461d7e2 A

[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread Zhiming Wang
Zhiming Wang added the comment: Yeah, Apple LLVM versions are a major headache. I resorted to feature detection, using C++ coroutines support as the clang 5 distinguisher[1]: $ cat /tmp/test/stub.cc #include int main() { return 0; } $ /Applications/Xcode.app/Contents/Developer

[issue29417] Sort entries in foo.dist-info/RECORD

2018-03-05 Thread Dawei Wang
Dawei Wang added the comment: This is important since for aws lambda the package can change every time. -- nosy: +Dawei Wang ___ Python tracker <https://bugs.python.org/issue29

[issue33381] Incorrect documentation for strftime()/strptime() format code %f

2018-04-28 Thread Judy Wang
New submission from Judy Wang : According to https://docs.python.org/3/library/datetime.html, %f is zero-padded on the left. But actual Python 3 behavior is puts the zero padding on the right. -- files: Bug description.py messages: 315873 nosy: jujuwoman priority: normal severity

[issue31638] zipapp module should support compression

2017-09-29 Thread Zhiming Wang
New submission from Zhiming Wang : Currently (up to 3.7.0a1) archives generated by the zipapp module are uncompressed, which are unnecessarily large for large projects. It's easy to add deflate compression support, and Python loads compressed archives just fine. I already have a

[issue31638] zipapp module should support compression

2017-09-29 Thread Zhiming Wang
Change by Zhiming Wang : -- keywords: +patch pull_requests: +3803 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31638> ___ ___ Py

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-27 Thread Roger Wang
Change by Roger Wang : -- nosy: +rogerwang ___ Python tracker <https://bugs.python.org/issue31639> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang
New submission from Edward Wang : Methods defined in Enums behave 'normally' but classes defined in Enums get mistaken for regular values and can't be used as classes out of the box. ```python class Outer(Enum): a = 1 b = 2 class Inner(Enum): foo = 10

[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang
Change by Edward Wang : -- keywords: +patch pull_requests: +7557 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33976> ___ ___ Py

[issue33976] Enums don't support nested classes

2018-06-27 Thread Edward Wang
Edward Wang added the comment: Ethan - thank you for your speedy response! For an example you can see https://github.com/ucb-bar/hammer/blob/97021bc7e1c819747f8b8b6d4b8c76cdc6a488e3/src/hammer-vlsi/hammer_vlsi_impl.py#L195 - the ObstructionType enum is really only used inside

[issue35035] Documentation for email.utils is named email.util.rst

2018-10-20 Thread Zhiming Wang
New submission from Zhiming Wang : Documentation for PSL module email.utils is named email.util.rst. See <https://docs.python.org/3/library/email.util.html>. This seems to violate the principle of least surprise. (I have a command line tool to open documentation for any PSL module,

[issue35035] Documentation for email.utils is named email.util.rst

2018-10-20 Thread Zhiming Wang
Change by Zhiming Wang : -- keywords: +patch pull_requests: +9362 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35035> ___ ___ Py

[issue31670] Associate .wasm with application/wasm

2018-11-07 Thread Runping Wang
Runping Wang added the comment: We're also depending on this MIME type for WebAssembly. It will be great if we can get this wasm MIME type in. -- nosy: +runpiw ___ Python tracker <https://bugs.python.org/is

[issue12883] xml.sax.xmlreader.AttributesImpl allows empty string as attribute names

2013-01-30 Thread Chenguang Wang
Chenguang Wang added the comment: I found this problem is still not fixed in the lastest hg version. Seriously? This patch is for the latest v3.4.0a0. -- keywords: +patch nosy: +Chenguang.Wang Added file: http://bugs.python.org/file28915/w.patch

[issue19500] Error when connecting to FTPS servers not supporting SSL session resuming

2013-11-04 Thread Ye Wang
New submission from Ye Wang: According to RFC4217 (Securing FTP with TLS, aka the FTPS spec), http://tools.ietf.org/html/rfc4217.html#section-10.2 " It is reasonable for the server to insist that the data connection uses a TLS cached session. This might be a cache of a previous

[issue19522] A suggestion: python 3.* is not as convenient as python 2.*

2013-11-07 Thread wang xuancong
New submission from wang xuancong: Hi python developers, I notice that one major change in python 3 is that you make 'print' as a standard function, and it will require typing (). As you know, reading from and writing to IO is a high frequency operation. By entropy coding theorem, y

[issue22424] make: *** [Objects/unicodeobject.o] Error 1

2014-09-16 Thread bono wang
New submission from bono wang: when i was upgrade from py 2.6 to py 3.3 the error is show up # make && make install gcc -pthread -c -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c gcc -pthread -c -DN

[issue22424] make: *** [Objects/unicodeobject.o] Error 1

2014-09-16 Thread bono wang
bono wang added the comment: Usually, you can workaround GCC bugs by disabling optimizations. You can try to modify Makefile to replace "-O3" with "-O2" or even "-O0" (disable all optimizations), and then try to run "make" again. donethanks a lot

[issue6559] [PATCH]add pass_fds paramter to subprocess.Popen()

2009-07-24 Thread Zhigang Wang
New submission from Zhigang Wang : The current subprocess.Popen() has a boolean close_fds parameter, which cannot satisfy all the requirements. Eg. want to pass specific fd to child process, but close others. This patch adds a extra parameter pass_fds to subprocess.Popen's __init__().

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-09-16 Thread Zhigang Wang
Zhigang Wang added the comment: Thanks Robert for pointing out issue553171. After read that issue, I still think we paid too much to make shelf less surprising. We should at lease provide a option for the *smart* programmers to get better speed and less exceptions. The write-back-all-cache

[issue7581] incomplete doc of zlib

2009-12-27 Thread WANG Lu
New submission from WANG Lu : Python version: 2.6.4 r264:75706 (ubuntu 9.10) I'm working on zlib, and have been busy in finding a way of specify the window size of compression. After wasting minutes in python online doc, I google and find the way: zlib.compressobj(level, method, window

[issue7581] incomplete doc of zlib

2009-12-27 Thread WANG Lu
WANG Lu added the comment: Oh I found this is mentioned in msg94409(http://bugs.python.org/issue7191#msg94409) -- ___ Python tracker <http://bugs.python.org/issue7

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-17 Thread Ke Wang
New submission from Ke Wang : Under Solaris, find_library can not give the correct path. Solaris does not have /sbin/ldconfig, so _findLib_gcc is used. def _findLib_gcc(name): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfi

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-17 Thread Ke Wang
Ke Wang added the comment: I tested the command 'gcc -Wl,-t' on Ubuntu, it works fine. But on Solaris, it doesn't work as expected. Finally I find that gcc does not use GNU ld on Solaris, instead, it uses SUN ld. ___ Python tracker <http

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-18 Thread Ke Wang
Ke Wang added the comment: On Solaris, we can use crle to find system library path. Attached a patch to get find_library work with Solaris. -- keywords: +patch Added file: http://bugs.python.org/file13129/util.diff ___ Python tracker <h

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-18 Thread Ke Wang
Ke Wang added the comment: Above patch failed in a TabError. Attached a new one. Added file: http://bugs.python.org/file13133/util.diff ___ Python tracker <http://bugs.python.org/issue5

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-03-13 Thread Zhigang Wang
New submission from Zhigang Wang : shelf without writeback=True is too slow, while shelves with writeback=True takes too much time to close. And even worse, these codes can not run: $ cat test_shelve.py #!/usr/bin/env python import shelve store = shelve.open("/tmp/shelve.db", writ

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-03-13 Thread Zhigang Wang
Zhigang Wang added the comment: Add some errata of the patch: add the new class to __all__. -- Added file: http://bugs.python.org/file13318/fast_shelf-v2.patch ___ Python tracker <http://bugs.python.org/issue5

[issue5885] uuid.uuid1() is too slow

2009-04-30 Thread Wang Chun
New submission from Wang Chun : uuid.uuid1() currently uses two different ways to generate a uuid. If the system call "uuid_generate_time" is available, uuid1() uses the system call via the ctypes interface, otherwise, it uses pure Python code to generate a uuid. The problem

[issue5885] uuid.uuid1() is too slow

2009-04-30 Thread Wang Chun
Wang Chun added the comment: This is my test on another faster machine. $ cat test.py import sys, time, uuid N = int(sys.argv[1]) t = time.time() for x in xrange(N): uuid.uuid1() print('%.3f microseconds' % ((time.time() - t) * 100.0 / N)) $ cat test.c #include #include

[issue6105] json.dumps doesn't respect OrderedDict's iteration order

2009-05-25 Thread Wang Chun
New submission from Wang Chun : PEP-0372 and Issue 5381 both say json.dumps respect OrderedDict's iteration order, but the example in them do not work on my latest trunk build. $ uname -a Linux 12.38 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/

[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"

2009-06-07 Thread Funda Wang
New submission from Funda Wang : gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.6 -lpthread -ldl -lutil -lm build

[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"

2009-06-12 Thread Funda Wang
Funda Wang added the comment: Regarding python binary target, the actual command when linking is: gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -LL. -lpython2.6 -lpthread -ldl -lutil -lm The linking order is

[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"

2009-06-28 Thread Funda Wang
Funda Wang added the comment: How is this issue going? -- ___ Python tracker <http://bugs.python.org/issue6237> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28693] No EUDC (HKSCS) support in Windows cp950

2016-11-24 Thread Mingye Wang
Mingye Wang added the comment: Windows cp950's EUDC<->PUA mapping is not specific to HKSCS. -- title: No HKSCS support in Windows cp950 -> No EUDC (HKSCS) support in Windows cp950 ___ Python tracker <http://bugs.pyth

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-11-24 Thread Mingye Wang
Changes by Mingye Wang : -- versions: -Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue28343> ___ ___ Python-bugs-list mailing list Unsub

[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 in

[issue29643] --enable-optimizations compiler flag has no effect

2017-02-24 Thread Alex Wang
New submission from Alex Wang: PR submitted here: https://github.com/python/cpython/pull/129 -- components: Build messages: 288535 nosy: awang priority: normal severity: normal status: open title: --enable-optimizations compiler flag has no effect type: behavior versions: Python 2.7

[issue29643] --enable-optimizations compiler flag has no effect

2017-02-24 Thread Alex Wang
Changes by Alex Wang : -- pull_requests: +253 ___ Python tracker <http://bugs.python.org/issue29643> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29643] --enable-optimizations compiler flag has no effect

2017-02-24 Thread Alex Wang
Alex Wang added the comment: At least when I last built Python, configure always said that optimizations were not enabled regardless of whether I passed in the flag. >From what it looked like to me, it's because configure uses the $enableval >variable to store the result of th

[issue17865] PowerPC exponentiation and round() interaction

2013-04-28 Thread Ellen Wang
New submission from Ellen Wang: This is only on a PowerPC, specifically a p2020, running Debian 7.0 wheezy, python 2.7.3. Calling round() seems to corrupt something (in the floating point state?) that causes subsequent exponentiation (the ** operator) to be wrong: Python 2.7.3 (default, Jan

[issue17865] PowerPC exponentiation and round() interaction

2013-04-28 Thread Ellen Wang
Ellen Wang added the comment: Here's an example that uses only math library functions and float literals, presumably with a simpler code path: Python 2.7.3 (default, Jan 2 2013, 16:38:11) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "l

[issue17865] PowerPC exponentiation and round() interaction

2013-04-29 Thread Ellen Wang
Ellen Wang added the comment: OK. My bad. I should have been tipped off that the program didn't need -lm to link. Output from C code: 0.135335 1 0.239022 Feel free to close. I'll have to look into this on my own. Thanks

[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

[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 seq

[issue20387] tokenize/untokenize roundtrip fails with tabs

2015-06-21 Thread Dingyuan Wang
Dingyuan Wang added the comment: The new patch should now pass all tests correctly. The main idea is: * if the token is INDENT, push it on the `indents` stack and continue * if a new line starts, AND the position of the first token >= the length of the last indent level, we assume the ind

[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

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-02 Thread Sean Wang
New submission from Sean Wang: I transfered a file from remote Debian host to my local Windows 10 host using SecureFX. I found that the file's last modifed date was ‎1900‎/‎1‎/1‎,‏‎0:00:00 on Windows. I tried to serve this file to be downloaded, and it crashed as follows: Exception hap

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-02 Thread Sean Wang
Sean Wang added the comment: upload a sample test file -- Added file: http://bugs.python.org/file40929/test ___ Python tracker <http://bugs.python.org/issue25

[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 will

[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 compresse

[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 <http://bugs.python.org/issue25

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-16 Thread Jun Wang
New submission from Jun Wang: See this simple example: class A(): def __init__(self, x=None): self.x = x @property def t(self): return self.x.t def __getattr__(self, name): return 'default' p

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-19 Thread Jun Wang
Jun Wang added the comment: I think this is a common problem while using both __getattr__ and descriptor/property. A descriptor example: class Descriptor(): def __get__(self, instance, owner=None): raise AttributeError('Implicitly suppressed') class A():

[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://

[issue23962] Incorrect TimeoutError referenced in concurrent.futures documentation

2015-12-05 Thread Dingyuan Wang
Changes by Dingyuan Wang : -- nosy: +gumblex ___ Python tracker <http://bugs.python.org/issue23962> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: This bug still exists in Python 2.7.10 with optparse version 1.5.3. When the default_value is not ASCII encoded, it would raise `UnicodeEncodeError: 'ascii' codec can't encode characters` this error is due to the `str` usage in `expand_default` m

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: Sorry, missed one condition: I used `unicode_literals` in Python 2.7.10, example below: >>> from __future__ import unicode_literals >>> str('api名称') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError:

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: when an unicode option.default_value could not be ascii encoded, it would throw exception, detailed logs below: File "/Users/seanwang/Documents/dev/foo/bar.py", line 119, in main parser.print_help() File "/usr/local/Cellar/python/2.7.

[issue24036] GB2312 codec is using a wrong covert table

2016-10-02 Thread Mingye Wang
Mingye Wang added the comment: > Advice for final user: This seems something worthy of adding to the codecs doc as a footnote. Perhaps something like "(deprecated) ... gb2312 is an obsolete encoding from the 1980s. Use gbk or gb18030 instead." will do. > libiconv-1.14 is also

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-10-09 Thread Mingye Wang
Mingye Wang added the comment: The "join the web people" solution should look like this: $ diff -Naurp a/_codecs_cn.c b/_codecs_cn.c --- a/_codecs_cn.c2016-10-09 14:24:04.675111500 -0700 +++ b/_codecs_cn.c2016-10-09 14:27:06.600961500 -0700 @@ -128,6 +128,12 @@ E

[issue28693] No HKSCS support in Windows cp950

2016-11-14 Thread Mingye Wang
New submission from Mingye Wang: Python's cp950 implementation lacks support for HKSCS ('big5hkscs'). This support, which maps HKSCS Big5-EUDC code points to Unicode PUA code points algorithmically, is found in Windows Vista+ as well as an update for XP. An experiment session

[issue24117] Wrong range checking in GB18030 decoder.

2016-11-14 Thread Mingye Wang
Mingye Wang added the comment: Just FYI, cp950 0xC6A1 (\uf6b1) is found in current WindowsBestFit: ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit950.txt -- nosy: +Artoria2e5 ___ Python tracker <http://bugs.python.

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-11-15 Thread Mingye Wang
Mingye Wang added the comment: Also, go to ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit936.txt for MS reference. -- ___ Python tracker <http://bugs.python.org/issue28

[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2016-11-15 Thread Alex Wang
New submission from Alex Wang: - Python Version Python 3.5.2 - Issue I found that the c_wchar_p and c_char_p return results behaves different from what it is based on ctypes doc. From the ctypes doc of Python 3.5: >>> c_wchar_p("Hello, World") c_wchar_p('Hello, World

[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2016-11-15 Thread Alex Wang
Alex Wang added the comment: Hi Eryk, Thanks a lot for quick reply~ This is about the bug I filed: http://bugs.python.org/issue28698# I may still need your help to have a look the original case when I caught this issue: ​I am writing some test automation which call C DLL from Python, the C

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-15 Thread Mingye Wang
New submission from Mingye Wang: Mappings for 0x81 and 0x8D in multiple Windows code pages diverge from what Windows does. Attached is a script that tests for this behavior. (These two bytes are not necessary the only problems, but for sure they are the most widespread and famous ones. Again

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-15 Thread Mingye Wang
Changes by Mingye Wang : Added file: http://bugs.python.org/file45498/windows10_14959.txt ___ Python tracker <http://bugs.python.org/issue28712> ___ ___ Python-bugs-list m

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-15 Thread Mingye Wang
Mingye Wang added the comment: > Python 3.4.3 on Cygwin also fails ``b'\x81\x8d'.encode('cp1252')``. ... but since Cygwin packagers did not enable Win32 APIs for their build, I cannot test the script directly. -- __

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Mingye Wang added the comment: Ugh... This is weird. Attached is a correct version use Python 3.6's 'code page' methods. I have modified the script a little to make sure it runs on Py3. -- Added file: http://bugs.python.org/file45501/win10

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : Added file: http://bugs.python.org/file45502/pycp.py ___ Python tracker <http://bugs.python.org/issue28712> ___ ___ Python-bugs-list mailin

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-16 Thread Mingye Wang
Changes by Mingye Wang : Removed file: http://bugs.python.org/file45497/pycp.py ___ Python tracker <http://bugs.python.org/issue28712> ___ ___ Python-bugs-list mailin

<    1   2   3   >