[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-05-11 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +aeros

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-05-11 Thread Joongi Kim


Joongi Kim  added the comment:

And I suspect that this issue is something simliar to what I did in a recent 
janus PR:
https://github.com/aio-libs/janus/blob/ec8592b91254971473b508313fb91b01623f13d7/janus/__init__.py#L84
to give a chance for specific callbacks to execute via an extra context switch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-05-11 Thread Joongi Kim


Joongi Kim  added the comment:

I just encountered this issue when doing "sys.exit(1)" on a Click-based CLI 
program that internally uses asyncio event loop via wrapped via a context 
manager, on Python 3.8.2.

Using uvloop or adding "time.sleep(0.1)" before "sys.exit(1)" removes the error.

--
nosy: +achimnol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19360
pull_request: https://github.com/python/cpython/pull/20051

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40603] slice not hashable

2020-05-11 Thread Danni


Danni  added the comment:

Would be happy to help with this. Sent a PR soon ;)

--
nosy: +isdanni

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-05-11 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I was able to simplify the script a lot more and continue to reproduce the 
hang. It's attached as test-kill3.py (80 lines). It doesn't use 
subprocess_exec() or a watcher anymore -- just subprocess.Popen() followed by 
popen.kill(), and then awaiting on a future.

The right amount of time has to elapse between the popen.kill() and the await, 
so I introduced a random bit of variability in between. The right range / 
amount of time to put in between probably depends on the machine. (What you 
want is a narrow range right on the borderline, where sometimes the signal 
fires right before the await, and sometimes right after.) I also added a 
printf() statement at the beginning of signalmodule.c's trip_signal(), so I can 
see in the console whether the signal is firing before or after the await. In 
the timeout / hang case, the signal will be firing after. The hang is very 
infrequent with the script, though (less frequent than the original unittest). 
It can take multiple 1-minute runs.

It seems similar issues have happened a number of times in the past around the 
signal-handling code. See e.g. https://bugs.python.org/issue30038 and changes 
to the neighboring code since then.

--
Added file: https://bugs.python.org/file49150/test-kill3.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

By 'preview', I meant the listing of existing file in the directory, such as 
Documents.  IDLE displays this but, as I inferred and you and Bev confirmed, 
this is not standard on macOS, as there is a button (which I did not noticed 
before) to show or hide the file list and other stuff. (There is no such button 
on Windows.) So *if* it is the problem culprit for some people, we could, I 
presume, leave the pane initially hidden.

Is the filelist pane a 'sheet'?  Could the recent 'sheets' fix (Christian's 
comment) for these dialogs on Catalina be involved?  What is your latest take 
on 8.6.10 for OSX?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset f3a5b7ada0c951f317dbd307de4b410e58d3e1b3 by Batuhan Taskaya in 
branch 'master':
bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)
https://github.com/python/cpython/commit/f3a5b7ada0c951f317dbd307de4b410e58d3e1b3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40603] slice not hashable

2020-05-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This is a reasonable use case.

+1 for making slice() hashable.

Will, you're welcome to submit a PR.  If not, I'm sure someone else would be 
happy to scoop this up :-)

--
keywords: +easy (C)
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Tim Peters


Tim Peters  added the comment:


New changeset b1b4c790e7d3b5f4244450aefe3d8f01710c13f7 by Tim Peters in branch 
'master':
bpo-40480: restore ability to join fnmatch.translate() results (GH-20049)
https://github.com/python/cpython/commit/b1b4c790e7d3b5f4244450aefe3d8f01710c13f7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40603] slice not hashable

2020-05-11 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
components: +Interpreter Core -ctypes
type: behavior -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40603] slice not hashable

2020-05-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Please re-upload the patch file as an uncompressed text file, as it is quite 
difficult for many people to view zip files in their browser.

--
nosy: +steven.daprano
title: slice does not slice -> slice not hashable

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40334] PEP 617: new PEG-based parser

2020-05-11 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19359
pull_request: https://github.com/python/cpython/pull/20050

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40603] slice does not slice

2020-05-11 Thread Will Bradshaw


New submission from Will Bradshaw :

slice cannot be hashed which make some operations significantly more annoying. 
see https://groups.google.com/forum/#!topic/comp.lang.python/SvhkWwSDeIw

--
components: ctypes
files: patches.zip
messages: 368693
nosy: Will Bradshaw
priority: normal
severity: normal
status: open
title: slice does not slice
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49149/patches.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-05-11 Thread Chris Meyer


Chris Meyer  added the comment:

Here is another way to reproduce this (or an extremely similar) error without a 
loop. Since may be a race condition, I'm not sure this works 100% of the time 
on all machines - but it did on several machines I tried.

