[issue24339] iso6937 encoding missing

2016-11-13 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue24339> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-13 Thread Xiang Zhang
Xiang Zhang added the comment: > The name _PyUnicode_CompareWithIdEqual looks too long to me. What about > _PyUnicode_EqualToId? +1. I think this name is more clear. Serhiy's idea on the implementation sounds good. As for _PyUnicode_FROM_ID, I think it's better f

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-13 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file45480/_PyUnicode_EqualToId_v2.patch ___ Python tracker <http://bugs.python.org/issue21449> ___ ___ Pytho

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-14 Thread Xiang Zhang
Xiang Zhang added the comment: _PyUnicode_FromId could fail due to memoryerror or bad encoded data. They should be treated differently like PyUnicode_READY. Could we treat it like PyDict_GetItem? If memoryerror happens it's highly possible other parts will fai

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-14 Thread Xiang Zhang
Xiang Zhang added the comment: GNU gettext only allows the plural value(n) to be an integer(unsigned long int). Django deliberately converts the value to long in filesizeformat. Any reason not to use int? -- ___ Python tracker <h

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-14 Thread Xiang Zhang
Xiang Zhang added the comment: test___all__ gets the same behaviour. ./python -Werror -m test test___all__ Run tests sequentially 0:00:00 [1/1] test___all__ Warning -- warnings.filters was modified by test___all__ test___all__ failed (env changed) 1 test altered the execution environment

[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-11-14 Thread Xiang Zhang
Xiang Zhang added the comment: Maybe you have forgotten to remove the debug print in the patch? -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue28

[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: I think the stacklevel should be 3. stacklevel = 3: ./python -Walways /tmp/a.py /tmp/a.py:2: DeprecationWarning: Plural value must be an integer, got float c2py('n!=1')(1.1) stacklevel = 4: ./python -Walways /tmp/a.py sys:1: DeprecationWarning: Pl

[issue28692] gettext: deprecate selecting plural form by fractional numbers

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, sorry. It should be 4 and I make a mistake. Sorry for the noise. Patch LGTM. -- ___ Python tracker <http://bugs.python.org/issue28

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: Since currently _PyUnicode_CompareWithId is used to compare a unicode with ascii identifiers for all cases, how about introduce a more specific function like _PyUnicode_EqualToASCIIId for this case? We can preserve _PyUnicode_CompareWithId for more general

[issue28707] add 'directory' option to the http.server module

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: +1 for this idea. I use this command everyday in work and every time must cd to the directory is an annoyance. -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue28

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2016-11-15 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. -- ___ Python tracker <http://bugs.python.org/issue28701> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-16 Thread Xiang Zhang
Xiang Zhang added the comment: > _PyUnicode_CompareWithId is a private function. We can remove it if it has > issues. It doesn't. But once there is _PyUnicode_EqualToASCIIId, it's can be rarely used. The new patch implements a version of _PyUnicode_EqualToASCIIId. -

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: Hi Davin, could it be fixed like this? diff -r 05a728e1da15 Lib/multiprocessing/pool.py --- a/Lib/multiprocessing/pool.py Wed Nov 16 16:35:53 2016 -0800 +++ b/Lib/multiprocessing/pool.py Thu Nov 17 16:35:38 2016 +0800 @@ -398,7 +398,7

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: In Py3.6, it raises error: >>> next((pool.imap(str, gen( Traceback (most recent call last): File "/opt/lib/python3.7/multiprocessing/pool.py", line 684, in next item = self._items.popleft() IndexError: pop from an empty deque Dur

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: What's more, this case seems non-reentrant. Since there is no task in this case, the job id is always 0 which is not true. This means after the first time, we can not set even the exception. -- ___ Python tr

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: Here is a patch which is just a try. I don't quite like the implementation but I can not figure out a better solution. The examples in this one and #28696 seems to work and no test fails currently. -- Added file: http://bugs.python.org/file

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: > Your patch looks to be introducing a number of changes to the structure of > the data being passed around between threads and even monitored/indirectly > shared across processes. That's why I say even myself don't like it. To solve an

[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-11-18 Thread Xiang Zhang
Xiang Zhang added the comment: > My question is simple: in what circumstances the patch has an effect? My original intention is that there is no need for the caller to check for the empty string. Even there is no use case now, it could be in future. But Serhiy, I am actually very glad to

[issue28750] Replace string with bytes in doc of unicode-escape an raw-unicode-escape

2016-11-20 Thread Xiang Zhang
New submission from Xiang Zhang: The docs of the encoders of unicode-escape and raw-unicode-escape still tell the result of the encoding is Python string object. It should be Python bytes object. -- assignee: docs@python components: Documentation files: unicode-escape-doc.patch

[issue28750] Replace string with bytes in doc of unicode-escape an raw-unicode-escape

2016-11-20 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file45559/unicode-escape-doc_v2.patch ___ Python tracker <http://bugs.python.org/issue28750> ___ ___ Python-bug

[issue28750] Replace string with bytes in doc of unicode-escape an raw-unicode-escape

2016-11-20 Thread Xiang Zhang
Xiang Zhang added the comment: > But I think the word "Python" in "Python bytes object" is redundant. It was > needed in "Python string object" to distinguish from "C string" and "Python > Unicode object". Make sense. This "Pyt

[issue28756] robotfileparser always uses default Python user-agent

2016-11-20 Thread Xiang Zhang
Xiang Zhang added the comment: Hi, John. This issue of robotparser has been reported in #15851. I'll close this as duplicate and you can discuss in that thread. -- nosy: +xiang.zhang resolution: -> duplicate status: open -> closed superseder: -> Lib/robotparser.py

[issue15851] Lib/robotparser.py doesn't accept setting a user agent string, instead it uses the default.

2016-11-20 Thread Xiang Zhang
Changes by Xiang Zhang : -- versions: +Python 3.7 -Python 3.5 ___ Python tracker <http://bugs.python.org/issue15851> ___ ___ Python-bugs-list mailing list Unsub

[issue28760] Cleanup PyUnicode_AsUnicodeEscapeString

2016-11-21 Thread Xiang Zhang
New submission from Xiang Zhang: PyUnicode_AsUnicodeEscapeString now still has some old comments and codes about the original "quotes" parameter of unicodeescape_string. Current implementation could get rid of them. -- files: PyUnicode_AsUnicodeEscapeString.patch keywo

[issue28760] Cleanup PyUnicode_AsUnicodeEscapeString

2016-11-21 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work, Serhiy. ;-) -- ___ Python tracker <http://bugs.python.org/issue28760> ___ ___ Python-bugs-list mailin

[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-11-22 Thread Xiang Zhang
Xiang Zhang added the comment: v2 applies the suggestions. -- priority: low -> normal versions: +Python 3.7 Added file: http://bugs.python.org/file45597/issue27414_v2.patch ___ Python tracker <http://bugs.python.org/issu

[issue28766] Remove the semicolon in source code

2016-11-22 Thread Xiang Zhang
Changes by Xiang Zhang : -- stage: -> resolved ___ Python tracker <http://bugs.python.org/issue28766> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue28774] Better start and end position for unicodeerror in unicode_encode_ucs1

2016-11-22 Thread Xiang Zhang
New submission from Xiang Zhang: unicode_encode_ucs1 now recognizes as many characters as it can one time instead of one character a time. But the unicodeerror positions still only count 1(the second time). A similar problem reported in #28561. -- components: Interpreter Core files

<    12   13   14   15   16   17