[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

OK, verified issue with installed 3.9.0a5, which must have different warning 
settings.

>From a file, 1 warning.
:1: DeprecationWarning: invalid escape sequence \d

Interactively, no warning.

>>> compile("'\d'", "", "eval")
 at 0x0263842DFC90, file "", line 1>
>>>

--

___
Python tracker 

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



[issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-04-10 Thread Vedran Čačić

Vedran Čačić  added the comment:

> _in some cases when enum instances are exposed as module globals_

Yes. And repr should be inverse of eval, but it's probably too late for that. 
:-/

--
nosy: +veky

___
Python tracker 

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



[issue40235] confusing documentation for IOBase.__exit__

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Please post or attach *minimal* and complete (runnable as is) code that does 
not do what you expect.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +BTaskaya, pablogsal

___
Python tracker 

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



[issue25680] Selector.select() hangs when there is nothing to select

2020-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

That may well be correct. Do you want to submit a PR to fix it?

--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

But that is the tokenize.py module. It does not have 100% the same behavior as 
the builtin tokenizer.c module. In this case it probably doesn't.

--

___
Python tracker 

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



[issue30140] Binary arithmetic does not always call subclasses first

2020-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Let's give up on this one.

--
resolution:  -> wont fix
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



[issue40208] Remove deprecated symtable.SymbolTable.has_exec

2020-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, this seems safe to remove. If somebody's code breaks, that will just help 
them remove some dead code.

--

___
Python tracker 

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



[issue40219] ttk LabeledScale: label covered by hidden element

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.6 only get security fixes, but your nice minimal, complete verifiable example 
let me verify easily on 3.9a5 with tk 8.6.9 and 3.6 with 8.6.6 and 2.7.17 with 
8.5.19. The hidden element appears to be something like'||' with only part 
visible, depending on the scale value.  It at least partly obscures from -20 to 
15.  (Clicking the bar moves 1 unit at a time.)  This should be tested on other 
systems, but I suspect that this is an upstream tcl/tk issue.

--
nosy: +serhiy.storchaka, terry.reedy
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
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-04-10 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125
nosy_count: 5.0 -> 6.0
pull_requests: +18824
pull_request: https://github.com/python/cpython/pull/19469

___
Python tracker 

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



[issue40218] sys.executable is a false path if python is executed from gdb

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I shortened the title so that 'gdb' shows.  I have never used gdb, but I am 
curious what *is* the path to the python running the python code after 
'python'?  Is it part of or included with gdb?  If so, this seems a gdb bug, as 
it is the responsibility of the running python to correctly locate itself.  We 
are only responsible for the binaries we provide (Windows and macOS) or 
binaries compiled from the unpatched codebase.  (I said 'seems' because it 
could be that gdb compiles with an untested combination of supported compile 
switches.)

--
nosy: +terry.reedy
title: sys.executable is a non existing path if python is executed from gdb -> 
sys.executable is a false path if python is executed from gdb

___
Python tracker 

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



[issue40210] ttk.Combobox focus-out event inheritage

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

What OS and what tcl/tk patch version? (IDLE Help => About IDLE will show 
this).  3.5 only gets security patches.  On Windows, it came with a slightly 
older version of tk.  That might possibly be a problem.

One cannot place widgets 'in a treeview', so you are actually placing the 
entries or comboboxes *over* a cell of the treeview.  You are placing them, I 
presume, *in* the toplevel or frame also containing the treeview.  Try passing 
that container, instead of the treeview, as the parent.  Does the that fix your 
problem?  If so, please close as 'not a bug'.

Your example is too short.  It cannot be run as is.  And I do not understand 
the problem from your description.  If the treeview parent is not the problem, 
then your example is likely too long, as the treeview stuff is likely 
irrelevant noise.  Please repost or attach a minimal, complete and verifiable 
example as described in
https://stackoverflow.com/help/minimal-reproducible-example

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40249] __import__ doesn't honour globals

2020-04-10 Thread Stefan Seefeld


Stefan Seefeld  added the comment:

OK, thanks for the clarification. I think this is obscure enough to warrant at 
least a paragraph or two to clarify the semantics of these arguments.
I changed the issue "components" and "type" to reflect that.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python
type: behavior -> enhancement

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread miss-islington


miss-islington  added the comment:


New changeset ceba0648d70524ec4ebb7a46d5d1162d4938c7ba by Miss Islington (bot) 
in branch '3.8':
bpo-38501: Add a warning section to multiprocessing.Pool docs about resource 
managing (GH-19466)
https://github.com/python/cpython/commit/ceba0648d70524ec4ebb7a46d5d1162d4938c7ba


--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread miss-islington


miss-islington  added the comment:


New changeset 2e49b5254aa0888dd21a7929be14b6cfe03d56ef by Miss Islington (bot) 
in branch '3.7':
bpo-38501: Add a warning section to multiprocessing.Pool docs about resource 
managing (GH-19466)
https://github.com/python/cpython/commit/2e49b5254aa0888dd21a7929be14b6cfe03d56ef


--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7ec43a73092d43c6c95e7dd2669f49d54b57966f by Pablo Galindo in 
branch 'master':
bpo-38501: Add a warning section to multiprocessing.Pool docs about resource 
managing (GH-19466)
https://github.com/python/cpython/commit/7ec43a73092d43c6c95e7dd2669f49d54b57966f


--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18823
pull_request: https://github.com/python/cpython/pull/19468

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +18822
pull_request: https://github.com/python/cpython/pull/19467

___
Python tracker 

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



[issue40208] Remove deprecated symtable.SymbolTable.has_exec

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Answer: no.  The 2006 patch already removed OPT_EXEC and OPT_BARE_EXEC.

--

___
Python tracker 

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



[issue40208] Remove deprecated symtable.SymbolTable.has_exec

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

https://docs.python.org/3/library/symtable.html#symtable.SymbolTable.has_exec
merely says "Return True if the block uses exec."  This never happens since
https://github.com/python/cpython/blob/3.8/Lib/symtable.py#L87
is "return False".  I presume 'exec' refers to 2.x statement, not the 3.x 
function.  The docstring on line 86 does say "Deprecated method."

Guido, you changed these lines in 2006, in 
2def557aba1aaa42b638f9bf95624b7e6929191c  I presume you left them for the 
benefit of ported 2.7 code.  Should the function be removed for 3.9 or left 
until 3.10?  Your commit message referred to 'dead EXEC related constants'.  Is 
there anything else that should be removed?

--
nosy: +gvanrossum, terry.reedy
title: Remove deprecated SymbolTable.has_exec -> Remove deprecated 
symtable.SymbolTable.has_exec

___
Python tracker 

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



[issue40250] unable to comment out r'\u' string with triple quote marks

2020-04-10 Thread Vedran Čačić

Vedran Čačić  added the comment:

This "bug" is reported at least once a year, by different people. Maybe we 
should put something in the documentation, to the effect that

a) as Eric said, triple-quoted strings are not (meant to be used as) comments

