[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: Also, I assume this is a problem with all such syntax warnings: you only see this warning/error when the file is originally compiled. Once the .pyc file exists, you'll never see a warning or error. Maybe that's okay, but it means there's a certain class of

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the reviews everyone! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2a4fb01fa1a3 by Berker Peksag in branch '3.5': Issue #25270: Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed https://hg.python.org/cpython/rev/2a4fb01fa1a3 New changeset 8a649009a0e9 by Berker Peksag in

[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-16 Thread R. David Murray
R. David Murray added the comment: If we go that route it doesn't, from a certain point of view, solve the problem for systems that *only* ship python3...but I think we can ignore that issue: IMO it would be fine in that scenario to say that if you want to run the python2 regen scripts you

[issue27806] 2.7 32-bit builds fail on future releases of OS X due to dependency on deleted header file

2016-09-16 Thread sashk
sashk added the comment: Thank you for feedback. Here is second version of the patch. -- Added file: http://bugs.python.org/file44693/issue27806_v2.patch ___ Python tracker

Re: how to automate java application in window using python

2016-09-16 Thread Fabio Zadrozny
Take a look at https://pyautogui.readthedocs.io/en/latest/ On Fri, Sep 16, 2016 at 9:24 AM, meInvent bbird wrote: > you are right, english is not my first language > > i just talk as simple as i can, i do not know previous talking is mean > > > On Friday, September 16,

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-16 Thread Senthil Kumaran
Senthil Kumaran added the comment: Hi Sohaib, I will get the proper fix for this issue. A comment on the patch. Changing the API to `def open(self, fullurl, data=None, ftp_retrieve=False):` just breaks the abstraction of the open method and may not be the way to go for this. Any changes

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: I forgot: this is what Nick's example now looks like: $ ./python -Wall escape_warning.py Traceback (most recent call last): File "escape_warning.py", line 1, in import bad_escape File "/home/eric/local/python/cpython/bad_escape.py", line 1

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Emanuel Barry
Emanuel Barry added the comment: Personally I'd be fine with only one warning, reporting the first invalid escape. Presumably the string would be checked as a whole, or would get an r prefix. Patch seems like a good start; bytes would also need updating in that regard. Don't worry too much

[issue27391] server_hostname should only be required when checking host names

2016-09-16 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

[issue28181] Change URL in antigravity library file

2016-09-16 Thread Christian Heimes
Christian Heimes added the comment: xkcd redirects http to https. It makes sense to fix the module and use https. -- nosy: +christian.heimes stage: -> patch review versions: +Python 3.5, Python 3.6 ___ Python tracker

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is too much magic in ceval_cache.h. Since the patch adds caching only for the LOAD_GLOBAL opcode, it would much clearer if write functions only for the LOAD_GLOBAL opcode, without multilayer macros. What will happen if there more than 255

[issue28181] Change URL in antigravity library file

2016-09-16 Thread Christian Heimes
Christian Heimes added the comment: Thanks for your contribution! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27391] server_hostname should only be required when checking host names

2016-09-16 Thread Jim Fulton
Jim Fulton added the comment: I'm not ignoring anything AFAICT. There are applications where server hostname isn't useful (no virtual hosts, client has server's public key). I'm not positive we're disagreeing, so let me put this another way. 1. If the given SSL context has check_hostname set

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker ___

[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-16 Thread Emanuel Barry
Emanuel Barry added the comment: This is a duplicate of issue27781. -- nosy: +ebarry resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Change sys.getfilesystemencoding() on Windows to UTF-8 ___ Python tracker

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2016-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset a5e8fe666c6b by Berker Peksag in branch '3.5': Issue #25895: Enable WebSocket URL schemes in urllib.parse.urljoin https://hg.python.org/cpython/rev/a5e8fe666c6b New changeset 9bf370a33938 by Berker Peksag in branch '3.6': Issue #25895: Merge from

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Thank you Gergely and Markus! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28158] Implement LOAD_GLOBAL opcode cache

2016-09-16 Thread Antti Haapala
Antti Haapala added the comment: I wouldn't actually consider the builtin lookup speed almost at all, in all non-trivial applications the ratio of builtins to any other names will diminish; and if there is a tight loop, it is possible to always speed it up by `min = min` if you do not need to

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-16 Thread STINNER Victor
STINNER Victor added the comment: Xiang Zhang: "I am still afraid changing it may break knowledge of devs that are already familiar with dict APIs" Come on, the function is only called 4 times in the whole code base, and the function is private. Private means that we are free to break its

[issue28181] Change URL in antigravity library file

2016-09-16 Thread Kaartic Sivaraam
Kaartic Sivaraam added the comment: Don't Mention. It was my long time wish to contribute to open source projects. -- ___ Python tracker ___

[issue28181] Change URL in antigravity library file

2016-09-16 Thread Kaartic Sivaraam
New submission from Kaartic Sivaraam: I use a network that is monitored and filtered by Cyberoam. The use Cyberoam to block some websites, and some content. I came to know of the antigravity easter egg recently. I tried it using 'import antigravity' and it opened the xkcd website as

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-16 Thread Sohaib Ahmad
Sohaib Ahmad added the comment: The attached patch fixes the problem with multiple ftp downloads while keeping the fix for issue1067702 intact. The fix basically uses a new parameter ftp_retrieve to change the behavior of ftpwrapper.retrfile() if it is being called by urlretrieve(). I am not

[issue28181] Change URL in antigravity library file

2016-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b8ac4ee42ad3 by Christian Heimes in branch '3.5': Issue #28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam. https://hg.python.org/cpython/rev/b8ac4ee42ad3 New changeset 0820d023077e by Christian Heimes in branch '3.6': Issue #28181: Get

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
you are right, english is not my first language i just talk as simple as i can, i do not know previous talking is mean On Friday, September 16, 2016 at 6:22:34 PM UTC+8, Christian Gollwitzer wrote: > Am 16.09.16 um 09:01 schrieb Lawrence D’Oliveiro: > > On Friday, September 16, 2016 at 6:55:07

[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-16 Thread STINNER Victor
STINNER Victor added the comment: > This is a duplicate of issue27781. issue27781 is specific to Windows. I'm not sure that it's the base in this issue. So I reopen the issue. @Jan Niklas Hasse: What is your OS? I proposed to add "-X utf8" command line option for UNIX to force utf8

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-16 Thread Xiang Zhang
Xiang Zhang added the comment: Hah, Okay. I'll make the corresponding change then. -- ___ Python tracker ___

[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-16 Thread Jim Fulton
Jim Fulton added the comment: Cool, I will verify soon. -- ___ Python tracker ___ ___ Python-bugs-list

[issue28185] Tabs in C source code

2016-09-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Misleading Indentation in C source code nosy: +serhiy.storchaka ___ Python tracker

[issue28184] Trailing whitespace in C source code

2016-09-16 Thread Francisco Couzo
Changes by Francisco Couzo : Added file: http://bugs.python.org/file44706/trailing_whitespace2.patch ___ Python tracker ___

Re: Where is the documentation for ','?

2016-09-16 Thread Terry Reedy
On 9/16/2016 10:05 PM, Peng Yu wrote: Hi, I'm wondering where is the documentation for ',' as in the following usage. x = 1 y = 2 x, y = y, x I tried help(','). But there are too many ',' in it and I don't see in which section ',' is documented. Could anybody let me know? Thanks. It should

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Let me give complete code for the last idea, also forcing the scaling multiplication to use the correct context: import decimal c = decimal.DefaultContext.copy() c.prec = 25 c.Emax = decimal.MAX_EMAX c.Emin = decimal.MIN_EMIN def erootn(x,

[issue28145] Fix whitespace in C source code

2016-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue15550 and issue8912. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28184] Trailing whitespace in C source code

2016-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Modules/expat/expat.h and Modules/expat/expat_external.h are external files. They should left unchanged. -- nosy: +ned.deily, serhiy.storchaka ___ Python tracker

Re: Where is the documentation for ','?

2016-09-16 Thread eryk sun
On Sat, Sep 17, 2016 at 2:05 AM, Peng Yu wrote: > > I'm wondering where is the documentation for ',' as in the following usage. > > x = 1 > y = 2 > x, y = y, x > > I tried help(','). But there are too many ',' in it and I don't see in > which section ',' is documented. Could

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: > It does use the Decimal pow(), but with an integer exponent, so this specific > use of pow() doesn't invoke the Decimal exp() or ln() either. Decimal pow doesn't special-case integer exponents; the solution will still be based on exp and ln. --

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: > Decimal pow doesn't special-case integer exponents; the solution will still > be based on exp and ln. Ah, sorry; I'm wrong. That was true for the Python version of the decimal module, not for the C implementation. --

Re: How to get the source code of python function being decorated?

2016-09-16 Thread Ned Batchelder
On Friday, September 16, 2016 at 3:20:15 PM UTC-4, Peng Yu wrote: > Hi, See the following example, I am not able to get the source code of > the actual function that does the calculation of partial_ratio. Does > anybody know what is the correct way of getting the source? > > /tmp$ ./main.py >

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Tim Peters
Tim Peters added the comment: Mark, thanks for the counterexample! I think I can fairly accuse you of thinking ;-) I expect the same approach would be zippy for scaling x by 2**e, provided that the scaled value doesn't exceed the dynamic range of the decimal context. Like so: def

[issue28182] Expose OpenSSL verification results in SSLError

2016-09-16 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: This was originally a post at python-ideas. Now I reformat it to be more like a feature request. Currently, Python raises SSLError with reason=CERTIFICATE_VERIFY_FAILED for all kinds of certificate verification failures. This results in difficulties in

[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch that uses pythontest.net. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file44695/issue28151.diff ___ Python tracker

[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-16 Thread R. David Murray
R. David Murray added the comment: I thought we "fixed" this by using surrogate escape when the locale was ASCII? We certainly have discussed changing the default and posix and so far have decided not to (someday that will change...is this someday already?) -- nosy: +r.david.murray

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-16 Thread Sohaib Ahmad
Sohaib Ahmad added the comment: Hi Senthil, Thanks for the review. Now that I look at it, even with a default value, an ftp specific parameter sure does break the open() API abstraction. -- ___ Python tracker

[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-16 Thread INADA Naoki
INADA Naoki added the comment: This is patch for Python 3.5. The patch uses more conservative approach. -- Added file: http://bugs.python.org/file44696/fix-28147-py35.patch ___ Python tracker

[issue1284316] Win32: Security problem with default installation directory

2016-09-16 Thread Steve Dower
Steve Dower added the comment: Changing the default install directory in a maintenance release is not okay. Users who are concerned about security can change the install directory, and bugs that arise as a result will be considered on their own merits. Alternatively, you can obtain Python 2.7

[issue26081] Implement asyncio Future in C to improve performance

2016-09-16 Thread Rémi Cardona
Changes by Rémi Cardona : -- nosy: +RemiCardona ___ Python tracker ___ ___ Python-bugs-list

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Tim Graham
Tim Graham added the comment: Eric, your patch was good enough to allow me to easily identify and fix all the warnings in Django: https://github.com/django/django/pull/7254. Thanks! -- ___ Python tracker

[issue28176] Fix callbacks race in asyncio.SelectorLoop.sock_connect

2016-09-16 Thread STINNER Victor
STINNER Victor added the comment: The timeout of 3 seconds seem to be too short for some buildbots like "AMD64 FreeBSD CURRENT Non-Debug 3.x". http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/295/steps/test/logs/stdio

[issue25283] Make tm_gmtoff and tm_zone available on all platforms

2016-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The problem of computing tm_gmtoff on platforms without it was solved by tzcode some time ago. [1,2] Consider stealing some of their logic. [1]: http://mm.icann.org/pipermail/tz/2014-September/021601.html [2]:

[issue28145] Fix whitespace in C source code

2016-09-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Converting tabs to spaces and deleting trailing whitespace are separate issues and should be discussed and possibly done separately. I think trailing whitespace should be uniformly fixed and prohibited for C files as it seems to be for most other files, for

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Terry Reedy
On 9/16/2016 7:29 AM, Malcolm Greene wrote: Looking for suggestions on how, given a main script, discover all the non-standard library modules imported across all modules, eg. the modules that other modules import, etc. I'm not looking to discover dynamic imports or other edge cases, just the

[issue16902] Add OSS module support for Solaris

2016-09-16 Thread Tim Mooney
Tim Mooney added the comment: Sooo It's been 3 years. Brian's patch has bit-rotted a bit, but it's easy to update for recent Python. What are the hold-ups to getting this applied? -- ___ Python tracker

[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-09-16 Thread STINNER Victor
STINNER Victor added the comment: > is this someday already?) Not yet :-) -- ___ Python tracker ___ ___

[issue1284316] Win32: Security problem with default installation directory

2016-09-16 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The basic concept LGTM. first_invalid_escape_char is redundant, it is just s[first_invalid_escape_idx]. Or maybe better to return a pointer instead of an index. bytes literals need similar solution. -- ___

[issue28128] Improve the warning message for invalid escape sequences

2016-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: Tim: Cool! That's way more useful than I thought it would be. Serhiy: It's a proof of concept. Lots of design remains to be done. I'm not sure we've agreed on the concept yet, so I don't think it's worthwhile designing the API. --

[issue27761] Private _nth_root function loses accuracy

2016-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: I think this whole nth root discussion has become way more complicated than it needs to be, and there's a simple and obvious solution. Two observations: 1. What we actually need is not nth_root(x), but nth_root(x*2**e) for a float x and integer e. That's

[issue28111] geometric_mean can raise OverflowError when checking for inf

2016-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: See msg276732 in issue 27761 for a possible solution. -- ___ Python tracker ___

<    1   2