```
import asyncio

loop = asyncio.get_event_loop()

def func():
pass

f = loop.run_in_executor(None, func)
loop.stop()
loop.run_forever()
loop.stop()
loop.run_forever()
loop.stop()
loop.run_forever()
```

```
Error on reading from the event loop self pipe
loop: 
Traceback (most recent call last):
  File "C:\Miniconda3\envs\py38\lib\asyncio\windows_events.py", line 453, in 
finish_recv
return ov.getresult()
OSError: [WinError 995] The I/O operation has been aborted because of either a 
thread exit or an application request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Miniconda3\envs\py38\lib\asyncio\proactor_events.py", line 768, in 
_loop_self_reading
f.result()  # may raise
  File "C:\Miniconda3\envs\py38\lib\asyncio\windows_events.py", line 808, in 
_poll
value = callback(transferred, key, ov)
  File "C:\Miniconda3\envs\py38\lib\asyncio\windows_events.py", line 457, in 
finish_recv
raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 995] The I/O operation has been aborted because 
of either a thread exit or an application request
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Tim Peters


Change by Tim Peters :


--
pull_requests: +19358
pull_request: https://github.com/python/cpython/pull/20049

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

Attached bench.py: Micro-benchmark on _PyUnicode_FromId(). It requires attached 
bench.patch being applied.

--
Added file: https://bugs.python.org/file49148/bench.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49147/bench.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d0919f0d6bb757b6bcfd7b2e15656d318c9d5cd9 by Victor Stinner in 
branch 'master':
bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() (GH-20046)
https://github.com/python/cpython/commit/d0919f0d6bb757b6bcfd7b2e15656d318c9d5cd9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19357
pull_request: https://github.com/python/cpython/pull/20048

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38872] Document exec symbol for codeop.compile_command

2020-05-11 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
nosy: +nanjekyejoannah
nosy_count: 4.0 -> 5.0
pull_requests: +19356
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20047

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19355
pull_request: https://github.com/python/cpython/pull/20046

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b617993b7c0b0f6f679ef7003a62d0318b6d6af9 by Victor Stinner in 
branch 'master':
bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)
https://github.com/python/cpython/commit/b617993b7c0b0f6f679ef7003a62d0318b6d6af9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-05-11 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19354
pull_request: https://github.com/python/cpython/pull/20045

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-40602: "Move Modules/hashtable.h to 
Include/internal/pycore_hashtable.h".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

The stable ABI should not change between Python 3.8 and 3.9.

In practice, it seems like something changed. But without any gdb traceback, I 
cannot tell what.

I suggest to try again when beta1 will be released. The ABI should be way more 
stable after beta1.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +19353
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20044

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Tim Peters


Tim Peters  added the comment:

I don't want something probabilistic.  Fix it or don't ;-)

One thing that would work, but at the cost of non-determinism:  do the same as 
now, but obtain the number part of the group name by applying next() to a 
module-global private instance of itertools.count().  That will keep the 
numbers increasing "forever", and across calls.  The point to using .count() is 
that it's atomic (i.e., won't repeat a number if multiple threads happen to be 
constructing regexps simultaneously).

It's a darned silly amount of effort, though ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40602] Move Modules/hashtable.h to Include/internal/pycore_hashtable.h

2020-05-11 Thread STINNER Victor


New submission from STINNER Victor :

Python/mashal.c uses Modules/hashtable.h.

Python/mashal.c indirectly gets Modules/hashtable.c implementation via 
Modules/_tracemalloc.c which is built as a builtin module.

I propose to make the "hashtable" more standard:

* Move Modules/hashtable.h to Include/internal/pycore_hashtable.h
* Move Modules/hashtable.c to Python/hashtable.c

Attached PR implements this change but also changes the default memory 
allocator to PyMem_Malloc/PyMem_Free which is faster than 
PyMem_RawMalloc/PyMem_RawFree (current default) for memory blocks <= 512 bytes.

It remains an internal C API which cannot be used outside CPython.

--
components: C API
messages: 368685
nosy: vstinner
priority: normal
severity: normal
status: open
title: Move Modules/hashtable.h to Include/internal/pycore_hashtable.h
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40571] Make lru_cache(maxsize=None) more discoverable

2020-05-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 21cdb711e3b1975398c54141e519ead02670610e by Raymond Hettinger in 
branch 'master':
bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)
https://github.com/python/cpython/commit/21cdb711e3b1975398c54141e519ead02670610e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40571] Make lru_cache(maxsize=None) more discoverable

2020-05-11 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Anthony Sottile


Anthony Sottile  added the comment:

one way might be to give the groups "unique" names (perhaps hashing the input 
string?)  ((this is what I attempted to do in a little bit of code which tried 
to "backport" (group)*+ and (group)++))

--
nosy: +Anthony Sottile

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4804b5b3df82e7892ca0550b02f902bcfc16bb48 by Victor Stinner in 
branch 'master':
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
https://github.com/python/cpython/commit/4804b5b3df82e7892ca0550b02f902bcfc16bb48


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

In response to my PEG blogs last year someone showed me an entirely different 
algorithm, based on first looking for matching parentheses (and other matching 
things), then for operators by priority, and so on. The approach was designed 
with C in mind but looked like it would fit reasonably well with Python, once 
you view e.g. ':' as an operator of a certain priority, and figure out what to 
do with indentation.

This would actually be closer to the old approach, accepting "a+1 = b" 
initially as an assignment and then rejecting "a+1" as a target.

I wonder if we could (eventually) use this approach as a fallback when a syntax 
error is found. But it is an entirely different theoretical framework, so we 
should probably not hurry with this.

IOW I'm okay with closing this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +19352
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20043

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I also concur with Guido here. I have played around with other languages and I 
dislike getting a long list of expected tokens, that are not helpful, if not 
actually confusing sometimes.

I think that the current generic SyntaxError description together with the 
error caret actually does a good job of directing someone to close where the 
error is, without providing too much information that might be misleading.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> (Huh, where did it get __new_parser__?)

>From here:

https://github.com/python/cpython/blob/master/Parser/pegen/parse.c#L67

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

I had hoped that error labels would get us closer to error recovery, but it 
appears that is still quite elusive. :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36702] test_dtrace failed

2020-05-11 Thread Thomas Chan


Change by Thomas Chan :


--
nosy: +tchan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31436] test_socket.SendfileUsingSendfileTest.testWithTimeoutTriggeredSend fails due to sendfile completing before timeout

2020-05-11 Thread Thomas Chan


Change by Thomas Chan :


--
nosy: +tchan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> SyntaxError: Invalid syntax. Expected one of: for, pass, lambda, False, 
> global, True, __new_parser__, if, raise, continue, not, break, while, None, 
> del, nonlocal, import, assert, return, class, with, def, try, from, yield

Haha, that is a good point. It also reveals the easter egg :)

> The beauty of Python's detail-free syntax error is that it doesn't tell you 
> what it expects -- because parsers are dumb, what the parser expected is 
> rarely what's wrong with your code -- and it requires the user to understand 
> how the parser works to interpret the error message.

Right, I think will be very difficult to actually give you something very close 
to what the actual problem is.

I started this draft based on some similar errors that I have seen in other 
parsers but is true that with the exception of rust, all other grammars I 
explored and played with were mucn simpler, so the errors were not super 
verbose.

I think i will close the issue and the PR unless you think there is something 
worth exploring/discussing left, as it does not look that we can get something 
less verbose in an easy way.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40601] [C API] Hide static types from the limited C API

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

> I propose to break the limited C API backward compatibility on purpose by 
> removing these type definitions form the limited C API.

Hum. How would a C extension subclass the Python int type (PyLong_Type) if it's 
no longer exposed? One option is to add one function per type, like:

PyObject* Py_GetLongType(void);

It would return a *strong reference* to the type (PyLong_Type).

Another option is to get the type from builtins module or builtins dictionary 
(PyInterpreterState.builtins). But there is no simple C function to get a 
builtin object. It requires many calls, handle errors, etc. Maybe a generic 
helper like the following function would help:

PyObject *Py_GetBuiltin(const char *name);

Note: PyEval_GetBuiltins() exposes the builtins of the *current frame* which 
maybe not be what you may expect.

Currently, Py_GetBuiltin(name) is not needed since basically *all* Python 
builtins are *directly* exposed in the C API...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-11 Thread Thomas Caswell


Thomas Caswell  added the comment:

The path is

 - on a commit prior to e1becf46b4e3ba6d7d32ebf4bbd3e0804766a423 install 
pyqt-sip.  pip will build a wheel for you called 
PyQt5_sip-12.7.2-cp39-cp39-linux_x86_64.whl
 - on a commit after e1becf46b4e3ba6d7d32ebf4bbd3e0804766a423 if you do `pip 