b) if you nonetheless really want to use them that way, in most cases you _can_ 
get away with using r'''...'''.

--
nosy: +veky

___
Python tracker 

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



[issue40248] Proposed class for collections: dynamicdict

2020-04-10 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This feature is already provided by just supplying a `__missing__` dunder:

py> class MyDict(dict):
... def __missing__(self, key):
... return "The key is {}".format(key)
...
py> d = MyDict()
py> d[1234]
'The key is 1234'


I'm closing this ticket, but if the discussion on Python-Ideas reaches 
consensus that your class is necessary, feel free to re-open it.

--
nosy: +steven.daprano
resolution:  -> out of date
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



[issue40207] Expose NCURSES_EXT_FUNCS under curses

2020-04-10 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +twouters

___
Python tracker 

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



[issue40205] Profile 'builtins' parameter documentation missing

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I verified the statements and notice that profile.Profile has many methods not 
in cProfile.Profile.  Neither is a complete replacement for the other.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A few days ago, 3.8 backports failed while 3.7 backports merged. Thank you for 
the fix, even if temporary.

I just noticed that the doc main page ends with "Created using Sphinx 2.3.1."  
I plan to switch my local sphinx to that version.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18821
pull_request: https://github.com/python/cpython/pull/19466

___
Python tracker 

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



[issue40240] Expose public spelling of _PyGC_FINALIZED and _PyGC_SET_FINALIZED?

2020-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

New changeset f13072b8a89a922285737988b086beb4b06c6648 by Pablo Galindo in 
branch 'master':
bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public 
C-API (GH-19461)
https://github.com/python/cpython/commit/f13072b8a89a922285737988b086beb4b06c6648

--

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f13072b8a89a922285737988b086beb4b06c6648 by Pablo Galindo in 
branch 'master':
bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public 
C-API (GH-19461)
https://github.com/python/cpython/commit/f13072b8a89a922285737988b086beb4b06c6648


--

___
Python tracker 

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



[issue40250] unable to comment out r'\u' string with triple quote marks

2020-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

This basically comes down to """\u""" not being a valid string.

I'm not sure why you'd expect this to work: triple quoted strings are not 
designed as a general purpose "comment out" facility, and as you've discovered, 
they don't work that way. What's inside a triple quoted string must be 
interpretable as a python string, which in this case it is not.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40250] unable to comment out r'\u' string with triple quote marks

2020-04-10 Thread Elmar Bucher


Change by Elmar Bucher :


--
type:  -> compile error

___
Python tracker 

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



[issue40252] selectors.KqueueSelector should not be the default selector

2020-04-10 Thread Russell Davis


New submission from Russell Davis :

There are at least two outstanding bugs where KqueueSelector behaves 
differently than the other selectors:

#40251
#25680

This breaks the abstraction of being able to rely on DefaultSelector() to 
provide consistent behavior. At least on macOS, PollSelector works reliably, so 
I propose using that instead of KqueueSelector when setting DefaultSelector. 
(Even if the above bugs eventually get fixed, sticking with PollSelector when 
possible seems more likely to avoid similar future issues.)

--
components: IO, Library (Lib), asyncio
messages: 366168
nosy: asvetlov, russelldavis, yselivanov
priority: normal
severity: normal
status: open
title: selectors.KqueueSelector should not be the default selector
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



