Xiang Zhang added the comment:
LGTM generally. :-)
--
___
Python tracker
<http://bugs.python.org/issue29099>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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:
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:
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
Changes by Xiang Zhang :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue29100>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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:
> 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:
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:
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:
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
Changes by Xiang Zhang :
--
resolution: -> third party
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue29064>
___
___
Python-bugs-
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
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:
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:
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:
> 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
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
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
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
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:
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:
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:
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
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:
Thanks Victor and Serhiy!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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. 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 :
--
resolution: -> fixed
stage: commit review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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
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:
Also http://stackoverflow.com/a/4199355/2189957.
--
___
Python tracker
<http://bugs.python.org/issue29008>
___
___
Python-bug
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:
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
Changes by Xiang Zhang :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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 :
--
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
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
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_
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
Changes by Xiang Zhang :
--
resolution: -> rejected
___
Python tracker
<http://bugs.python.org/issue28943>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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:
> 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
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
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
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:
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:
__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
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:
> 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
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue28856>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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 :
Added file: http://bugs.python.org/file45714/test_host_resolution.patch
___
Python tracker
<http://bugs.python.org/issue28728>
___
___
Python-bug
Changes by Xiang Zhang :
--
nosy: +benjamin.peterson
versions: +Python 3.6, Python 3.7 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue28837>
___
___
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
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:
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
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:
> 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
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:
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
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:
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
Changes by Xiang Zhang :
--
dependencies: +Improve the netrc library
___
Python tracker
<http://bugs.python.org/issue28780>
___
___
Python-bugs-list mailin
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
Xiang Zhang added the comment:
v2 LGTM.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue28749>
___
___
Python-bugs-list mailing list
Unsub
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:
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:
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
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
Changes by Xiang Zhang :
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue28766>
___
___
Python-bugs-list mailing list
Unsubscrib
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
Xiang Zhang added the comment:
Thanks for your work, Serhiy. ;-)
--
___
Python tracker
<http://bugs.python.org/issue28760>
___
___
Python-bugs-list mailin
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
Changes by Xiang Zhang :
--
versions: +Python 3.7 -Python 3.5
___
Python tracker
<http://bugs.python.org/issue15851>
___
___
Python-bugs-list mailing list
Unsub
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
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
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
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
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
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
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
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
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
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
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.
-
Xiang Zhang added the comment:
LGTM.
--
___
Python tracker
<http://bugs.python.org/issue28701>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
Changes by Xiang Zhang :
Added file: http://bugs.python.org/file45480/_PyUnicode_EqualToId_v2.patch
___
Python tracker
<http://bugs.python.org/issue21449>
___
___
Pytho
801 - 900 of 1629 matches
Mail list logo