install pyqt-sip` pip will discover the wheel from the previous install in it's 
cache and use it, but the ABI has changed (?) which leads to a segfault.  If 
you do `pip install pyqt5-sip --no-binary pyqt5-sip` or clear the cache then 
things work correctly

I suspect that this also means that wheels made with the early alphas will not 
work future 3.9 (pre-)releases, however I am not sure if that is a problem or 
not (given that it is all pre-releases).

I am going to close this as I think if there is a bug, it would be better 
addressed in the packaging space.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hmm... The errors get long, and by focusing only on keywords they can be 
misleading. E.g.

>>> from x import a b c
  File "", line 1
from x import a b c
^
SyntaxError: Invalid syntax. Expected one of: as
>>> 

But the most likely error is omission of a comma.

>>> if x y: pass
  File "", line 1
if x y: pass
 ^
SyntaxError: Invalid syntax. Expected one of: not, is, or, in, and, if
>>> 

But the most likely error is probably a comparison operator.

And so on. Here's a nice one:

>>> /
  File "", line 1
/
^
SyntaxError: Invalid syntax. Expected one of: for, pass, lambda, False, global, 
True, __new_parser__, if, raise, continue, not, break, while, None, del, 
nonlocal, import, assert, return, class, with, def, try, from, yield
>>> 

(Huh, where did it get __new_parser__?)

The beauty of Python's detail-free syntax error is that it doesn't tell you 
what it expects -- because parsers are dumb, what the parser expected is rarely 
what's wrong with your code -- and it requires the user to understand how the 
parser works to interpret the error message.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38078] IDLE: Don't run internal code in user namespace.

2020-05-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 1.0 -> 2.0
pull_requests: +19351
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20040

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40257] Improve the use of __doc__ in pydoc

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm making this a release blocker -- please everybody come to an agreement or 
ask on python-dev.

--
priority: normal -> release blocker
resolution: fixed -> remind

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40598] round() does not return an integer when given a numpy float64

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

> The round() helptext states "The return value is an integer if ndigits is 
> omitted or None.  Otherwise the return value has the same type as the number."

round(number) is documented to call number.__round__:

https://docs.python.org/dev/library/functions.html#round
For a general Python object number, round delegates to number.__round__.

It's not a bug, Python works as expected.

It's better to refer to the main documentation. Docstrings are short and 
incomplete on purpose. I close the issue.

--
nosy: +vstinner
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40598] round() does not return an integer when given a numpy float64

2020-05-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Wouldn't float64's __round__ method be in complete control of this? For 
python's float:

>>> x = 3.4
>>> type(x.__round__(1))

>>> type(x.__round__())


And Decimal:

>>> from decimal import Decimal
>>> x = Decimal('3.4')
>>> type(x.__round__(1))

>>> type(x.__round__())



Of course, numpy may have good reasons for what they're doing.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40512] Meta issue: per-interpreter GIL

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

"Static" types are shared by all interpreters. We should convert them to heap 
allocated types using PyType_FromSpec(), see:

* bpo-40077: Convert static types to PyType_FromSpec()
* bpo-40601: [C API] Hide static types from the limited C API

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40601] [C API] Hide static types from the limited C API

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40077: "Convert static types to PyType_FromSpec()".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40601] [C API] Hide static types from the limited C API

2020-05-11 Thread STINNER Victor


New submission from STINNER Victor :

"Statically allocated types" prevents to get per-interpreter GIL: bpo-40512. 
These types are currently shared by all interpreters.

Eric Snow proposed the idea of creating a heap allocated type in 
subintepreters. But we should take care of direct usage of the statically 
allocated type.

For example, Objects/longobject.c defines "PyTypeObject PyLong_Type = {...};". 
This type is exposed in the limited C API (!) in Include/longobject.c:

PyAPI_DATA(PyTypeObject) PyLong_Type;

It's used but such macro:

#define PyLong_CheckExact(op) Py_IS_TYPE(op, _Type)

I don't think that these types are directly accessed in C extensions built with 
the limited C API. My expectation is that the type is only exposed for 
"CheckExact" macros.

Currently, 100 statically allocated types are declared in Python header files:

$ grep -F '(PyTypeObject)' Include/ -R
Include/cpython/fileobject.h:PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
(...)
Include/object.h:PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */
Include/methodobject.h:PyAPI_DATA(PyTypeObject) PyCFunction_Type;

Most of them seem to be exposed in the limited C API.

I propose to break the limited C API backward compatibility on purpose by 
removing these type definitions form the limited C API.

For "CheckExact" macros, we can continue to provide them in the limited C API 
but as function calls. So a built C extension would no longer access directly 
the type, but only do function calls.

--
components: C API
messages: 368667
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Hide static types from the limited C API
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40077] Convert static types to PyType_FromSpec()

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40601: [C API] Hide static types from the limited C API.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40600] Add an option to disallow creating more than one instance of a module

2020-05-11 Thread STINNER Victor


New submission from STINNER Victor :

When a C extension module is created with PyModuleDef_Init(), it becomes 
possible to create more than one instance of the module.

It would take significant effort to modify some extensions to make their code 
fully ready to have two isolated module.

For example, the atexit module calls _Py_PyAtExit() to register itself into the 
PyInterpreterState. If the module is created more than once, the most recently 
created module wins, and calls registered on other atexit instances are ignore: 
see bpo-40288.

One simple option would be to simply disallow loading the module more than once 
per interpreter.

Also, some extensions are not fully compatible with subinterpreters. It may be 
interesting to allow to load them in a subinterpreter if it's not already 
loaded in another interpreter, like another subinterpreter or the main 
interpreter. It would be only load it once per Python *process*. For example, 
numpy would be a good candidate for such option.

I'm not sure fow a module should announced in its definition that it should not 
be loaded more than once.

--
components: Extension Modules
messages: 368665
nosy: corona10, eric.snow, vstinner
priority: normal
severity: normal
status: open
title: Add an option to disallow creating more than one instance of a module
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40334] PEP 617: new PEG-based parser

2020-05-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -19349

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40288] atexit module should not be loaded more than once per interpreter

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-40600: "Add an option to disallow creating more than one instance 
of a module".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +19350
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20039

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40599] Improve error messages with expected keywords

2020-05-11 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Using the new parser, we could improve the plain "syntax error" messages with 
the tokens/keywords that would have made the parser advance. There is a proof 
of concept in https://github.com/python/cpython/pull/20039 you can play with.

I would like to get some initial opinions on the idea before going deeper in 
the issue :)

--
components: Interpreter Core
messages: 368664
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Improve error messages with expected keywords
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40334] PEP 617: new PEG-based parser

2020-05-11 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 27c0d9b54abaa4112d5a317b8aa78b39ad60a808 by Shantanu in branch 
'master':
bpo-40334: produce specialized errors for invalid del targets (GH-19911)
https://github.com/python/cpython/commit/27c0d9b54abaa4112d5a317b8aa78b39ad60a808


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs

2020-05-11 Thread Ned Deily


Ned Deily  added the comment:

>To debug, and test Raymond's hypothesis, someone please try this minimal 
>(IDLE-free) code to show the dialog and print the return.  
>This does not display a preview, even after selecting a location, such as 
>Documents, on the 3rd line.

Terry, I'm not sure I know what you mean here by preview. Do you mean the 
Column view of the Save sheet?  As "Bev in TX" explained in the quote you 
supplied earlier, the standard macOS Save or Save As save sheet which nearly 
all macOS apps use including Tk in IDLE has several settings, settings that are 
usually remembered across application invocations. By default initially, a 
compact display is given with boxes for Save As, Tags, and a pull-down Where 
list of folders.  To its right, there should be an button with a "V" icon.  
When pressed, the "V" changes to a "^" and the Save sheet expands to show more 
stuff.  What stuff it shows depends on the setting of the view options which 
can be accessed by clicking on the button with an array of six little squares 
on it, usually towards the upper left side of the Save sheet.  In it are the 
three main Show Items as options: "Icons", "List", "Columns". There are other 
options in there, too. So when discussing the appearance of macOS Open or Sa
 ve dialog sheets, one has to be really precise about what options are in 
effect for that particular Save. Those are under the control of the user and, 
again, are remembered by the operating system. Note also that for Save using he 
column view, the system does not show previews of existing files; it does for 
Open files, which you should be able to see if you substitute tk_getOpenFile in 
your test code.

In any case, I ran your test on both 10.15 and 10.14 and so far have still seen 
no problems, no hanging. I don't doubt these reports that people are seeing 
hangs but we still need to be able to reproduce them.  

FWIW, for every macOS Python installer before it is permitted to be released, I 
run a smoke test that, among other things, does essentially does what is 
reported here: launch IDLE.app, open a new file window, add a few lines 
including a print function, preess F5 to Run bringing up the Save dialog, Save 
the file, and verify that the expected output shows up in the IDLE shell 
window. Each installer is tested on at least one macOS system level, always the 
latest release and usually at least one older release. In years of doing this, 
I've never seen a hang like those being reported. So that's why I'm 
particularly curious about this because there is a lot of baseline experience 
over many releases of macOS, Python, and Tk for that matter. We'll keep 
searching.  But it would still be *really* helpful if, as I requested before, 
someone who does see these hangs and can reliably reproduce them, documents 
*exactly* all the steps to do so, from exactly how IDLE is launches to exactly 
how the Sav
 e dialog is invoked (by menu bar or keyboard shortcut or ...) and what options 
of the Save dialog are in effect.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40500] test_multiprocessing_fork leaks processes on PPC64LE RHEL8 LTO + PGO 3.x

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

PPC64LE RHEL8 LTO + PGO 3.x:
https://buildbot.python.org/all/#/builders/450/builds/361

0:02:28 load avg: 6.47 [398/423/1] test_multiprocessing_spawn failed (env 
changed) (2 min 3 sec) -- running: test_asyncio (51.1 sec), test_peg_generator 
(47.7 sec), test_concurrent_futures (53.3 sec)
Warning -- multiprocessing.Manager still has [, ] active children 
after 5.115746586991008 seconds
Warning -- multiprocessing.Manager still has [, ] active children 
after 5.11747344958 seconds
Warning -- multiprocessing.Manager still has [, ] active children 
after 5.116073776007397 seconds

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-11 Thread STINNER Victor


Change by STINNER Victor :


--
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Hai Shi!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 86d69444e7cfe758212956df0be0ec7b8a4251a6 by Hai Shi in branch 
'master':
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset 
(GH-20026)
https://github.com/python/cpython/commit/86d69444e7cfe758212956df0be0ec7b8a4251a6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle

Paul Ganssle  added the comment:

Here are some benchmarks run using the latest implementation. The pure Python 
code is pretty optimized, but the C code is still ~4-5x faster.

Running from_utc in zone Europe/Paris
c_zoneinfo: mean: 494.82 ns ± 3.80 ns; min: 489.23 ns (k=5, N=50)
py_zoneinfo: mean: 2.48 µs ± 79.17 ns; min: 2.42 µs (k=5, N=10)
dateutil: mean: 10.41 µs ± 209.97 ns; min: 10.17 µs (k=5, N=5)
pytz: mean: 4.69 µs ± 252.70 ns; min: 4.39 µs (k=5, N=5)

Running to_utc in zone Europe/Paris
c_zoneinfo: mean: 539.61 ns ± 25.68 ns; min: 514.39 ns (k=5, N=50)
py_zoneinfo: mean: 2.01 µs ± 61.69 ns; min: 1.94 µs (k=5, N=10)
dateutil: mean: 7.88 µs ± 506.89 ns; min: 7.25 µs (k=5, N=5)
pytz: mean: 773.02 ns ± 14.11 ns; min: 759.56 ns (k=5, N=50)

Running utcoffset in zone Europe/Paris
c_zoneinfo: mean: 329.34 ns ± 36.31 ns; min: 302.88 ns (k=5, N=100)
py_zoneinfo: mean: 1.57 µs ± 9.58 ns; min: 1.55 µs (k=5, N=20)
dateutil: mean: 6.28 µs ± 86.61 ns; min: 6.16 µs (k=5, N=5)
pytz: mean: 461.47 ns ± 2.07 ns; min: 458.91 ns (k=5, N=50)


`utcoffset()` is very likely to be called possibly many times in certain hot 
loops (including implicitly as it's part of hash and equality checks).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

> I think I have figured out the problem.  I had a locally built and cached 
> wheel of PyQt5-sip from before PEP573 went in.  If that wheel is used for 
> later commits I get the segfault, if I rebuilt the wheel from source it works.

Hum, I'm not sure that I understand well. Is there a bug in Python or not?

It seems when in my tests, pip of Python 3.9 installed wheel package marked as 
"python38". I understand that the ABI didn't change and we are all good.

I suggest to close the issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle


Paul Ganssle  added the comment:

I mean, theoretically we don't "need" it, but it's much, much faster, and 
without it nearly every operation that needs time zone offsets will be slower 
than pytz (which has a mechanism for caching).

Also, I've already written it, so I see no reason why not use it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Tim Peters


Tim Peters  added the comment:

Ned, would it be possible to rewrite code of the form:

if giant pasted regexp matches:

to:

if any(p matches for p in patterns):

That should work under any version of Python.

There's no guarantee that regexps _can_ be pasted together and still work, so I 
can't call this change "a bug".  That pasting regexps together "worked" before 
was an implementation accident.

I'd be happy to change it anyway, except I know of no way to use Python's re 
engine without backreferences that can avoid exponential-time behavior in some 
cases.  In some other regexp engines, yes (e.g., as the code comments note, in 
those that support "atomic grouping"), but not in Python's.  Nor does Python's 
re engine support reusing backreference names or numbers.

So I know of no way to restore the ability to paste regexps together that 
wouldn't reintroduce the possiblity of exponential time failure :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40598] round() does not return an integer when given a numpy float64

2020-05-11 Thread Michael Garbutt


New submission from Michael Garbutt :

The round() helptext states "The return value is an integer if ndigits is 
omitted or None.  Otherwise the return value has the same type as the number."

When given a numpy float64, the return type is also float64, rather than the 
expected int.

>>> import numpy as np
>>> value = np.float64(2.1)
>>> round(value)
2.0
>>> type(round(value))


Observed in Python 3.8.2, output of pip freeze:
certifi==2020.4.5.1
mkl-fft==1.0.15
mkl-random==1.1.0
mkl-service==2.3.0
numpy==1.18.1
six==1.14.0

Also in Python 3.7.2, output of pip freeze:

--
components: Library (Lib)
messages: 368654
nosy: MichaelCG8
priority: normal
severity: normal
status: open
title: round() does not return an integer when given a numpy float64
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36346] Prepare for removing the legacy Unicode C API

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-36346: array: Don't use deprecated APIs (GH-19653)

Thanks INADA-san! Another nail into Py_UNICODE coffin!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40596] str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

My previous change on this function:

commit f3e7ea5b8c220cd63101e419d529c8563f9c6115
Author: Victor Stinner 
Date:   Tue Feb 11 14:29:33 2020 +0100

bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)

PyUnicode_IsIdentifier() does not call Py_FatalError() anymore if the
string is not ready.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40596] str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows

2020-05-11 Thread STINNER Victor


STINNER Victor  added the comment:

It's maybe time to speed up the deprecation of the legacy C API using 
Py_UNICODE...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Raymond, can you run the tests I suggested above?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do we need the C implementation if there is the Python implementation?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Mat Wichmann responded
"we had three of these in the last few weeks sent to
webmas...@python.org.  I just went back and pinged those folks with a
request to look in on the issue, and contribute to it if they had
anything new/useful to add."

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am working on an explanation of why I paused the PR.

--
versions: +Python 3.9 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread R. David Murray


R. David Murray  added the comment:

The PR looks good to me, but I describe the change differently.  I'm not sure 
how I missed this in the original implementation, since I obviously checked it 
for the 8bit case.  Too long ago to remember :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40480] "fnmatch" exponential execution time

2020-05-11 Thread Ned Batchelder


Ned Batchelder  added the comment:

This change has caused a problem for coverage.py.  The full details are here: 
https://github.com/nedbat/coveragepy/issues/988#issuecomment-626926513

Coverage.py combines fnmatch-produced regexes by joining them with pipes into 
one larger regex.  The \ group in the regexes now makes that larger regex 
invalid.

--
nosy: +nedbat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40334] PEP 617: new PEG-based parser

2020-05-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19349
pull_request: https://github.com/python/cpython/pull/20039

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40595] AttributeError from type annotation

2020-05-11 Thread Taylor Robie


Taylor Robie  added the comment:

Ah, I see. If this is intended behavior (which is sounds like it is?) feel free 
to close. Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread Arkadiusz Hiler


Change by Arkadiusz Hiler :


--
keywords: +patch
pull_requests: +19348
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20038

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread miss-islington


miss-islington  added the comment:


New changeset a63c61168588937c482435d0432c753de4844c46 by Miss Islington (bot) 
in branch '3.8':
bpo-40561: Add docstrings for webbrowser open functions (GH-1)
https://github.com/python/cpython/commit/a63c61168588937c482435d0432c753de4844c46


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread miss-islington


miss-islington  added the comment:


New changeset 61b49a00e755136586e991c971c47f38bb5e4d23 by Miss Islington (bot) 
in branch '3.7':
bpo-40561: Add docstrings for webbrowser open functions (GH-1)
https://github.com/python/cpython/commit/61b49a00e755136586e991c971c47f38bb5e4d23


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread Arkadiusz Hiler


New submission from Arkadiusz Hiler :

RFC5322[0] in section 2.1.1 mandates that the line cannot be longer than 998 
characters and should not be longer than 78 characters (excluding CRLF). When 
we use raw_data_manager (default for EmailPolicy, EmailMessage) it does the 
correct thing as long as the message contains characters outside of 7bit 
US-ASCII set - base64 or qp Content-Transfer-Encoding which respects the line 
wrapping at 78 characters.

However if our message is limited the characters from the 7bit US-ASCII set no 
transfer encoding is applied, and such messages can easily go beyond 78 or even 
998 characters.


[0]: https://tools.ietf.org/html/rfc5322.html#section-2.1.1

--
components: email
messages: 368641
nosy: barry, ivyl, r.david.murray
priority: normal
severity: normal
status: open
title: generated email message exceeds RFC-mandated limit of 998 characters
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40595] AttributeError from type annotation

2020-05-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is not an annotations-only issue. This is no different from:


import re

class MyClass(object):
def re(self):
pass

m = re.Match

Which gives the same error. It's being evaluated at class scope.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19347
pull_request: https://github.com/python/cpython/pull/20037

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset ef7973a981ff8f4687ef3fdb85a69fa15aa11fe5 by Brad Solomon in 
branch 'master':
bpo-40561: Add docstrings for webbrowser open functions (GH-1)
https://github.com/python/cpython/commit/ef7973a981ff8f4687ef3fdb85a69fa15aa11fe5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40561] Add docstrings for webbrowser open functions

2020-05-11 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +19346
pull_request: https://github.com/python/cpython/pull/20036

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-05-11 Thread Pete Wicken


Pete Wicken  added the comment:

The patch for this has been merged - I guess this can be closed now?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40596] str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows

2020-05-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +19345
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20035

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40596] str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows

2020-05-11 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

>>> import _testcapi
>>> u = '\U0001d580\U0001d593\U0001d58e\U0001d588\U0001d594\U0001d589\U0001d58a'
>>> u.isidentifier()
True
>>> _testcapi.unicode_legacy_string(u).isidentifier()
False

--
components: Interpreter Core
messages: 368637
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: str.isidentifier() does not work with non-BMP non-canonicalized strings 
on Windows
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40591] \r broken in IDLE

2020-05-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This is known, has been discussed on previous issues (can't find numbers now), 
and is not a bug. Your code outputs a stream of 21 characters to 'file' 
sys.stdout, which for code executed by IDLE is, by default, directed to Shell. 
The effect of outputting Ascii control characters to a display device depends 
on the device.  On a hard-copy printing terminal, the source from which \r in 
particular was taken, the effect of your code would be the 10 digits printed on 
top of each other.  In an edit box on a screen, such as this Comment box on 
Firefox, characters are normally just inserted as received.  If I type 0, Left, 
1, Left, , 9, the result is '9876543210'.

The current intended Shell behavior is what you see -- display (or not)  chars 
as received.  Changes have been rejected in the past but I am considering 
adding a 'terminal' mode.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40595] AttributeError from type annotation

2020-05-11 Thread Taylor Robie


New submission from Taylor Robie :

Consider the following:
```
import re

