Xiang Zhang added the comment:
I agree with you. But right now, it seems parsing short options and
allow_abbrev both rely on the same logic. If you turn off allow_abbrev, short
options parsing also disabled. Separating them seems nontrivial
New submission from Xiang Zhang:
Information about CodeType in inspect documentation is outdated. It lacks
attributes: co_kwonlyargcount, co_freevars, co_cellvars. And co_flags lacks
many more options. These also apply to the comments of inspect.iscode source
code.
--
assignee: docs
New submission from Xiang Zhang:
Doc of PyFunction_New[1] is not perfect.
1. *__module__* is not retrieved from *code* but *globals*.
2. Add descriptions for annotations and qualname.
[1] https://docs.python.org/3/c-api/function.html#c.PyFunction_New
--
files
Changes by Xiang Zhang :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
___
Python tracker
<http://bugs.python.org/issue26986>
___
_
Xiang Zhang added the comment:
It seems pypi is blocked in China, :-( so try pypi mirror in China. ez_setup.py
seems to have --download-base option to let you specify alternative URL. I
don't think this is a bug.
--
nosy: +xiang.zhang
___
P
Xiang Zhang added the comment:
Attach patch.
--
keywords: +patch
Added file: http://bugs.python.org/file42793/inspect_doc.patch
___
Python tracker
<http://bugs.python.org/issue26
New submission from Xiang Zhang:
*names* is not Py_DECREFed in MAKE_FUNCTION in error case.
--
files: make_function_reference_leak.patch
keywords: patch
messages: 265235
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Possible reference leak in
Xiang Zhang added the comment:
Sorry, wrong patch. Attach the right one.
--
Added file: http://bugs.python.org/file42795/make_function_reference_leak.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
I'm willing to. But I don't know where is the suitable place to put such a test
and since the reference leak only appears in error case, can compile a function
with annotations in a loop accomplish the
New submission from Xiang Zhang:
I think filter's doc can be improved[1]:
1. It doesn't mention ``bool``. ``bool`` is treated the same way as ``None``.
It is not called. But this is not mentioned.
2. 'the identity function is assumed' is confusing, at least for me. It loo
Xiang Zhang added the comment:
First I have to clarify that my mistake is not in understanding but in writing.
What I mean by 'identify the return value True or False' is actually what you
say, 'evaluate for truth or falsehood'. I also notice the lowercase false and
tru
Xiang Zhang added the comment:
It's OK. Thanks for all your info and do learn. BTW, Franklin, I knew what will
happen when ``bool`` is passed.
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
Not about code, just the doc. In my opinion, if ``bool`` is not called it is
definitely not equivalent to ``(item for item in iterable if function(item))``,
which actually calls the function, even there is nothing different in the
result. But, this is a rather
New submission from Xiang Zhang:
The error message of ``ord`` is not that right. It says 'ord() expected string
of length 1'. I don't think in Py3.x string can refer to both bytes and
unicodes.
--
messages: 265376
nosy: xiang.zhang
priority: normal
severity: normal
sta
Xiang Zhang added the comment:
If you think it's OK, it's fine. Please close this thread.
--
___
Python tracker
<http://bugs.python.org/issue27008>
___
___
Xiang Zhang added the comment:
BTW, what do you think about the second TypeError in ``ord``. Shouldn't it be
ValueError?
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
Ohh, you have tried to do that. It must be a large work.
But on the other hand, if this is a too large work, why not solve this case by
case? This work is too large to get someone work on it, even you, the most
active developer in the community I see have
Xiang Zhang added the comment:
I also notice the document. I get surprised when I see the implementation also
supports bytes while the doc says one unicode character. But then I tell myself
that maybe unicode character also includes bytes? I am not sure about the
English description.
But
Xiang Zhang added the comment:
Why? I think this is the right behaviour. According to the rfc[1], square
brackets are used and only used to refer IPv6 address in URI. Square brackets
are reserved characters and the URI you give is not correct.
1. http://tools.ietf.org/html/rfc3986#section-3
Xiang Zhang added the comment:
As a general purpose library for url parsing, I think conforming to the
existing standard is a good choice.
'http://google.com]' is a malformed URI according to the standard and then I
think raising an exception is quite suitable. Of course there
Xiang Zhang added the comment:
Ohh, not objective, but subjective. Sorry.
--
___
Python tracker
<http://bugs.python.org/issue27089>
___
___
Python-bugs-list mailin
Xiang Zhang added the comment:
Once I also mentioned about this in another thread, issue27008, I created and
Serhiy gave me a response. You can have a look at that.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue27
Changes by Xiang Zhang :
--
nosy: +serhiy.storchaka
___
Python tracker
<http://bugs.python.org/issue27092>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
Reopen this since the solution is not complete pointed out by Serhiy and the
new patch has already been attached(s2).
--
status: closed -> open
___
Python tracker
<http://bugs.python.org/issu
Xiang Zhang added the comment:
I cannot reproduce this. Pickling memoryview objects works well on my OS.
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
Xiang Zhang added the comment:
This seems to be designed. From PEP343 it tells clearly:
If either of the relevant methods are not found
as expected, the interpreter will raise AttributeError, in the
order that they are tried (__exit__, __enter__).
But currently I don't find ou
Xiang Zhang added the comment:
I don't think no need to swap. The current doc is right.
>>> re.findall(r'\W+', 'abcd123_#')
['#']
>>> re.findall(r'\w+', 'abcd123_#')
['abcd123_']
It'
New submission from Xiang Zhang:
Several Py_XDECREFs are not necessary since the pointers they handle cannot be
NULL.
--
files: Py_XDECREF_in_typeobject.diff
keywords: patch
messages: 266307
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Several Py_XDECREFs are
Changes by Xiang Zhang :
--
title: Several Py_XDECREFs are not necessary -> Several Py_XDECREFs in
typeobject.c are not necessary
type: -> enhancement
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/i
Changes by Xiang Zhang :
--
title: Several Py_XDECREFs in typeobject.c are not necessary -> Several
Py_XDE/INCREFs in typeobject.c are not necessary
___
Python tracker
<http://bugs.python.org/issu
Xiang Zhang added the comment:
It's my pleasure and thanks for your time reviewing this thread too.
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
This behaviour seems to have been fixed in issue25626. But you can only get
that feature with Python3.5+.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue27
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue5996>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Xiang Zhang :
--
resolution: -> wont fix
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue26816>
___
___
Python-bugs-list
Changes by Xiang Zhang :
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue27130>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
Quick and careless scanning at night lead me to a wrong result, Sorry.
> You would need to compress just under 4 GiB of data that requires 5 MB or
> more when compressed (i.e. not all the same bytes, or maybe try level=0).
With enough memory, compressin
New submission from Xiang Zhang:
The problem is what the title tells and can be produced by the snippet below.
import sys
import os
sys.stdout.write("%s\n" % sys.stdin.mode)
sys.stdout.flush()
f = os.fdopen(sys.stdin.fileno(), "r")
f.write("")
f.flush()
f.
Xiang Zhang added the comment:
Thanks for your reply Ned and it does solve my puzzle. It's my fault to
misunderstand the attribute and make noise here.
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
Vinay, this patch introduces regressions.
You can either revert this part:
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -329,8 +329,7 @@ class Command:
# -- External world manipulation ---
def warn(self, msg
New submission from Xiang Zhang:
Just as the patch shows, when PyErr_Occurred() returns true mod is NULL, then
Py_INCREF(mod) will crash. Replace it with Py_XINCREF.
--
components: Interpreter Core
files: create_builtin.patch
keywords: patch
messages: 274007
nosy: brett.cannon
New submission from Xiang Zhang:
The two PyErr_Occurred check in exec_builtin_or_dynamic are unnecessary. The
PyModule_Check at the beginning of exec_builtin_or_dynamic has eliminated the
possibility for PyModule_GetDef/State to fail.
--
components: Interpreter Core
files
New submission from Xiang Zhang:
There is a comment in PyModule_ExcDef:
/* handled in PyModule_CreateFromSlots */
But there seems never exists PyModule_CreateFromSlots, I think
PyModule_CreateFromSlots should be PyModule_FromDefAndSpec2.
--
files: PyModule_ExcDef_comment.patch
Xiang Zhang added the comment:
It's okay. Glad that you spare some time to reply. :)
--
___
Python tracker
<http://bugs.python.org/issue27911>
___
___
Pytho
New submission from Xiang Zhang:
When I run test suites I find something interesting. Even if I don't enable gui
resource there are still windows flashing. The two tests are test_idle and
test_tk. I think the root cause is that they both use
test.support.import_module with no reason and
Xiang Zhang added the comment:
For your reference, the root.update is introduced in issue22770.
--
___
Python tracker
<http://bugs.python.org/issue27918>
___
___
Xiang Zhang added the comment:
I tried that, no help to this thread, but I think that is better.
root.update itself draws something on the screen.
--
___
Python tracker
<http://bugs.python.org/issue27
Xiang Zhang added the comment:
Ahh, sorry. I misunderstand your message. Just ignore my last one. Really sorry
for making noise.
Your suggestion makes sense I think.
--
___
Python tracker
<http://bugs.python.org/issue27
Xiang Zhang added the comment:
> they both use test.support.import_module with no reason
Sorry, this is a typo. I meant to say "they both use test.support.requires".
There should be *no* "no reason" and it's "requires" not "import_module". Sorry
Xiang Zhang added the comment:
I thought about this method but didn't find it's simpler.
You cannot avoid malloc/free since the isolation level has to be on heap. It's
going to be freed in the dealloc method unless your alter that part too. Then
it's about one memcpy o
Xiang Zhang added the comment:
It's my pleasure.
> My point was that even when I request gui, I still don't want to see the
> flash.
I also mean that in my last message, in this sentence " Even gui is enabled a
single support.requires may seem somewhat confusing to fl
Changes by Xiang Zhang :
Removed file: http://bugs.python.org/file44314/issue27918.patch
___
Python tracker
<http://bugs.python.org/issue27918>
___
___
Python-bugs-list m
Changes by Xiang Zhang :
Added file: http://bugs.python.org/file44315/issue27918.patch
___
Python tracker
<http://bugs.python.org/issue27918>
___
___
Python-bugs-list m
Xiang Zhang added the comment:
Hmm, you do this "It's going to be freed in the dealloc method unless your
alter that part too". If this is done I admit this is more clean. Patch LGTM.
--
___
Python tracker
<http://bugs.pyt
Xiang Zhang added the comment:
Looking at the spec this is a valid angle addr. Not only
et_angle_addr('<""@wiarcom.com> SIZE=28113')[0].addr_spec but also
et_angle_addr('<""@wiarcom.com> SIZE=28113')[0].local_part fails for the same
reason.
Xiang Zhang added the comment:
Though FATAL is not mentioned in the doc, but I think it should be added to
getLevelName, just like how WARN is handled now:
>>> logging.getLevelName("WARN")
30
--
keywords: +patch
nosy: +xiang.zhang
Added file: http://bugs.p
Xiang Zhang added the comment:
What's the meaning of the first method?
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue27937>
___
___
Xiang Zhang added the comment:
No, I mean this method you propose:
return _levelToName.get(level, (_nameToLevel.get(level, ("Level %s" % level
I cannot see any difference with the original code, except parentheses.
--
___
Python trac
Xiang Zhang added the comment:
It looks that new patch when used like this hashlib.scrypt(b'password') will
generate a "an integer is required" exception message which is misleading. I
don't test it since I don't get openssl 1.1.
And the phrase "interpreted
Xiang Zhang added the comment:
It looks good. But Christian, may I ask how do you generate the argument
clinic? It looks from me that the declaration cannot give you such a format
"y*|$y*O!O!O!ll:scrypt". I rerun clinic.py and the .c.h file is altered. Maybe
it's better to
Xiang Zhang added the comment:
It should be. If there is anything wrong I'd like to hear and fix.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Xiang Zhang:
This sentence "bytes with a numeric value of 128 or greater must be expressed
with escapes" is wrong and not complete. The value needs to be escaped is >=
127 and < 32.
--
assignee: docs@python
components: Doc
Xiang Zhang added the comment:
Ooh, sorry. It seems I misunderstand the meaning of the sentence. I understand
the value as the output of repr, I mean b'\x01'. It means how it's created.
Thanks for your reply and sorry for the noise. I close this then.
--
resolution
New submission from Xiang Zhang:
Every time running make I can get such messages:
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
sed -e "s,@EXENAME@,/usr/local/bin/python3.6m," < ./Misc/python-config.in
>python-config.py
# Replace
Changes by Xiang Zhang :
--
keywords: +patch
Added file: http://bugs.python.org/file44355/issue27950.patch
___
Python tracker
<http://bugs.python.org/issue27
Xiang Zhang added the comment:
> However it seems that other Make implementations might take your comments in
> the middle of a list of commands as a sign to end the list of commands.
If this is true then it seems we have to move the comments before the rules.
Another way that might w
Xiang Zhang added the comment:
Ooh, sorry. This "Another way that might work is adding @ to silence the
comment before the comments" should also fall in "However it seems that other
Make implementations might take your comments in the middle of a list of
commands as a sign to
Xiang Zhang added the comment:
That is not ideal. @# can silence the comment but actually it is still not a
comment. The "# ..." part still will be evaluated by shell.
--
___
Python tracker
<http://bugs.python.o
Xiang Zhang added the comment:
After more study, I think we can do just as what I have pointed out as the
problem, ': #...". This can make us have an indent comment that won't be
evaluated by the shell. And we only need to add @ before it so it won't be
echoed.
As for
Xiang Zhang added the comment:
Ohh, it's reasonable. I forgot # means also comments in shell. What a shame. :(
But can we make it '@ #...'? Note there is a space. In my editor(Emacs),
'@#' will break highlight and highlight it as a command, which is a hurt
during r
Xiang Zhang added the comment:
Hi Terry, I think this issue may be not completed. While running idlelib test
with -ugui, I can sometimes still get a window flash. I think it's due to
test_searchbase. Running python -m idlelib.idle_test.test_searchbase can
reproduce the flash and a
Xiang Zhang added the comment:
After some tries, I think it seems to be caused by the second open in
test_open_and_close in SearchDialogBaseTest. The second open calls
self.top.deiconify.
--
___
Python tracker
<http://bugs.python.org/issue27
Xiang Zhang added the comment:
Patch LGTM. But one thing is that every time it returns a new instance of
SSL.Session. That means ssl_sock.session == ssl_sock.session will always return
False right now. Is it useful to make it comparable?
--
nosy: +xiang.zhang
Xiang Zhang added the comment:
It's fine, knowing that the maintainer thinks this behaviour is okay. :)
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
Hmm, I tested the example snippet but it works. And PyMem_Free shouldn't fail
when encounter NULL. The doc explicitly says "If p is NULL, no operation is
performed".
--
nosy: +xiang.zhang
___
Python
Xiang Zhang added the comment:
Same as my comment in issue27963.
Python 2.7.12+ (2.7:de9e410e78d8, Sep 6 2016, 12:28:48)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
&g
Xiang Zhang added the comment:
Ooh, I treat dereference as decref, sorry. Then I think it may happen when
there is not enough memory. But your patch is not complete, at least you should
Py_DECREF(result). But this function may need more care since the malloc
failure in it will alter states
Xiang Zhang added the comment:
I suggest close this as duplicate of issue27963 and fix these all in that issue.
--
___
Python tracker
<http://bugs.python.org/issue27
Xiang Zhang added the comment:
issue27963.patch tries to fix the crash caused by not enough memory and avoid
inconsistent state when failure.
--
keywords: +patch
Added file: http://bugs.python.org/file44390/issue27963.patch
___
Python tracker
<h
New submission from Xiang Zhang:
Compile py2.7 will generate two unused variable warnings in sqlite3 module. The
variables have already not existed in py3.
/home/angwer/py2.7/Modules/_sqlite/cursor.c: In function
‘pysqlite_cursor_dealloc’:
/home/angwer/py2.7/Modules/_sqlite/cursor.c:121:9
New submission from Xiang Zhang:
./python -m test test_coroutines
Run tests sequentially
0:00:00 [1/1] test_coroutines
/home/angwer/cpython/Lib/test/test_coroutines.py:891: RuntimeWarning: coroutine
'CoroutineTest.test_await_12..coro' was never awaited
return await Awaitable()
/h
New submission from Xiang Zhang:
Right now, when running test_gdb generates following message:
./python -m test test_gdb
Run tests sequentially
0:00:00 [1/1] test_gdb
*Python Exception No module named gdb:
*gdb: warning:
*Could not load the Python gdb module from `/usr/local/share/gdb/python
Xiang Zhang added the comment:
With the latest build, even encode will fail:
Python 3.6.0a4+ (default:dad4c42869f6, Sep 6 2016, 21:41:38)
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>&
Xiang Zhang added the comment:
My PC is Ubuntu15.10, kernel 4.2, though CPU not Skylake. Everything works fine.
test_aead_aes_gcm (test.test_socket.LinuxKernelCryptoAPI) ... skipped "('[Errno
2] No such file or directory', 'aead',
New submission from Xiang Zhang:
_ManageReload in importlib._bootstrap seems obsolete since reve729b946cc03,
remove it?
--
files: importlib__bootstrap.patch
keywords: patch
messages: 274564
nosy: brett.cannon, xiang.zhang
priority: normal
severity: normal
status: open
title: Remove
Changes by Xiang Zhang :
--
nosy: +serhiy.storchaka
___
Python tracker
<http://bugs.python.org/issue27963>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
ping :)
--
___
Python tracker
<http://bugs.python.org/issue27683>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
Run hg bisect and get 756c27efe193.
--
nosy: +benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue27968>
___
___
Pytho
Xiang Zhang added the comment:
Thanks for your notice, Nick. :) Of course I am interested. I'll start
following import-sig and reading Petr's good idea.
--
___
Python tracker
<http://bugs.python.o
Xiang Zhang added the comment:
> Also one side effect that I can not eliminate is when it is used as a normal
> function, the function instead of None is returned. I see the former patches
> get this problem too.
I think this does not matter after seeing functools.singledisp
Xiang Zhang added the comment:
It's also better to add the typecheck to dispatch. Otherwise sometimes it can
generate not obvious exception message.
>>> from enum import IntEnum
>>> from functools import singledispatch
>>> IS = IntEnum("IS",
Xiang Zhang added the comment:
Please see issue27275. Someone has already complained about this. And I think
the cause is the gap between Pure Python implementation and C implementation
when it comes to subclasses.
--
nosy: +xiang.zhang
___
Python
Xiang Zhang added the comment:
You should use a//b instead of int(a/b).
>>> 11**19 - 11**19//23*23
15
>>> 11**19 - int(11**19/23)*23
1395
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.
Xiang Zhang added the comment:
Ping this and hope you don't forget about it David. :)
--
___
Python tracker
<http://bugs.python.org/issue27931>
___
___
Pytho
Xiang Zhang added the comment:
It looks to me the only reason to this is dk_lookup returns wrong value and I
seem to find one in lookdict. Not sure this can solve the problem.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.
Changes by Xiang Zhang :
--
keywords: +patch
Added file: http://bugs.python.org/file44493/issue28040.patch
___
Python tracker
<http://bugs.python.org/issue28
Xiang Zhang added the comment:
Are you sure INADA? The previous dict implementation has the same constraint
but does merge in dict_pop.
--
___
Python tracker
<http://bugs.python.org/issue28
Xiang Zhang added the comment:
does should be does not. Sorry.
--
___
Python tracker
<http://bugs.python.org/issue28040>
___
___
Python-bugs-list mailin
Changes by Xiang Zhang :
Removed file: http://bugs.python.org/file44493/issue28040.patch
___
Python tracker
<http://bugs.python.org/issue28040>
___
___
Python-bugs-list m
Changes by Xiang Zhang :
--
Removed message: http://bugs.python.org/msg275292
___
Python tracker
<http://bugs.python.org/issue28040>
___
___
Python-bugs-list m
Xiang Zhang added the comment:
You are right David. But I don't understand what it has to do with
headerregistry. I update my original patch to get that behaviour, limit it the
affection in angleaddr. Now seems everything is fine.
>>> email._header_value_parser.get_angle_addr(
1301 - 1400 of 1629 matches
Mail list logo