[issue40251] selectors.KqueueSelector hangs on EOF, unlike other selectors

2020-04-10 Thread Russell Davis


New submission from Russell Davis :

Repro (on macOS):

from selectors import KqueueSelector, EVENT_READ
with open('/tmp/foo', 'w') as f:
f.write("bar")
sel = KqueueSelector()
sel.register(f, EVENT_READ)
sel.select()

The above code will hang on the last line. If you change KqueueSelector to 
PollSelector or SelectSelector, it will not hang.

Per msg255116, the different selectors should behave consistently.

--
components: IO, Library (Lib), asyncio
messages: 366167
nosy: asvetlov, russelldavis, yselivanov
priority: normal
severity: normal
status: open
title: selectors.KqueueSelector hangs on EOF, unlike other selectors
versions: Python 3.8

___
Python tracker 

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



[issue26571] turtle regression in 3.5

2020-04-10 Thread Furkan Onder


Change by Furkan Onder :


--
keywords: +patch
nosy: +furkanonder
nosy_count: 4.0 -> 5.0
pull_requests: +18820
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19465

___
Python tracker 

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



[issue40250] unable to comment out r'\u' string with triple quote marks

2020-04-10 Thread Elmar Bucher


New submission from Elmar Bucher :

When I try to comment out this little code by triple quotation, 
I run into
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 29-30: truncated \u escape

ls_tex = []
ls_tex.append(r'\usepackage{mathtools}')
print(ls_tex)

Basically it is not possible to use r'\u' and comment it out with ''' or """. I 
think this should not be the case, this is an interpreter error.

--
components: Interpreter Core
messages: 366166
nosy: Elmar Bucher
priority: normal
severity: normal
status: open
title: unable to comment out r'\u' string with triple quote marks
versions: Python 3.7

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Lysandros Nikolaou

Lysandros Nikolaou  added the comment:

At the moment, if the prefix is invalid, it gets tokenized as a NAME node and 
the string following is tokenized as a STRING node with no prefix.

╰─ echo "ur''" | ./python -m tokenize
1,0-1,2:NAME   'ur'   
1,2-1,4:STRING "''"   
1,4-1,5:NEWLINE'\n'   
2,0-2,0:ENDMARKER  ''

╰─ echo "f''" | ./python -m tokenize  
1,0-1,3:STRING "f''"  
1,3-1,4:NEWLINE'\n'   
2,0-2,0:ENDMARKER  ''

--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

So a slightly shorter example uses ru''. This is an error because you can't 
combine the r prefix and the u prefix (in fact you can't combine anything with 
the r prefix).

I declare that this is a bug to report EOF here and the code should *first* 
check for a valid combination (e.g. fr'' or rf'') and only *then* try to 
distinguish between single and triple quotes.

--

___
Python tracker 

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



[issue25680] Selector.select() hangs when there is nothing to select

2020-04-10 Thread Russell Davis


Russell Davis  added the comment:

Looks like this is caused by #29255

--
nosy: +russelldavis

___
Python tracker 

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



[issue29255] selects.KqueueSelector behaves incorrectly when no fds are registered

2020-04-10 Thread Russell Davis


Russell Davis  added the comment:

This looks like it's the cause of https://bugs.python.org/issue25680

--
nosy: +russelldavis

___
Python tracker 

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



[issue40249] __import__ doesn't honour globals

2020-04-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

globals is only used when level > 0, to resolve relative names like in `import 
..foo`. You have to set keys __package__ and __spec__ or __name__ and __path__ 
in this case.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread hai shi


Change by hai shi :


--
pull_requests: +18819
pull_request: https://github.com/python/cpython/pull/19464

___
Python tracker 

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



[issue40249] __import__ doesn't honour globals

2020-04-10 Thread Stefan Seefeld


New submission from Stefan Seefeld :

I'm trying to import custom scripts that expect the presence of certain 
variables in the global namespace.
It seems `__import__('script', globals=dict(foo='bar'))` doesn't have the 
expected effect of injecting "foo" into the namespace and making it accessible 
to the script being loaded.

Is this a bug in `__import__` or am I missing something ? If the behaviour is 
expected, how can I achieve the desired behaviour ?

--
components: Interpreter Core
messages: 366160
nosy: stefan
priority: normal
severity: normal
status: open
title: __import__ doesn't honour globals
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue40248] Proposed class for collections: dynamicdict

2020-04-10 Thread Steele Farnsworth


Steele Farnsworth  added the comment:

Thank you, I have done so.

--

___
Python tracker 

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



[issue40248] Proposed class for collections: dynamicdict

2020-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

You probably want to bring this up on the python-ideas mailing list for 
discussion. Features like this typically get discussed there first.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40248] Proposed class for collections: dynamicdict

2020-04-10 Thread Steele Farnsworth


New submission from Steele Farnsworth :

I have implemented a class in the C code of the collections module which has 
similar behavior to the defaultdict class. This class, dynamicdict, supplies 
values for keys that have not yet been added using a default factory callable, 
but unlike defaultdict, the missing key itself is passed to the callable. This 
code can be seen here: 
https://github.com/swfarnsworth/cpython/blob/3.8/Modules/_collectionsmodule.c#L2234

While this does introduce a lot of redundant code, I'm not sure how it could be 
done without copying the implementation of the defaultdict class and adjusting 
how the default factory is called. For example, I don't believe that it's 
possible to support both behaviors within the defaultdict class without 
breaking backwards compatibility or adding another parameter to the constructor 
for the defaultdict class.

I would be happy to further explain the concept, implementation, potential use 
cases, or anything else that might work towards the adoption of this feature.

--
components: ctypes
messages: 366157
nosy: Steele Farnsworth
priority: normal
severity: normal
status: open
title: Proposed class for collections: dynamicdict
type: enhancement
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



[issue40203] Warn about invalid PYTHONUSERBASE

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I marked this for 'interpreter Core' because it affects imports and nothing 
else seemed better.

I marked this for 3.9 because it is too late to change 2.7.  But I don't know 
whether PYTHONUSERBASE is still treated (or not treated) the same.

Volker, I assume that you meant 'no good reason to not do so'.  A possible 
reason is that checking the validity of all environmental variables at startup 
would slow down startup, whereas we have been trying to speed it up.  Also, if 
PYTHONUSERBASE, in particular, is ever used for an import, a bad value will 
result in an import error.

--
components: +Interpreter Core
nosy: +terry.reedy
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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread hai shi


hai shi  added the comment:

> This macro should be converted to an opaque function
Can I try it?

--

___
Python tracker 

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



[issue40197] Add nanoseconds to timing table in What's new python 3.8

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Raymond, I finished the backporting and assume that your patch was meant to be 
a complete fix.

--
nosy: +terry.reedy
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



[issue40247] Logged out of user when running Tkinter

2020-04-10 Thread J


New submission from J :

Whenever I run a python script with any Tkinter command, I get instantly logged 
out of my user. I have been using Tkinter for weeks now and it was running just 
fine until yesterday when I clicked the demo button in the default taskbar that 
shows up when launching a Tkinter GUI. It has been crashing now ever since if I 
include any Tkinter bits in the code. I have been using Python 3.7.7 with the 
Tkinter version that came with it before this problem started showing up. I 
have furiously tried everything I could think of (mind me, I'm pretty new to 
this) including installing preceding and later versions from the official 
python.org page (3.8.2, 3.8.1, 3.8.0, 3.7.0, 3.6.6 etc.). On some version of 
python, Tkinter runs and creates the main window with command tk.Tk(), however 
it would embed it into another window (see attached screenshot). Weird stuff. 
I've searched across the internet for similar issues to no avail.

Operation System: MacOS Mohave 10.14.6

I hope I'm in the right place to report this abnormal crashing. I would be very 
thankful for any guidance.

--
components: Tkinter
files: 2.png
messages: 366153
nosy: Jordan
priority: normal
severity: normal
status: open
title: Logged out of user when running Tkinter
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file49048/2.png

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

/* Test if an object has a GC head */
#define PyObject_IS_GC(o) \
(PyType_IS_GC(Py_TYPE(o)) \
 && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))

This macro should be converted to an opaque function.

--

___
Python tracker 

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



[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2020-04-10 Thread Numerlor


Numerlor  added the comment:

The newest 64 bit release from python.org via the executable installer.

--

___
Python tracker 

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



[issue40197] Add nanoseconds to timing table in What's new python 3.8

2020-04-10 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



[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Win 10, with recently compiled 3.7.7+ and 3.9.0a5+, I get 4 warnings also.

>>> import warnings
>>> compile("'\d'", "", "eval")
:1: DeprecationWarning: invalid escape sequence \d
:1: DeprecationWarning: invalid escape sequence \d
 at 0x00A65DC0, file "", line 1>
>>> warnings.resetwarnings()
>>> compile("'\d'", "", "eval")
:1: DeprecationWarning: invalid escape sequence \d
:1: DeprecationWarning: invalid escape sequence \d
 at 0x00A66190, file "", line 1>

Numerior, what 3.8 binaries are you running?  I suspect that this should be 
closed as 'out of date'.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40197] Add nanoseconds to timing table in What's new python 3.8

2020-04-10 Thread miss-islington


miss-islington  added the comment:


New changeset 1bf7dee8d35cb19db7ee98229dd2e5726e6c7606 by Miss Islington (bot) 
in branch '3.8':
bpo-40197: Better describe the benchmark results table (GH-19386)
https://github.com/python/cpython/commit/1bf7dee8d35cb19db7ee98229dd2e5726e6c7606


--

___
Python tracker 

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



[issue40197] Add nanoseconds to timing table in What's new python 3.8

2020-04-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18818
pull_request: https://github.com/python/cpython/pull/19462

___
Python tracker 

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



[issue40178] Convert the remaining os funtions to Argument Clinic

2020-04-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#37206 changed the signature "pop(self, key, default=None, /)" back to 
"D.pop(k[,d]) -> v", taken from dict.pop.__doc__.  However, the incorrect 
version that got reverted correctly added the positional-only indicator '/'.  
Docstrings with signatures for such cases may need updating.

Unlike most objects with invalid signatures (as seen by inspect.signature), the 
current docstring for os.get_terminal_size does not have a backup signature for 
help (and IDLE) to present.  I cannot tell if the patch adds it.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> One potential reason would be that the consequences of bad resource 
> management in this case are different than in the open() case, i.e., here the 
> interpreter hangs -- or Travis runs for your repo (SciPy) get stuck with 
> over-50-minute errors, which is how we started looking for how to track it 
> down.

Agreed, but is the same problem: resources need to be managed. I am although ok 
if you want to add some targeted warning to the multiprocessing pool docs 
indicating what can happen if the resource is not properly managed.

> Indeed, my point is more about potential prevalence: this (now incorrect) 
> problematic usage pattern was the first example in the docs for 
> multiprocessing for a long time, indicating that there might be a lot of code 
> in the wild that might (still) make use of it.

Right, we put great efforts to make the code such that even incorrect usages do 
not hang (and believe me, is *very* challenging) but we cannot sacrifice 
correct usage fixes or big improvements so incorrect usages keep working even 
if they are leaking resources. Hopefully, more and more people start using the 
context manager or are aware that are doing something wrong leaking the pool.



In conclusion, I agree that maybe adding some targetted warning to the pool 
docs about this is in place. When I prepare the PR, would you like to review 
the message to confirm that is clear enough and that makes sense?

--

___
Python tracker 

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



[issue40241] [C API] Make PyGC_Head structure opaque, or even move it to the internal C API

2020-04-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18817
pull_request: https://github.com/python/cpython/pull/19461

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

After some investigating, I found out that this is happening because when we 
execute `fur''` in the interactive interpreter there is an implicit newline, 
which means that EOF does not get reached.

OTOH there is no newline when passing it as a string inside an `eval` call. 
After the tokenizer encounters the first quote, it calls `tok_nextc` twice 
more, in order to differentiate between a single-quoted and a triple-quoted 
string, thus reaching EOF and proapgating an EOF error up through the 
`perrdetail` struct.

--

___
Python tracker 

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



[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> not a bug
stage: test needed -> 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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Eric Larson


Eric Larson  added the comment:

> Why? This is a resource like any other and it requires proper resource 
> management. Would you also put a big warning on "open()" stating that opening 
> a file requires either using a context manager or ensure a manual close()?

One potential reason would be that the consequences of bad resource management 
in this case are different than in the open() case, i.e., here the interpreter 
hangs -- or Travis runs for your repo (SciPy) get stuck with over-50-minute 
errors, which is how we started looking for how to track it down.

> > the first Python 2.7 example in the docs 

> Python 2.7 is not supported and the pool has changed *a lot* since Python 2. 

Indeed, my point is more about potential prevalence: this (now incorrect) 
problematic usage pattern was the first example in the docs for multiprocessing 
for a long time, indicating that there might be a lot of code in the wild that 
might (still) make use of it.

> Yeah, and CPython does not promise that the __del__ method of any object will 
> be called, so is not assured that the finalized will call close():

Ahh, I didn't know that. This might be another good reason to add a warning 
about the risks of not ensuring closure yourself: others might have the same 
gap in knowledge I had, and assume the docs are saying that things will be 
taken care of by garbage collection on exit when they will not.

But you of course cannot document every possible problematic situation users 
could put themselves in, so I leave it up to your judgment whether or not it's 
worth it in this case.

--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
nosy: +gvanrossum, pablogsal

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Henry Carscadden


Henry Carscadden  added the comment:

Tim, I'm guessing it was a misdiagnosis then. In any case, something changed 
about my codebase that alleviated the problem. Thanks for looking into it.

--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-04-10 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

While testing pegen, we found this out:

Python 3.9.0a5+ (heads/pegen:502dfb719e, Apr 10 2020, 20:57:05) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> fur''
  File "", line 1
fur''
   ^
SyntaxError: invalid syntax
>>> eval("fur''")
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
fur''
   ^
SyntaxError: unexpected EOF while parsing

--
components: Interpreter Core
messages: 366143
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: Different error messages for same error - invalid string prefixes
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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> If that's out of contract, perhaps there should probably a big, visible 
> warning at the top of the multiprocessning docs stating that creating one of 
> these objects requires either using a context manager or ensuring manual 
> `.close()`ing?

Why? This is a resource like any other and it requires proper resource 
management. Would you also put a big warning on "open()" stating that opening a 
file requires either using a context manager or ensure a manual close()?

>  the first Python 2.7 example in the docs 

Python 2.7 is not supported and the pool has changed *a lot* since Python 2. 
For instance, the pool now does more correct resource management, it does not 
leak threads and it supports more safe mechanisms as a context manager. The 
reason it didn't hang that much in Python2.7 is likely because some threads 
were being leaked.

> This is called automatically when the queue is garbage collected.

Yeah, and CPython does not promise that the __del__ method of any object will 
be called, so is not assured that the finalized will call close():

https://docs.python.org/3/reference/datamodel.html#object.__del__

"It is not guaranteed that __del__() methods are called for objects that still 
exist when the interpreter exits"

--

___
Python tracker 

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



[issue40245] Add description meta tags to docs.python.org

2020-04-10 Thread Andy Lester


Change by Andy Lester :


--
nosy: +petdance

___
Python tracker 

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



[issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file

2020-04-10 Thread hai shi


hai shi  added the comment:

> Looks like it worked.
Oh, sorry, I checked the wrong gate.

--

___
Python tracker 

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



[issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file

2020-04-10 Thread hai shi


hai shi  added the comment:

> Maybe CFLAGS_NODIST should be used instead of CFLAGS.
Looks like it worked.

> Python is built GCC with -ftest-coverage option.
More exact description is: Python is built GCC with --coverage option, 
--coverage option including -ftest-coverage option.

--

___
Python tracker 

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



[issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file

2020-04-10 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Tim Peters


Tim Peters  added the comment:

Henry, no, I see no problem while running your example.  It's been running on 
my box for over 5 minutes now, and memory use remains trivial.

Note that in the code I posted for you, instead of [1, 2] I used range(100), 
and instead of 50 I used a million:  the same kind of thing, but I used _far_ 
larger numbers.  And still didn't have a problem.  Although, yes, that did 
consume about a gigabyte to materialize a million instances of 
tuple(range(100)) under the covers.

The code you posted also works fine for me, and with minor memory consumption, 
if I replace your "50" with "100":

>>> many_arguments = [[1,2] for i in range(100)]
>>> for term in product(*many_arguments):
... pass

100% of a CPU is used for as long as I let it run, but memory use jumps just a 
little at the start.  Which is what I expected.  It just doesn't take all that 
much memory to create a million 2-tuples - which is what the `product()` 
implementation does.

I believe you saw a MemoryError, but at this point I have to guess you 
misdiagnosed the cause.  In any case, if you can't supply an example that 
reproduces the problem, we're going to have to close this.

Perhaps there's some weird memory-allocation flaw on the _platform_ you're 
using?  Extreme fragmentation?  Without an example that exhibits a problem, 
there's just no way to guess from here :-(

--

___
Python tracker 

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



[issue40245] Add description meta tags to docs.python.org

2020-04-10 Thread Andrew Zhou


New submission from Andrew Zhou :

This isn't a particularly high priority, but it would be nice to have the first 
paragraph of docs pages show up when searched or posted in Slack, Discord, 
Twitter, etc. This is done through the description meta tag, as well as Open 
Graph, etc. As the description meta tag covers most of the potential use cases, 
the others can wait.

What implementing this would entail is either manual addition of meta tags, or 
an automatic transform step that grabs the first paragraph of the relevant RST 
source. [1]

http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_transform

--
assignee: docs@python
components: Documentation
messages: 366138
nosy: 0az, docs@python
priority: normal
severity: normal
status: open
title: Add description meta tags to docs.python.org
type: enhancement

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Eric Larson


Eric Larson  added the comment:

If that's out of contract, perhaps there should probably a big, visible warning 
at the top of the multiprocessning docs stating that creating one of these 
objects requires either using a context manager or ensuring manual 
`.close()`ing?

1. It either used to be in contract not to close it manually or was wrongly 
represented, the first Python 2.7 example in the docs 
(https://docs.python.org/2/library/multiprocessing.html#introduction) is:

from multiprocessing import Pool

def f(x):
return x*x

if __name__ == '__main__':
p = Pool(5)
print(p.map(f, [1, 2, 3]))

So I suspect this (difficult to track down) problem might hit users without 
more adequate warning.


2. I'm surprised it's actually out of contract when the 3.8 docs state that 
close will be automatically called:

> close()
>
> Indicate that no more data will be put on this queue by the current process. 
> The background thread will quit once it has flushed all buffered data to the 
> pipe. This is called automatically when the queue is garbage collected.

and

> terminate()
>
> Stops the worker processes immediately without completing outstanding work. 
> When the pool object is garbage collected terminate() will be called 
> immediately.

Or perhaps I misunderstand what this is saying?

--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Not sure if there are any special considerations for Windows here.

It should not be anything windows specific here.

Also notice that although "it works", the reproducer in 
https://bugs.python.org/issue38501#msg354813 is out of contract because is not 
closing or terminating the pool correctly and is not using it with the context 
manager so if you are dealing with code equivalent to that I would suggest to 
take a look to properly finalize/finalize the pool to about similar problems 
(or other problems related to late finalization).

--
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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Stefano Rivera


Stefano Rivera  added the comment:

On Linux, the reproducer in https://bugs.python.org/issue38501#msg354813 fails 
on ac10e0c93218627d1a639db0b7b41714c5f6a883^ and passes on 
ac10e0c93218627d1a639db0b7b41714c5f6a883, which is why I say PR 19009 fixes it.

Not sure if there are any special considerations for Windows here.

HEAD is good too. So from my PoV, good to close this.

--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>Looks like it was fixed by PR 19009 (bpo-39360)).

Can we close the issue then? If not, could yo provide a reproducer and also 
check if the big is fixed on master or 3.8 HEAD? Thanks!

--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-04-10 Thread Stefano Rivera


Stefano Rivera  added the comment:

Looks like it was fixed by PR 19009 (bpo-39360)).

--

___
Python tracker 

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



[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Henry Carscadden


Henry Carscadden  added the comment:

@Tim Peters
For example,
the following should reproduce the error:
many_arguments = [[1,2] for i in range(50)]
for term in product(*many_arguments):
print(term)
In my application, I was taking the Cartesian product of the sets of all simple 
path to several nodes. This regularly produced a lot of arguments and crashed 
the compute nodes on which my jobs were running. Perhaps, this is not a salient 
concern for most uses, but I just wanted to make you aware of the issue.

--

___
Python tracker 

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



[issue39598] Spam magnet

2020-04-10 Thread Zachary Ware


Change by Zachary Ware :


--
nosy:  -zach.ware

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-04-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18815
pull_request: https://github.com/python/cpython/pull/19459

___
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-04-10 Thread Guido van Rossum

Guido van Rossum  added the comment:


New changeset 0361556537686f857f1025ead75e6af4ca7cc94a by Batuhan Taşkaya in 
branch 'master':
bpo-39481: PEP 585 for a variety of modules (GH-19423)
https://github.com/python/cpython/commit/0361556537686f857f1025ead75e6af4ca7cc94a


--

___
Python tracker 

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



[issue39285] PurePath.match indicates case-sensitive nature and presents a case-insensitive example

2020-04-10 Thread Tim Lo


Change by Tim Lo :


--
keywords: +patch
nosy: +timlo
nosy_count: 4.0 -> 5.0
pull_requests: +18814
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19458

___
Python tracker 

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



[issue40243] Unicode 3.2 numeric uses decimal_changed instead of numeric_changed

2020-04-10 Thread William Meehan


Change by William Meehan :


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

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

> [0003c2dc1d4cf5b122e73e83177fd274fa9a9913] bpo-40096: Support 
> __attribute__((__noreturn__)) on xlc (GH-19204)

The fix looks simple: revert this change, no?

--

___
Python tracker 

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



[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-10 Thread STINNER Victor


STINNER Victor  added the comment:

Well, this large problem sounds very complex and is made of multiple small 
issues. Let's start with something simple: revert my commit 
066e5b1a917ec2134e8997d2cadd815724314252.

When I wrote it, I expected that nobody was spawning daemon threads in 
subinterpreters. I was wrong.

Once PR 19456 will be merged (allow again to spawn daemon threads in 
subinterpreters), we can start to investigate every single issue listed by 
Graham, like atexit callbacks which are called too late.

--

___
Python tracker 

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



[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +18810
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19456

___
Python tracker 

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



[issue37266] Daemon threads must be forbidden in subinterpreters

2020-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18811
pull_request: https://github.com/python/cpython/pull/19456

___
Python tracker 

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



[issue40242] zmq mysql core dump

2020-04-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this. If you can provide information on how to reproduce 
this and/or what you observe in the segfault dump, we will happily reopen it.

I think the best "resolution" tag is to call this "third party", but I'm not 
sure it matters too much.

--
resolution:  -> third party
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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread Michael Felt

Michael Felt  added the comment:

On 10/04/2020 14:01, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> The assertion failure occurs in _PyObject_GC_TRACK() at:
>
> static void
> gen_dealloc(PyGenObject *gen)
> {
> PyObject *self = (PyObject *) gen;
>
> _PyObject_GC_UNTRACK(gen);
>
> if (gen->gi_weakreflist != NULL)
> PyObject_ClearWeakRefs(self);
>
> _PyObject_GC_TRACK(self);  // < HERE
>
> ...
> }
>
> It's surprising that the generator is still tracked by the GC after 
> _PyObject_GC_UNTRACK().
>
>
>> Calling this a compile error - as it seems to be compiler dependent.
> Do you reproduce the bug if you build Python with GCC?

To be clear - gcc does not not have an issue. As I stated elsewhere - it
is specific to xlc-v16, so likely it is a compiler error.

See also the result of `git bisect` study.

>
> Which ./configure command did you use? What are the compiler and linker flags?
>
> You can try:
>
> ./python -m test.pythoninfo|grep -E 'CFLAGS|CC|OPT|LDFLAGS'

With:

$ ./python -m test.pythoninfo|grep -E 'CFLAGS|CC|OPT|LDFLAGS'
Objects/genobject.c:127: _PyObject_GC_TRACK: Assertion "!(((PyGC_Head
*)(op)-1)->_gc_next != 0)" failed: object already tracked by the garbage
collector
Enable tracemalloc to get the memory block allocation traceback

object address  : 30084150
object refcount : 0
object type : 200144a8
object type name: generator
object repr : 

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: core initialized

Current thread 0x0001 (most recent call first):
  File "", line 1593 in _setup
  File "", line 1634 in _install
  File "", line 1189 in
_install_external_importers
ksh: 27328848 IOT/Abort trap(coredump)

Without error:

$ ./python -m test.pythoninfo|grep -E 'CFLAGS|CC|OPT|LDFLAGS'
os.environ[CC]: xlc_r
sysconfig[CC]: xlc_r
sysconfig[CFLAGS]: -O
sysconfig[CONFIG_ARGS]: '--with-openssl=/opt/aixtools'
'--without-computed-gotos' '--with-pydebug' 'CC=xlc_r'
sysconfig[OPT]: -O
sysconfig[PY_CFLAGS]: -O
sysconfig[PY_CFLAGS_NODIST]: -I./Include/internal
sysconfig[PY_STDMODULE_CFLAGS]: -O -I./Include/internal -I. -I./Include

> --
> nosy: +vstinner
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39598] Spam magnet

2020-04-10 Thread Zachary Ware


Zachary Ware  added the comment:

Maybe I'm just paranoid, but this whole issue reads like spam to me.  It's at 
least a spam magnet; changing the title accordingly and clearing the nosy list.

--
nosy:  -Sahurkhan, gustavoxo, judiction, nows, paul.moore, steve.dower, 
tim.golden, xtreak
title: ERR_CACHE_MISS -> Spam magnet

___
Python tracker 

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



[issue40238] os.stat() on Windows succeeds for nonexistent paths with trailing spaces

2020-04-10 Thread Eryk Sun


Eryk Sun  added the comment:

> I'd say os.path.normpath() should  perform the same (GetFullPathNameW?)
> normalization as os.stat() and friends do.

ntpath.abspath calls GetFullPathNameW (i.e. nt._getfullpathname) in Windows, 
but ntpath.normpath is pure Python. I agree that normpath should trim trailing 
spaces and dots from the last component. It should also normalize device paths 
and extended paths that start with ".\\" and "?\\". An extended path 
only skips normalization in an open or create context.

--

___
Python tracker 

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



[issue40221] Use new _at_fork_reinit() lock method in multiprocessing

2020-04-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file

2020-04-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue34033] distutils is not reproducible

2020-04-10 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2020-04-10 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

issue34722 also talks about frozenset, nondeterministic order and sorting. 
Maybe this ticket and that one are for the same issue?

--
nosy: +yan12125

___
Python tracker 

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



[issue40238] os.stat() on Windows succeeds for nonexistent paths with trailing spaces

2020-04-10 Thread David Strobach


David Strobach  added the comment:

Hi Eryk, thanks for your time and for the explanation.

> The Windows file API normalizes paths to replace forward slashes with 
> backslashes; resolve relative paths and "." and ".." components; strip 
> trailing spaces and dots from the final component; and map reserved DOS 
> device names in the final component of non-UNC paths to device paths (e.g. 
> "C:/Temp/con " -> r"\\.\con").

OK, I understand. I know that Win32 documentation suggests to avoid using paths 
with trailing spaces and that the paths are subject to normalization. Then I'd 
say os.path.normpath() should  perform the same (GetFullPathNameW?) 
normalization as os.stat() and friends do.

Currently:

>>> import os
>>> path = r"c:\Program Files "
>>> os.path.normpath(path)
'c:\\Program Files '
>>> os.path.realpath(path)
'C:\\Program Files'

--

___
Python tracker 

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



[issue39939] PEP 616: Add str methods to remove prefix or suffix

2020-04-10 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18809
pull_request: https://github.com/python/cpython/pull/19455

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread Michael Felt


Michael Felt  added the comment:

It is only XLC-v16 that fails. XLC-v11 and XLC-v13 work fine. Am digging to see 
which version (< v16, or >= v16) is not working as expected.

--

___
Python tracker 

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



[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread Michael Felt


Michael Felt  added the comment:

After git bisect - comes down to:

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[0003c2dc1d4cf5b122e73e83177fd274fa9a9913] bpo-40096: Support 
__attribute__((__noreturn__)) on xlc (GH-19204)

--

___
Python tracker 

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



[issue40238] os.stat() on Windows succeeds for nonexistent paths with trailing spaces

2020-04-10 Thread Eryk Sun


Eryk Sun  added the comment:

> While I agree that Windows is safe to transform paths as he wishes to, 
> the bug reported here is that os.stat/os.path.isdir behaves 
> differently than os.scandir. Can we make them behave the same?

os.listdir and os.scandir can be modified to behave like os.stat, but not the 
other way around. They differ because a "*.*" wildcard component is appended to 
the path that's passed to FindFirstFileW, and trailing spaces and dots only get 
stripped in the final path component. 

To implement this without hard-coding Windows filename rules, the path needs to 
be normalized via WINAPI GetFullPathNameW before appending the "*.*" component 
(or just "*"; the ".*" is superfluous) -- but only for normal paths, i.e. paths 
that do not begin with exactly "?\\". The functions that would need to be 
updated are _listdir_windows_no_opendir and os_scandir_impl in 
Modules/posixmodule.c.

Another option would be to rewrite listdir and scandir to use CreateFileW and 
GetFileInformationByHandleEx: FileIdBothDirectoryInfo [1]. This query provides 
two additional fields in comparison to the classic find data: ChangeTime (Unix 
st_ctime) and FileId (Unix st_ino). If the file is flagged as a reparse point 
in its attributes, then the reparse tag is set in the EaSize field of the 
directory info, since extended attributes can't be set on a reparse point; see 
[MS-FSCC] 2.4.17 [2].

[1]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_both_dir_info
[2]: 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/1e144bff-c056-45aa-bd29-c13d214ee2ba

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

___
Python tracker 

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



  1   2   >