class MyClass(object):
def re(self):
pass

def foo(self, m: re.Match):
pass
```

Even though `re` and `MyClass.re` are distinct namespaces, the type annotation 
misses that fact (presumably there is an issue with how it is parsing the AST) 
and attempts to access MyClass.re.Match, resulting in:

`AttributeError: 'function' object has no attribute 'Match'`

Commenting out the definition of `MyClass.re` or reversing the definition order 
resolves the issue.

--
components: Interpreter Core
messages: 368635
nosy: robieta
priority: normal
severity: normal
status: open
title: AttributeError from type annotation
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-11 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests:  -19344

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-11 Thread Paul Ganssle


Change by Paul Ganssle :


--
keywords: +patch
pull_requests: +19344
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19909

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle


Paul Ganssle  added the comment:

Thanks Thomas, that was super helpful. I've created GH-20034 to add in the 
compile-time arguments on POSIX systems at least, do you mind having a look?

For the moment I have made it non-configurable on Windows, but I think the 
right thing to do is to add an argument to PCbuild\build.bat. Hopefully Steve 
can point me in the right direction for mapping that argument (or something 
else) to a new config variable in sysconfig.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +19343
pull_request: https://github.com/python/cpython/pull/20034

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-11 Thread hai shi


hai shi  added the comment:

> Note that __dictoffset__ and __weaklistoffset__ are also exposed as members 
> (in PyMemberDef type_members) and documented (Doc/c-api/structures.rst). A 
> new __vectorcalloffset__ should have that as well.

Thanks for your comment, petr. And I updated the doc in PR20026.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40257] Improve the use of __doc__ in pydoc

2020-05-11 Thread Matthias Bussonnier

Matthias Bussonnier  added the comment:

> Can you all please decide which issue to use?

We can stay here, I opened the other issue before figuring out this was the 
cause.

> If IPython wants to output the help on the instance, it should change the 
> implementation of `?` and `??`. It would be better if it correctly attribute 
> the source of the docstring: the object itself, its class or its superclass. 
> It was difficult to distinguish these cases before, now it is easier.

Sure I can do that, but this issue feel like a important semantic change of 
`inspect.getdoc()`, it may be documented but there is no warning or deprecation 
of behavior. It is also likely to affect untested code (documentation 
generation).

If you decide that this change of behavior is the one you want I'll be happy to 
support you – I just want to make sure the impact on the rest of the ecosystem. 
IPython/Jupyter is likely not the only one to rely on inspect.getdoc behavior, 
I'm thinking pycharm, spyder, sphinx will likely be impacted. I can see 
`inspect.getdoc()` in the source of even scipy/numpy and rarely in tests.


I would prefer new functions with clearer behavior and for example returning a 
sequence of tuple (docs, where it comes from) potentially deprecating 
inspect.getdocs() than a change of behavior that remove data where their used 
to be some


>  I just tried IPython 5.5.0

(You may want to update to 5.10, and do you have reason to still be on 5 and 
not 7 ?)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >