Xiang Zhang added the comment:
I'm -1 on this change. I think the workaround is easy and direct.
--
___
Python tracker
<https://bugs.python.org/is
Xiang Zhang added the comment:
It looks to me pure Python implementation could not handle such cases. Put
aside other possible bugs, threading.Condition.wait re-acquire the lock using
threading.Condition._acquire_restore which could be interrupted and not able to
acquire the lock. So it
Change by Xiang Zhang :
--
nosy: +davin, pitrou
___
Python tracker
<https://bugs.python.org/issue34563>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Xiang Zhang :
--
type: crash -> behavior
___
Python tracker
<https://bugs.python.org/issue34505>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Xiang Zhang :
--
nosy: +inada.naoki, pitrou
___
Python tracker
<https://bugs.python.org/issue34608>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
It's not right to replace with statement by manually calling __enter__ and
__exit__. If there is any exception after __enter__ and before __exit__,
__exit__ method will be skipped. That's not wh
Change by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<https://bugs.python.org/issue34763>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
I have catched using `is` to do string equality check in our codebase by
linters before. Not all my colleagues know what's not suitable here.
The only common and suitable case I can think of is programmers are exploring
CPython internals, like
Xiang Zhang added the comment:
My PR https://github.com/python/cpython/pull/127 has tried to solve some
restrictions of the current netrc library. It's somewhat outdated since no
reviewer for a long time. As you can see there are also other libraries
suffering from the restric
Change by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<https://bugs.python.org/issue34979>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
I don't like the idea to display the contents in the repr, no matter entire or
clipped. I think it's not suitable and for contents, just read the object
manually. For me, a closed status plus the constructor arguments is a good
choice.
-
Xiang Zhang added the comment:
I carefully read both the two PRs. The first one, easy to understand. The
second one, I spend some time to figure out why the test doesn't crash, why we
need to have reference count checks in two places and make some experiments to
test in different cases
Xiang Zhang added the comment:
New changeset 83a07652e0033f0d9994ae7634b91d6581c56b00 by Xiang Zhang (Andrei
Petre) in branch 'master':
bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809)
https://github.com/python/cpyt
Change by Xiang Zhang :
--
pull_requests: +9386
___
Python tracker
<https://bugs.python.org/issue34748>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
New changeset 56a4a3aa555b3abc756cf837eddac4c0bf545db7 by Xiang Zhang in branch
'2.7':
[2.7] bpo-34748: link to :ref:`partial-objects` in functools.partial doc.
(GH-9809)
https://github.com/python/cpython/commit/56a4a3aa555b3abc756cf837eddac4
Xiang Zhang added the comment:
Thanks all. :-)
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Xiang Zhang added the comment:
Just find the same problem while investigating io.
--
nosy: +xiang.zhang
stage: patch review -> needs patch
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Change by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<https://bugs.python.org/issue35056>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Xiang Zhang :
io.IncrementalNewlineDecoder gets a *translate* bitwise struct field, but it
could be assigned arbitrary int value. This leads to inconsistent behaviour,
evens are evaluated to False and odds to True.
>>> io.IncrementalNewlineDecoder(encodi
Change by Xiang Zhang :
--
pull_requests: +9499
___
Python tracker
<https://bugs.python.org/issue34672>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
New changeset 163eca34c48f1b25e1504e37f4656773fd0fdc78 by Xiang Zhang in branch
'master':
bpo-34672: fix a compiler warning in timemodule.c (GH-10176)
https://github.com/python/cpython/commit/163eca34c48f1b25e1504e37f4656773fd0fdc78
-
Change by Xiang Zhang :
--
keywords: +patch
pull_requests: +9534
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Xiang Zhang added the comment:
New changeset b08746bfdf64e55ce33516f2065fa2aa4f51be95 by Xiang Zhang in branch
'master':
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument.
(GH-10217)
https://github.com/python/cpython/commit/b08746bfdf64e55ce33516f20
Change by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Xiang Zhang added the comment:
New changeset aa39c1ab6de6d3fb0204741efdde9b7eed25b093 by Xiang Zhang
(Lysandros Nikolaou) in branch '2.7':
[2.7] bpo-32804: Include the context parameter in urlretrieve documentation
(GH-10203)
https://github.com/python/cpyt
Change by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
Xiang Zhang added the comment:
v2 LGTM.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue28749>
___
___
Python-bugs-list mailing list
Unsub
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
Changes by Xiang Zhang :
--
dependencies: +Improve the netrc library
___
Python tracker
<http://bugs.python.org/issue28780>
___
___
Python-bugs-list mailin
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
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
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
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue28334>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Changes by Xiang Zhang :
--
nosy: +benjamin.peterson
versions: +Python 3.6, Python 3.7 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue28837>
___
___
Changes by Xiang Zhang :
Added file: http://bugs.python.org/file45714/test_host_resolution.patch
___
Python tracker
<http://bugs.python.org/issue28728>
___
___
Python-bug
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
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
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue28856>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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 -
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
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
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
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
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
Changes by Xiang Zhang :
--
resolution: -> rejected
___
Python tracker
<http://bugs.python.org/issue28943>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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_
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
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
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.
Changes by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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
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
Xiang Zhang added the comment:
Also http://stackoverflow.com/a/4199355/2189957.
--
___
Python tracker
<http://bugs.python.org/issue29008>
___
___
Python-bug
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
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
Changes by Xiang Zhang :
--
resolution: -> fixed
stage: commit review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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
Changes by Xiang Zhang :
--
nosy: +inada.naoki
___
Python tracker
<http://bugs.python.org/issue29019>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
Thanks Victor and Serhiy!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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
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
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.
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
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
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
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
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
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
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
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
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
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
Changes by Xiang Zhang :
--
resolution: -> third party
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue29064>
___
___
Python-bugs-
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
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
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,
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
__
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
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
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
Changes by Xiang Zhang :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue29100>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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.
-
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
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
601 - 700 of 1629 matches
Mail list logo