Xiang Zhang added the comment:
I considered that but don't why decide to preserve it. But now that you mention
it, I'll do that later.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/i
Xiang Zhang added the comment:
issue27861_conn_isolation_level.patch now adds argument type and value check
along with eliminating the potential sf.
--
Added file:
https://bugs.python.org/file44234/issue27861_conn_isolation_level.patch
___
Python
Xiang Zhang added the comment:
v3 applies haypo's suggestion.
--
Added file: http://bugs.python.org/file44192/list_resize_v3.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
Oh, sorry. Upload bot_failure_fix.patch to fix this.
--
Added file: http://bugs.python.org/file44207/bot_failure_fix.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/
Changes by Xiang Zhang <angwe...@126.com>:
--
components: +Library (Lib)
nosy: +davin
type: -> behavior
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Xiang Zhang added the comment:
Hi Georg, I left several comments on Rietveld. Hope it helps.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
One solution I can think of is alter the constructor of property() and add an
optional name attribute to it. If users really care about the exception
message, they can set the attribute to the property's name. If they don't care,
everything remains the same
Xiang Zhang added the comment:
issue27683.patch tries to fix this. It alters the doc and refactors the
constructor, so there is no difference between different arguments
As for IPv6Network, it has the same problem.
--
nosy: +xiang.zhang
Added file: http://bugs.python.org/file44193
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27860>
___
__
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27863>
___
__
Xiang Zhang added the comment:
For the first issue, the doc says:
The cursor method accepts a single optional parameter cursorClass. If supplied,
this must be a custom cursor class that extends sqlite3.Cursor.
So I think we should check the type and then raise TypeError.
For the second issue
Xiang Zhang added the comment:
Ping. :)
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27414>
___
___
Python-bugs-list
Xiang Zhang added the comment:
Thanks for the reply berker. It's nice to know this helper. :) But I'd like to
keep it as now since I don't see any real advantage to use it and swap_attr
will set the attribute even when it's absent, this is not wanted
Xiang Zhang added the comment:
`return value` is allowed in a generator to support `yield from'. You can read
https://www.python.org/dev/peps/pep-0380 for the entire story.
--
nosy: +xiang.zhang
resolution: -> not a bug
stage: -> resolved
status: open -&g
Xiang Zhang added the comment:
Why not OrderedDict.popitem(last=False)?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28293>
___
__
Xiang Zhang added the comment:
But with the compact dict implementation, popitem is not going to evict an
arbitrary entry but always the last one. Will this cause two interchangeably
used regexes always need to recompile?
--
nosy: +xiang.zhang
Changes by Xiang Zhang <angwe...@126.com>:
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bu
Xiang Zhang added the comment:
Though the delay arguments of keyword and positional are both 5, but their
register time has tiny difference: 930343695.274 vs 930343695.275, so
positional is printed first.
--
nosy: +xiang.zhang
___
Python tracker
Xiang Zhang added the comment:
Sorry, it's not 930343695.274 vs 930343695.275. I mean the register time is
time.time() + delay, so there is tiny difference between the two. You can
change the timefunc to lambda: int(time.time()), then you'll see keyword is
printed first
New submission from Xiang Zhang:
PyUnicode_AsUCS4 declares to raise ValueError if buffer length is smaller than
string length. But now the implementation raises SystemError.
--
components: Interpreter Core
messages: 277595
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
Xiang Zhang added the comment:
Yes. Changing the implementation or the doc is still in question so in the
title I just use conflicts. Scanning unicodeobject.c there seems no general
rules about which to use. But actually I'm in favour of ValueError. From the
description in https
Xiang Zhang added the comment:
Serhiy, in 05788a9a0b88, test_invalid_sequences seems don't have to stay in
CAPITest.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
Patch LGTM.
> I would rather not mess up with itermonthdates(), particularly in a bugfix
> release. We can postpone the discussion of a better way to handle date
> over/underflow in itermonthdates() until 3.7.
Before finally find a better way, can we
Xiang Zhang added the comment:
v3 resolves comments on v2.
--
Added file: http://bugs.python.org/file44928/PyUnicode_AsUCS4_v3.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
Here is the patch.
--
keywords: +patch
stage: -> patch review
Added file: http://bugs.python.org/file44870/PyUnicode_AsUCS4.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.or
New submission from Xiang Zhang:
_PyUnicodeWriter_Finish gets 2 problems now:
1. It has two same branches handling empty strings which is redundant.
2. It may leak the inner buffer object when resize_compact fails. When
resize_compact fails, the buffer object is left untouched
Xiang Zhang added the comment:
The cost is really small (an integer compare vs memory malloc and copy). The
advantages are fast path for empty strings and retaining consistency with other
codes in unicodeobject.c. You can see other places use the same optimization,
e.g. PyUnicode_FromUnicode
Xiang Zhang added the comment:
Ping. ;-)
--
nosy: +pmoody
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27683>
___
___
Python-bugs-
Changes by Xiang Zhang <angwe...@126.com>:
--
stage: -> resolved
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28558>
___
___
Xiang Zhang added the comment:
This is the expected behaviour. The doc explicitly says "Note that nargs=1
produces a list of one item. This is different from the default, in which the
item is produced by itself". Read
https://docs.python.org/3/library/argparse.html#nargs.
-
New submission from Xiang Zhang:
In utf8_encoder, when a codecs returns a string with non-ascii characters, it
raises encodeerror but the start and end position are not perfect. This seems
like an oversight during evolution. Before, utf8_encoder only recognize one
surrogate character a time
Changes by Xiang Zhang <angwe...@126.com>:
Added file: http://bugs.python.org/file45273/utf8_encoder_v2.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Xiang Zhang added the comment:
The bug is fixed in #23319. More recent Py2.7 and Py3.4+ should get rid of it.
--
nosy: +xiang.zhang
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.pytho
Xiang Zhang added the comment:
> '1?2:3?4:5' -> '(2 if 1 else 3)?4:5' -> '(4 if (2 if 1 else 3) else 5'
This is not right. It's right associative so it should be
1?2:(3?4:5) -> 1?2:(4 if 3 else 5) -> 2 if 1 else (4 if 3 else 5)
> It would be nice to make c2py() working wi
Xiang Zhang added the comment:
This seems a same problem as in #27780.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
gettext_c2py_v2.patch implements a simple C expression parser. More tests are
included.
Carl, hope you are willing to test it.
--
Added file: http://bugs.python.org/file45373/gettext_c2py_v2.patch
___
Python tracker
Xiang Zhang added the comment:
IMHO, _PyUnicode_FromASCII is a private API and could be used in other places
in future. We should not rely on the caller to check and return the singleton
empty string.
--
___
Python tracker <rep...@bugs.python.
New submission from Xiang Zhang:
The assert statement `assert(Py_UNICODE_IS_SURROGATE(ch));` in
_Py_DecodeUTF8_surrogateescape is wrong. Code points > 0x could reach it
and fail.
--
files: false_assert.patch
keywords: patch
messages: 280406
nosy: serhiy.storchaka, xiang.zh
Xiang Zhang added the comment:
Why should it work Yury?
__qualname__ and __doc__(if exists) are inserted into the dict when creating a
class.
>>> class Foo:
... """bar"""
... __slots__ = ('__doc__',)
...
Traceback (most recent call last):
Fi
Changes by Xiang Zhang <angwe...@126.com>:
--
keywords: +patch
stage: -> patch review
type: -> behavior
Added file: http://bugs.python.org/file45420/slots_qualname.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.
Xiang Zhang added the comment:
I doubt this deserves a change. The slow import is the case only the first time
functools is imported. Later imports will just use the cache (sys.modules). And
if this is gonna change, maybe we don't have to copy the entire namedtuple
structure?
--
nosy
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +ncoghlan, rhettinger
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28638>
___
Xiang Zhang added the comment:
> Yes. But first import time is also important for CLI applications.
That's why mercurial and Bazaar has lazy import system.
The lazy import system could benefit many libs so the result could be
impressive. But here only functools is enhanced, half a millisec
Xiang Zhang added the comment:
> Sorry Xiang, but your patch looks overcomplicated to me. Too much methods,
> decorators, classes, too much strange names.
It's fine. That's a Pratt parser. Yes, the names are strange. Your patch looks
more simpler. I left several co
Xiang Zhang added the comment:
LGTM. And I expect there could be a comment about the special decimal number.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
> What a comment you need Xiang? Isn't existing comment enough?
Serhiy, I mean the case a number starting with 0, e.g. 0123. The plural form is
a C expression and in C 0123 is an octal number. c2py now interprets it as a
decimal num
Xiang Zhang added the comment:
v3 updates the test cases.
--
Added file: http://bugs.python.org/file45444/slots_special_v3.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
> What about other names set when creating a class? __module__, __class__,
> __classcell__?
__module__ remains in the class dict so I think it's a class variable.
Will __class__ be set? It's inserted into the function scope.
__classcell__ I think has th
Xiang Zhang added the comment:
slots_special_v2 fixes a bug in the previous patch.
--
Added file: http://bugs.python.org/file45425/slots_special_v2.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
is an empty tag. It closes it self, not '/>'.
With some content, you can see it has start and end tag.
>>> import xml.etree.cElementTree as ET
>>> events = ET.Element('Events')
>>> events.text = 'abc'
>>> tree = ET.Element
Xiang Zhang added the comment:
s/not/note
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28659>
___
___
Python-bugs-list
Xiang Zhang added the comment:
I think of them but currently they don't pose a problem for practical codes
like __qualname__. Maybe leaving them until there comes a real need?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Changes by Xiang Zhang <angwe...@126.com>:
Added file: http://bugs.python.org/file45421/slots_qualname_v2.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Xiang Zhang added the comment:
Christian, I think our patches are quite similar in function. They only allow
limited tokens.
> I consider it a superior solution and a fix for more generic attacks
Mine now still allows **. But it can be easily fixed.
But both our patches still translate
Xiang Zhang added the comment:
> gettext.c2py("n()")(lambda: os.system("sh"))
> gettext.c2py("1()")(0)
Empty parentheses should be disallowed. Function calls are not allowed in
plural expression. And non-integer argument should be disallowed either, just
Xiang Zhang added the comment:
> Perhaps it should give a DeprectationWarning and delegate to _Plural?
I hold a conservative opinion about this. c2py in my mind should be a inner
help method. It's not documented so if there are users using it, they are
risking changes. And as reported h
Xiang Zhang added the comment:
The code has already been changed in #27454.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Xiang Zhang <angwe...@126.com>:
--
components: Interpreter Core
files: PyUnicode_EncodeLocale.patch
keywords: patch
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Remove redundant
New submission from Xiang Zhang:
The patch makes several cleanups to
unicode_decode_call_errorhandler_wchar/writer:
1. Use U instead O! for argument parser, it ought to be more efficient and
write less code.
2. In theory, if inputobj is not bytes, there needs to be a goto onError
Xiang Zhang added the comment:
> Isn't this already implemented?
Get the same question. dict.__sizeof__ can identify shared dicts.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.or
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28509>
___
__
Xiang Zhang added the comment:
LGTM.
Actually I just read the codecs error handles codes last day but didn't think
of this. :-(
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Xiang Zhang <angwe...@126.com>:
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bu
Xiang Zhang added the comment:
Ping.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27931>
___
___
Python-bugs-list mailing list
Xiang Zhang added the comment:
Marc-Andre, shouldn't the C API of unicode.encode() be
PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedUnicode now?
BTW Serhiy, how about PyUnicode_AsEncodedObject? Not see it in your deprecate
list
Xiang Zhang added the comment:
Is disabling all logging messages a common need? Maybe other levels are common
but we can't know.
And at least the doc patch needs a versionchanged tag.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.
Xiang Zhang added the comment:
> We could use sys.maxsize instead of logging.CRITICAL to disable any custom
> logging levels as well if this is a concern.
sys.maxsize is not the upper bound limit of integers in Python. There is no
such value in Python3.
> The use case I've found
Xiang Zhang added the comment:
LGTM. I can understand the wording.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28426>
___
___
Changes by Xiang Zhang <angwe...@126.com>:
Added file: http://bugs.python.org/file45220/utf7_encoder.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
New submission from Xiang Zhang:
Currently utf7 encoder uses an aggressive memory allocation strategy: use the
worst case 8. We can tighten the worst case.
For 1 byte and 2 byte unicodes, the worst case could be 3*n + 2. For 4 byte
unicodes, the worst case could be 6*n + 2.
There are 2 cases
Changes by Xiang Zhang <angwe...@126.com>:
Removed file: http://bugs.python.org/file45219/utf7_encoder.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Xiang Zhang added the comment:
Thanks for your review Serhiy.
I don't receive the notification. :-( Honestly speaking I miss some
notification emails from time to time, but not all. I'll consider choosing
another ISP. I have to manually check the Rietveld now to avoid missing any
comments
Xiang Zhang added the comment:
Looks like commit 284676cf2ac8 in #10740 introduces this. Haven't read through
the thread yet.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
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 fail too
Xiang Zhang added the comment:
Maybe you have forgotten to remove the debug print in the patch?
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
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 <
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:
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 test_host_
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 <angwe...@126.com>:
--
dependencies: +Improve the netrc library
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
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 <rep...@bugs.python.org>
<http://bug
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 <rep...@bugs.python.org>
<http://bug
Changes by Xiang Zhang <angwe...@126.com>:
--
stage: -> resolved
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28766>
___
___
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
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 tracke
Xiang Zhang added the comment:
v2 LGTM.
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28749>
___
___
Pyth
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
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.
--
components
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:
> 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
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 <rep...@bugs.python.org>
<http://bugs.p
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 <rep...@bugs.python.org>
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28334>
___
__
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 deq
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:
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 tracker <
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:
+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 <rep...@bugs.python.org>
<http://bugs.python.org/i
Xiang Zhang added the comment:
LGTM.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28701>
___
___
Python-bugs-list mailing list
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.
--
Adde
701 - 800 of 1625 matches
Mail list logo