[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu
ZhengYu, Xu added the comment: But with different classed will be right ``` class C: def __rrshift__(self, v): return 1 class D: def __rrshift__(self, v): return 2 C() >> D() # 2 ``` -- ___ Python tracker

[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu
New submission from ZhengYu, Xu : ``` class C: def __rrshift__(self, v): return 1 C() >> C() # raise TypeError: unsupported operand types(s) for >>: 'C' and 'C' ``` ------ messages: 414578 nosy: zen-xu priority: normal severity: normal sta

[issue46055] Speed up binary shifting operators

2021-12-12 Thread Xinhang Xu
Xinhang Xu added the comment: I post a comment to the PR showing its performance improvement. I paste it below. I think the result not bad. - I use timeit to measure time costs and any other operators or calls are excluded. For each testcase, the former is dcd2796 and the

[issue46055] Speed up binary shifting operators

2021-12-11 Thread Xinhang Xu
New submission from Xinhang Xu : See its PR. - Inspired by [bpo-44946](https://bugs.python.org/issue44946), I found there were no special shortcuts for shifting operation applied to "medium value" long object. So I modified CPython's VM to accelerate my python proj

[issue44946] Integer operations are inefficient for "medium" integers.

2021-12-10 Thread Xinhang Xu
Change by Xinhang Xu : -- nosy: +xuxinhang nosy_count: 3.0 -> 4.0 pull_requests: +28270 pull_request: https://github.com/python/cpython/pull/30044 ___ Python tracker <https://bugs.python.org/issu

[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Xinhang Xu
New submission from Xinhang Xu : Hello. I'm working on a compute-bound project recently, so I tested several Python versions on my PC (Windows 10 64-bit), about Python's performance on operating Int object. All Python binaries are official distributions. Testcase #1 (simple xor o

[issue35540] dataclasses.asdict breaks with defaultdict fields

2021-10-28 Thread Raymond Xu
Raymond Xu added the comment: I am seeing this bug with 3.9.7 -- nosy: +greenfish6 ___ Python tracker <https://bugs.python.org/issue35540> ___ ___ Python-bug

[issue44022] "urllib" will result to deny of service

2021-05-05 Thread Gen Xu
Gen Xu added the comment: Looks like it is caused by the httplib not limiting total header size after receiving 100. Added a counter for that to be same size as _MAXLINE=65536. -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.

[issue44022] "urllib" will result to deny of service

2021-05-05 Thread Gen Xu
Gen Xu added the comment: Added a possible PR. Review will be appreicated. -- ___ Python tracker <https://bugs.python.org/issue44022> ___ ___ Python-bugs-list m

[issue44022] "urllib" will result to deny of service

2021-05-05 Thread Gen Xu
Change by Gen Xu : -- keywords: +patch nosy: +gen-xu nosy_count: 1.0 -> 2.0 pull_requests: +24585 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25916 ___ Python tracker <https://bugs.python.org/i

[issue43140] built-in open() doesn't use locale.getpreferredencoding() as the default encoding

2021-02-05 Thread Cake Xu
Cake Xu added the comment: Thank Eryk for answering my question. So I get it now. I use this in Linux. If my understanding is right, the open() will invoke locale.getpreferredencoding() by setting the do_setlocale=False -- i.e. locale.getpreferredencoding(False) -- to avoid invoking

[issue43140] build-in open() doesn't use whatever locale.getpreferredencoding() returns as default encoding.

2021-02-05 Thread Cake Xu
Change by Cake Xu : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue43140> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue43140] build-in open() doesn't use whatever locale.getpreferredencoding() returns as default encoding.

2021-02-05 Thread Cake Xu
New submission from Cake Xu : In the document about build-in function open() https://docs.python.org/3/library/functions.html#open, it says that "encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is pla

[issue42930] xml.parsers.expat results differ buffer_text and / or buffer_size

2021-01-15 Thread Michael XU
Michael XU added the comment: Thank you so much Walter. I think that might be it - it fixed this particular instance, and it makes sense given what you have said. I'll proceed to close this up but will follow up if I encounter this issue when the data has changed. Thanks

[issue42930] xml.parsers.expat results differ buffer_text and / or buffer_size

2021-01-14 Thread Michael XU
New submission from Michael XU : More details available here: https://stackoverflow.com/questions/65676934/python-xml-parsers-expat-results-differ-based-on-buffer-text-true-or-false-and Raw data to replicate the issue is available upon request. -- components: XML messages: 385086 nosy

[issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes

2021-01-09 Thread Hong Xu
Hong Xu added the comment: Should we update the document at least? The document doesn't mention NotADirectoryError or its super classes at all. -- ___ Python tracker <https://bugs.python.org/is

[issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes

2021-01-09 Thread Hong Xu
Change by Hong Xu : -- title: Inconsistent exceptions thrown by mkdir on different OSes -> Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes ___ Python tracker <https://bugs.python.org/issu

[issue42872] Inconsistent exceptions thrown by mkdir on different OSes

2021-01-09 Thread Hong Xu
Change by Hong Xu : -- title: Inconsistent exception thrown by mkdir on different OSes -> Inconsistent exceptions thrown by mkdir on different OSes ___ Python tracker <https://bugs.python.org/issu

[issue42872] Inconsistent exception thrown by mkdir on different OSes

2021-01-09 Thread Hong Xu
New submission from Hong Xu : Consider the following code: - import pathlib def main(): pathlib.Path('tmp').touch() pathlib.Path('tmp/tmp_sub').mkdir(parents=True) main() Run the code above in an empty dire

[issue39241] Popen of python3.6 hangs on os.read(errpipe_read, 50000)

2020-01-10 Thread Xu
Xu added the comment: Thanks Stinner. Do you have some clues about this issue ? In my case, our test system use Popen to start a few infrastructure processes for tests going. After tests done we will kill all processes and start again for new round. Most of time it works fine. However we

[issue39241] Popen of python3.6 hangs on os.read(errpipe_read, 50000)

2020-01-06 Thread Xu
New submission from Xu : I have a piece code hangs on os.read(errpipe_read, 5) So I compared the python3.6 with python2.7 on _execute_child, I saw: for python2.7 we create the errpipe_read/write with pipe_cloexec() 1213 # For transferring possible exec failure from child to

[issue24935] LDSHARED is not set according when CC is set.

2019-07-25 Thread Hong Xu
Change by Hong Xu : -- pull_requests: +14719 pull_request: https://github.com/python/cpython/pull/14950 ___ Python tracker <https://bugs.python.org/issue24

[issue37659] subprocess.list2cmdline() should not escape wrapping single/double quotes

2019-07-23 Thread James Xu
New submission from James Xu : While working on our project, we have noticed that for `subprocess.Popen(command, ...)`, when `command` is a string that contains escaped double quote, for example, `command = '"path to executable" --flag arg'`, this works fine. However, whe

[issue37572] email lib bug

2019-07-13 Thread famu xu
famu xu added the comment: import smtplib from email.message import EmailMessage from email.utils import formataddr server = smtplib.SMTP('smtp.xxx.com',port=25) server.login('y...@xxx.com', 'password') msg = EmailMessage() #if address username include Chinese or

[issue37572] email lib bug

2019-07-12 Thread famu xu
famu xu added the comment: python 3.7 same -- ___ Python tracker <https://bugs.python.org/issue37572> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37572] email lib bug

2019-07-12 Thread famu xu
New submission from famu xu : file: email\_header_value_parser.py line : encoded_part = part.fold(policy=policy)[:-1] # strip nl modify to: encoded_part = part.fold(policy=policy)[:-2] # strip nl because the nl is "\r\n" -- components: email messages: 347740 nosy: barr

[issue37225] Signatures of Exceptions not documented

2019-06-11 Thread Hong Xu
Hong Xu added the comment: Thanks for your answer, but I believe this is a real document bug. OSError does have its signature documented, but the majority of other exception classes do not do so, neither does BaseException explains a default behavior clearly (see my quote above). As an

[issue37225] Signatures of Exceptions not documented

2019-06-11 Thread Hong Xu
New submission from Hong Xu : The "Builtin Exceptions" page does not document the constructors of the listed exception classes. All it says is > The tuple of arguments given to the exception constructor. Some built-in > exceptions (like OSError) expect a certain number

[issue32382] Python mulitiprocessing.Queue fail to get according to correct sequence

2017-12-20 Thread Weize Xu
New submission from Weize Xu : I try to implement a "producer consumer" like design with mulitiprocessing module in my project, but I found that mulitiprocessing.Queue 's behavior is not as my expected. It seems Queue.get method return the end flag at the end of my queue too ea

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Benda Xu added the comment: Thanks Victor. Python-3.5 has received your patches in time and 3.5.4 builds well with glibc-2.25 and https://wiki.gentoo.org/wiki/Project:Prefix 2. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c8e2396d9cf4fe13057741f5bd1b9989eeeb746

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Changes by Benda Xu : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue31255> ___

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Benda Xu added the comment: > Does it only affect Python 3.4 and 3.5? Both versions are in security > fix-only mode and no longer receive other fixes. Sorry I haven't noticed that there are two new releases this month Python 3.4.7 and 3.5.4. The test build results are: 3.4.7 fail

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Benda Xu added the comment: This is a continuation of http://bugs.python.org/issue29157#msg288291. -- nosy: +Vladimír Čunát, christian.heimes versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue31

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Changes by Benda Xu : -- versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <http://bugs.python.org/issue31255> ___ ___ Python-bugs-list mailin

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Changes by Benda Xu : -- components: +Build ___ Python tracker <http://bugs.python.org/issue31255> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31255] Test getrandom before using it

2017-08-22 Thread Benda Xu
Changes by Benda Xu : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue31255> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue18050] embedded interpreter or virtualenv fails with "ImportError: cannot import name MAXREPEAT"

2013-06-01 Thread H Xu
Changes by H Xu : -- nosy: +xuhdev ___ Python tracker <http://bugs.python.org/issue18050> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue14489] repr() function link on the built-in function documentation is incorrect

2012-07-21 Thread H Xu
H Xu added the comment: I think this has been fixed. Where did you see the incorrect link? -- ___ Python tracker <http://bugs.python.org/issue14489> ___ ___ Pytho

[issue14489] repr() function link on the built-in function documentation is incorrect

2012-04-03 Thread H Xu
New submission from H Xu : The `repr()` built-in function link in this page [ http://docs.python.org/library/functions.html ] should link to the built-in version of `repr()`. It should link to: http://docs.python.org/library/functions.html#repr However, it links to here: http

[issue11106] python 2.6.6 and python 2.7.1 cannot be built successfully because of an segment fault on NetBSD-5.1-sparc

2011-02-03 Thread H Xu
H Xu added the comment: The result of 'make install SHELL="bash -x"' seems nothing different with the "make install". Could there be any other way to debug? -- ___ Python tracker <

[issue11106] python 2.6.6 and python 2.7.1 cannot be built successfully because of an segment fault on NetBSD-5.1-sparc

2011-02-03 Thread H Xu
New submission from H Xu : Build python 2.6.6 and python 2.7.1 on a NetBSD-5.1-sparc machine. 1. Run './configure'; 2. Run 'make'; 3. Run 'make install'. There will be a problem after run 'make install'. The last few lines of error messages are like