[issue29099] sqlite3 timestamp converter cannot handle timezone

2016-12-29 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM generally. :-) -- ___ Python tracker <http://bugs.python.org/issue29099> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29112] questionable wording in sequences documentation

2016-12-29 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your report Jesse. Now fixed. -- nosy: +xiang.zhang resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 2.7, Python 3.5, Python 3.7 ___ Python tracker <http://bug

[issue29099] sqlite3 timestamp converter cannot handle timezone

2016-12-29 Thread Xiang Zhang
Xiang Zhang added the comment: import sqlite3, datetime c = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) cur = c.cursor() cur.execute('create table test(t timestamp)') t = datetime.datetime.now(tz=datetime.timezone.utc) cur.execute

[issue29099] sqlite3 timestamp converter cannot handle timezone

2016-12-29 Thread Xiang Zhang
Xiang Zhang added the comment: I would prefer add the support for timezone since the current behaviour seems not correct to me. If you'd like to work on it, don't forget to add a test case and sign the CLA. But I am not sure this should be treated as a bug or new feature. -

[issue29099] sqlite3 timestamp converter cannot handle timezone

2016-12-28 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your report Bozo. I think this is due to timestamp converter doesn't handle timezone now. Besides this ValueError, if I understand correctly, even if you pass a datetime object with tzinfo, with microsecond set, the returned datetime object is a

[issue29100] Core dump / OverflowError for datetime.fromtimestamp with overly large timestamp in Ubuntu 12.04

2016-12-28 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue29100> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29092] Sync os.stat's doc and doc string

2016-12-28 Thread Xiang Zhang
New submission from Xiang Zhang: The accepted types of parameter *path* are different between os.stat's doc and doc string. In doc, it mentions Pathlike, string and file descriptor. In doc string, it mentions string, bytes and file descriptor. (3.5 only lack bytes i

[issue29062] hashlib documentation link error

2016-12-26 Thread Xiang Zhang
Xiang Zhang added the comment: > Now I think hashlib-blake2 should be merged into hashlib. +1 INADA, 3.6 branch also suffers the problems here, I didn't see you patch it. -- ___ Python tracker <http://bugs.python.org

[issue29062] hashlib documentation link error

2016-12-26 Thread Xiang Zhang
Xiang Zhang added the comment: This fixed the index. But the section is still messed up: https://docs.python.org/3/library/crypto.html. The three entries: Module, Examples, Credits in my mind should not appear on the index. -- ___ Python tracker

[issue29078] Example in Section 8.1.5 time Objects is broken

2016-12-26 Thread Xiang Zhang
Xiang Zhang added the comment: > Signed the CLA, but looks like it may take two days to reflect. Thanks. This change is trivial so I can push it first. ;-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed __

[issue29078] Example in Section 8.1.5 time Objects is broken

2016-12-26 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. Thanks for your work Dhushyanth! It's appreciated if you could sign the CLA: https://www.python.org/psf/contrib/contrib-form/. -- assignee: docs@python -> xiang.zhang nosy: +xiang.zhang stage: -> commit review versions: -Python 3.3,

[issue29049] Lazy GC tracking frame

2016-12-25 Thread Xiang Zhang
Xiang Zhang added the comment: I don't have time study the patches. But 29049-fix-generator-refleak.patch fixes the two test failures on my PC. :-) -- ___ Python tracker <http://bugs.python.org/is

[issue29049] Lazy GC tracking frame

2016-12-25 Thread Xiang Zhang
Xiang Zhang added the comment: On my PC, this patch also introduces two tests failure: FAIL: test_log_destroyed_pending_task (test.test_asyncio.test_tasks.CTask_CFuture_SubclassTests) -- Traceback (most recent call last

[issue29064] Package numpy can't be used normally

2016-12-24 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> third party status: open -> closed ___ Python tracker <http://bugs.python.org/issue29064> ___ ___ Python-bugs-

[issue29064] Package numpy can't be used normally

2016-12-24 Thread Xiang Zhang
Xiang Zhang added the comment: Hi kevin. This tracker is used to report problems about CPython. Your problem seems related to numpy and you'd better go to numpy's tracker to ask for help. :-) -- nosy: +xiang.zhang resolution: -> third party stage: -> resolved status

[issue29062] hashlib documentation link error

2016-12-24 Thread Xiang Zhang
Xiang Zhang added the comment: Is the https://docs.python.org/3/library/crypto.html section messed up? Two hashlib entries and some other bad entries? -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue29

[issue29038] Duplicate entry for SSLContext.get_ca_certs() in ssl

2016-12-22 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for the report Daniel! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29044] Use after free in string '%c' formater

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Serhiy and Victor. The final commits applies the comments. :-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29045] Outdated C api doc about Windows error

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: > PyErr_SetFromWindowsErrWithFilenameObject was never implemented. See issue > 11210. > Since 3.3 WindowsError is simply an alias for OSError. See PEP 3151. Ohh, thanks for the info. I don't find the implementation in 2.7 either. -- ver

[issue29045] Outdated C api doc about Windows error

2016-12-21 Thread Xiang Zhang
New submission from Xiang Zhang: https://docs.python.org/3.7/c-api/exceptions.html#c.PyErr_SetFromWindowsErrWithFilename it stills refers to PyErr_SetFromWindowsErrWithFilenameObject but this function doesn't exist since Py3.4. I didn't find when and why it's dele

[issue29044] Use after free in string '%c' formater

2016-12-21 Thread Xiang Zhang
New submission from Xiang Zhang: In string %c formater(formatchar), when receiving an integer-like objects, the return value is decrefed immediately before use. -- components: Interpreter Core files: use-after-free.patch keywords: patch messages: 283811 nosy: haypo, xiang.zhang

[issue29039] Segmentation fault when using PyUnicode_FromString

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: Just as Christoph said, you need to initialize first. -- nosy: +xiang.zhang resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29038] Duplicate entry for SSLContext.get_ca_certs() in ssl

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: The codes in py2.7 looks same as in py3.4+, so make the doc same as in py3.4+. -- keywords: +patch nosy: +christian.heimes, xiang.zhang stage: -> patch review Added file: http://bugs.python.org/file45995/duplicate-doc-entry.pa

[issue29034] Fix memory leak in path_converter

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, while considering Victor's comment, I find some new: path->object refers to the original object o, it owns a borrowed reference. But when received a PathLike object, o is assigned the return value of __fspath__ and decrefed at end. So path->o

[issue29034] Fix memory leak in path_converter

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: v2 applies the comments. And another separate change is to change PyUnicode_AsWideCharString to PyUnicode_AsUnicodeAndSize. -- title: refleak in path_converter on error case -> Fix memory leak in path_converter Added file: http://bugs.python.

[issue29034] refleak in path_converter on error case

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, I haven't read all related code so I didn't realize that's a leak. But if that is, there is still a wide = PyUnicode_AsWideCharString around the codes I altered. -- ___ Python tracker <http

[issue29034] refleak in path_converter on error case

2016-12-21 Thread Xiang Zhang
New submission from Xiang Zhang: It looks like the bytes variable should be Py_DECREFed on error cases as the patch shows. -- components: Library (Lib) files: path_converter.patch keywords: patch messages: 283736 nosy: haypo, steve.dower, xiang.zhang priority: normal severity: normal

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-12-20 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Victor and Serhiy! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29019] dict.fromkeys overallocates when given a sparse dict

2016-12-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +inada.naoki ___ Python tracker <http://bugs.python.org/issue29019> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28950] regrtest: -j0 fails the check -j is not allowed together with -T/-l

2016-12-19 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Victor. 2.7 is not affected since in 2.7 -j0 does not spawn processes. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 ___ Python track

[issue29009] Outdated part in the doc of PyUnicode_RichCompare

2016-12-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue29009] Outdated part in the doc of PyUnicode_RichCompare

2016-12-18 Thread Xiang Zhang
Xiang Zhang added the comment: > This sentence also is in the header. Ohh, yes. Thanks Serhiy! -- Added file: http://bugs.python.org/file45961/doc-of-PyUnicode_RichCompare_v2.patch ___ Python tracker <http://bugs.python.org/issu

[issue29009] Outdated part in the doc of PyUnicode_RichCompare

2016-12-18 Thread Xiang Zhang
New submission from Xiang Zhang: The sentence: "Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in case the conversion of the arguments to Unicode fails with a UnicodeDecodeError." in the doc of PyUnicode_RichCompare is not true in 3.x. Proposed patch simply

[issue29008] Can't do dict comp from previously defined dict in the outermost scope of class defintion

2016-12-18 Thread Xiang Zhang
Xiang Zhang added the comment: Also http://stackoverflow.com/a/4199355/2189957. -- ___ Python tracker <http://bugs.python.org/issue29008> ___ ___ Python-bug

[issue29008] Can't do dict comp from previously defined dict in the outermost scope of class defintion

2016-12-18 Thread Xiang Zhang
Xiang Zhang added the comment: This is by design in 3.x. You can refer #11796 for explanation. -- nosy: +xiang.zhang resolution: -> not a bug stage: -> resolved status: open -> closed superseder: -> Comprehensions in a class definition mostly cannot access cla

[issue28971] nntplib is broken when responses are longer than _MAXLINE

2016-12-16 Thread Xiang Zhang
Xiang Zhang added the comment: Xavier's plan sounds good. We could increase the line length limitation to 64K and add another limitation of the maximum lines a multi-line block could contain. Any limitation is violated the connection is refused. This situation seems quite simil

[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-15 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue28950] regrtest: -j0 fails the check -j is not allowed together with -T/-l

2016-12-13 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your review kumaar.nd. :-) As for your suggestion, in this case adding can not be any harder than replacing. And the old cases could represent the truth value. -- ___ Python tracker <http://bugs.python.

[issue28950] regrtest: -j0 fails the check -j is not allowed together with -T/-l

2016-12-12 Thread Xiang Zhang
Changes by Xiang Zhang : -- versions: +Python 2.7 Added file: http://bugs.python.org/file45867/test-command-line-j0-with-test.patch ___ Python tracker <http://bugs.python.org/issue28

[issue28950] regrtest: -j0 fails the check -j is not allowed together with -T/-l

2016-12-12 Thread Xiang Zhang
Changes by Xiang Zhang : -- title: regrtest: -j0 fails the check -j are not allowed together with -T/-l -> regrtest: -j0 fails the check -j is not allowed together with -T/-l ___ Python tracker <http://bugs.python.org/issu

[issue28950] -j0 fails the check -j are not allowed together with -T/-l

2016-12-12 Thread Xiang Zhang
New submission from Xiang Zhang: For python test command line arguments, -j is not allowed together with -T/-l (don't know why): [cpython]$ ./python -m test -j4 -T usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_

[issue28921] Make str.count one character for latin1 string faster

2016-12-12 Thread Xiang Zhang
Xiang Zhang added the comment: > The code looks too complex. It is if looking at the patch alone. But the skill is used across stringlib and the only thing new is the bitwise operation. str/bytes.count is not critical but not bad if it could be optimized and especially the effect

[issue28943] Use PyUnicode_MAX_CHAR_VALUE instead of PyUnicode_KIND in some API's short path

2016-12-12 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> rejected ___ Python tracker <http://bugs.python.org/issue28943> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue28943] Use PyUnicode_MAX_CHAR_VALUE instead of PyUnicode_KIND in some API's short path

2016-12-12 Thread Xiang Zhang
Xiang Zhang added the comment: I know the difference and thought the overhead should be tiny (not in a critical part). But benchmarks show it's not. :-( -- stage: patch review -> resolved status: open -> closed ___ Python tra

[issue28943] Use PyUnicode_MAX_CHAR_VALUE instead of PyUnicode_KIND in some API's short path

2016-12-12 Thread Xiang Zhang
New submission from Xiang Zhang: Some unicode APIs like PyUnicode_Contains get a short path comparing kinds. But this get a problem cannot apply to ascii and latin1. PyUnicode_MAX_CHAR_VALUE could be used instead to make the short path also apply to ascii and latin1. This skill is already

[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-10 Thread Xiang Zhang
Xiang Zhang added the comment: > Alternatively just BYTESTR_DEPS can be used instead of BYTESMETHODS_DEPS. > This would make easier moving implementations between bytesobject.c and > bytes_methods.c. Yes. The only downside of this is some changes may recompile bytes_methods.c unne

[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Xiang Zhang
Changes by Xiang Zhang : -- assignee: -> xiang.zhang keywords: +patch stage: needs patch -> patch review type: behavior -> versions: +Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45829/Makefile-bytes-meth

[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Xiang Zhang
New submission from Xiang Zhang: bytes_methods.c includes files in stringlib, for example, stringlib/count.h. But if count.h changes, simply running make won't recompile bytes_methods.c and the methods of bytes remain unchanged. You have to make distclean and compile from sc

[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread Xiang Zhang
Xiang Zhang added the comment: > I understand that count() is only used when the old and new patterns of > str.replace() have a different length. Yes. I thought it won't help much since str.replace get many operations. But for long string, looks good: ./python3 -m perf timeit -

[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread Xiang Zhang
New submission from Xiang Zhang: I make a try to improve str.count one character for latin1 string. From benchmark, it could enhance the speed depending on the length of the string. # short one, a little regression ./python3 -m perf timeit --compare-to ~/cpython/python -s 's=&qu

[issue28147] Unbounded memory growth resizing split-table dicts

2016-12-07 Thread Xiang Zhang
Xiang Zhang added the comment: __dict__.pop seems not uncommon. Searching Github could give many practical codes using it. And many of them are acting as generic containers and could be used against massive cases. -- ___ Python tracker <h

[issue28894] Memory leak in dict.pop()

2016-12-07 Thread Xiang Zhang
Xiang Zhang added the comment: This is the same problem as #28147. -- nosy: +xiang.zhang resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unbounded memory growth resizing split-table dicts ___ Python tr

[issue24329] __qualname__ and __slots__

2016-12-05 Thread Xiang Zhang
Xiang Zhang added the comment: > However, consistency is a good thing, so allowing it seems reasonable. The inconsistency also appears when "__classcell__" in slots with or without super(). v4 catches up with HEAD. -- Added file: http://bugs.python.org/file45762/slo

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

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

[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2016-12-02 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang stage: -> needs patch versions: +Python 3.7 -Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issu

[issue28728] test_host_resolution in test_socket fails

2016-11-30 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, sorry. > I was wondering if there was a separate way to detect the troublesome ISP > environment. How could you differentiate the failure between ISP environment caused and function behaved wrongly? Successfully resolve an invalid ip address doesn&#

[issue28728] test_host_resolution in test_socket fails

2016-11-30 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file45714/test_host_resolution.patch ___ Python tracker <http://bugs.python.org/issue28728> ___ ___ Python-bug

[issue28837] 2to3 does not wrap zip correctly

2016-11-30 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +benjamin.peterson versions: +Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue28837> ___ ___

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-11-29 Thread Xiang Zhang
Xiang Zhang added the comment: > Remaining question: what is the behaviour for direction=0, direction=100 or > direction=-2? Maybe we can add a few unit tests for strange values of > direction? (Not sure if it's worth it.) It's not documented so I also doubt it. Expe

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-11-29 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your reviews. :-) v2 updated the test codes. -- Added file: http://bugs.python.org/file45690/PyUnicode_FindChar-v2.patch ___ Python tracker <http://bugs.python.org/issue28

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-11-28 Thread Xiang Zhang
Xiang Zhang added the comment: Other APIs like PyUnicode_Find and PyUnicode_Count support it. Their docs are almost the same so I think PyUnicode_FindChar does not need to be the special one. After change, its behaviour and implementation are more consistent with other APIs

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-11-28 Thread Xiang Zhang
New submission from Xiang Zhang: PyUnicode_FindChar declares in the doc it treats its *start* and *end* parameters as str[start:end], same as other APIs like PyUnicode_Find, PyUnicode_Count. But it doesn't allow negative indices like others so violates the doc. -- compo

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-28 Thread Xiang Zhang
Xiang Zhang added the comment: > 4. Guard against misbehaving generators/iterables *before* they are put into > the taskqueue. This approach is good. 2 points about the patch: 1. How about _map_async(map)? Does it need the same strategy? For an iterator with __len__ defined it seems

[issue28334] netrc does not work if $HOME is not set

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

[issue14844] netrc does not handle accentuated characters

2016-11-27 Thread Xiang Zhang
Xiang Zhang added the comment: I opened #28806 to improve netrc library. This could be solved if it's merged. -- dependencies: +Improve the netrc library nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/is

[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-11-27 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. Although at first I am not in favour of this change but searching Github it seems all usages of this API doesn't check the possible error. -- nosy: +xiang.zhang ___ Python tracker <http://bugs.py

[issue28728] test_host_resolution in test_socket fails

2016-11-27 Thread Xiang Zhang
Xiang Zhang added the comment: The three ipv6 addresses are all invalid addresses if we conform to spec. "::1q" non hex characteres "::1::2"two "::" but at most one is allowed "1:1:1:1:1:1:1:1:1" 144 bits > 128 bits > Perha

[issue28780] netrc throws NetrcParseError for record without 'password'

2016-11-26 Thread Xiang Zhang
Changes by Xiang Zhang : -- dependencies: +Improve the netrc library ___ Python tracker <http://bugs.python.org/issue28780> ___ ___ Python-bugs-list mailin

[issue28806] Improve the netrc library

2016-11-26 Thread Xiang Zhang
New submission from Xiang Zhang: netrc library now gets some problems: 1. All tokens are mandatory. (#28780) 2. Token values are limited to a limited set of characters. (#557704) 3. Does not complain about macro definition without a null line. 4. If the login name is anonymous, security check

[issue28749] Fixed the documentation of the mapping codec APIs

2016-11-24 Thread Xiang Zhang
Xiang Zhang added the comment: v2 LGTM. -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue28749> ___ ___ Python-bugs-list mailing list Unsub

[issue28728] test_host_resolution in test_socket fails

2016-11-24 Thread Xiang Zhang
Xiang Zhang added the comment: > hosts: files mdns4_minimal [NOTFOUND=return] resolve > [!UNAVAIL=return] dns I think this is the default config. Same as mine. Does test_host_resolution still stably fails? -- ___ Python tracker

[issue28728] test_host_resolution in test_socket fails

2016-11-23 Thread Xiang Zhang
Xiang Zhang added the comment: Hi SilentGhost. I'm also using Ubuntu 16.10 but the test case doesn't fail. cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.10 DISTRIB_CODENAME=yakkety DISTRIB_DESCRIPTION="Ubuntu 16.10" ./python -Wa -m test -v test_socket | grep

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

2016-11-23 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Serhiy and Victor. Finished my first commit. :-) Now assign back to Serhiy and pos2 LGTM. -- assignee: xiang.zhang -> serhiy.storchaka ___ Python tracker <http://bugs.python.org/issu

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

[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

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

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

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

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

[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

[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

[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

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

[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

[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

[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

[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

<    4   5   6   7   8   9   10   11   12   13   >