[issue42290] Unicode inconsistent display after concencated

2020-11-07 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Works for me:

>>> chr(1839)+'1'
'ܯ1'

You are mixing a right-to-left code point (DHALATH) with a left-to-right code 
point (digit 1). The result depends on the quality of your console or terminal. 
Try using a different terminal.

On my system, the terminal displays the DHALATH on the left, and the digit 1 on 
the right; when pasted into my browser, it displays them in the reverse order. 
I don't know which is correct: bidirectional text is complex and I don't know 
the rules for mixing characters with different bidirection classes.

But whichever display is correct, this has nothing to do with Python. It 
depends on the quality of the bidirectional text rendering of the browser and 
the terminal.

If your terminal displays the wrong results, that's a bug in the terminal. What 
terminal are you using, in what OS? Try using a different terminal.

You can check that Python is doing the right thing:


>>> s = chr(1839)+'1'
>>> s == '\N{SYRIAC LETTER PERSIAN DHALATH}1'
True

If your system reports True, then Python has made the string you asked for, and 
the result of printing depends on the capabilities of the terminal, and the 
available glyphs in the typeface used by the terminal. There's nothing Python 
can do about that.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42278] Remove usage of tempfile.mktemp in stdlib

2020-11-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Most of them are in tests. There is no security issue there, also the code may 
be clearer and more reliable if use helper function test.support.temp_dir().

And most of the rest are in Windows specific code. Some Windows code may not 
work if you hold open file descriptor, so we should ensure that that code is 
tested.

--
components: +Windows
nosy: +paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue42288] typing.get_type_hints() returns Optional[Any] if the default value of the argument is None

2020-11-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Library (Lib)
nosy: +gvanrossum, levkivskyi
type:  -> enhancement
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue42290] Unicode inconsistent display after concencated

2020-11-07 Thread Xinmeng Xia

New submission from Xinmeng Xia :

When printing an assignment expression with unicode ܯ ( \U+072F)  on the 
command line, we get an unexpected result.
Example A:
>>> print(chr(1839)+" = 1")
ܯ = 1

Similar problems exist in plenty of characters of unicode.

--
components: Unicode
messages: 380534
nosy: ezio.melotti, vstinner, xxm
priority: normal
severity: normal
status: open
title: Unicode inconsistent display after concencated
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



[issue42289] Found a secret/private key in code.

2020-11-07 Thread Krrish Dhaneja


New submission from Krrish Dhaneja :

Found a private key in commit 9ae9ad8 in https://github.com/python/cpython .

--
messages: 380533
nosy: Krrishdhaneja
priority: normal
severity: normal
status: open
title: Found a secret/private key in code.
type: security
versions: Python 3.10, 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



[issue42288] typing.get_type_hints() returns Optional[Any] if the default value of the argument is None

2020-11-07 Thread Komiya Takeshi


New submission from Komiya Takeshi :

I noticed `typing.get_type_hints()` returns Optional[Any] as a type hints if 
the default value of the argument is None:

```
$ python
Python 3.9.0 (default, Oct 24 2020, 15:41:29)
[Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Any, get_type_hints
>>> def hello(name: Any = None):
... pass
...
>>> get_type_hints(hello)
{'name': typing.Optional[typing.Any]}
```

I know typing.get_type_hints() wraps the user's type annotation with Optional 
when the default value of the argument is None. But it is needless to wrap Any 
with Optional because Any already contains None. It would be better not to wrap 
it with Optional when the user's annotation is Any.

--
messages: 380532
nosy: i.tkomiya
priority: normal
severity: normal
status: open
title: typing.get_type_hints() returns Optional[Any] if the default value of 
the argument is None
versions: Python 3.10, 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



[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-07 Thread Yonatan Goldschmidt


New submission from Yonatan Goldschmidt :

Following https://bugs.python.org/issue42262, I think it'd be nice to convert 
existing C code to use the more concise Py_NewRef() and Py_XNewRef() where 
possible. Increases readability and less bug prone. 

Opening this new issue to track the conversion.

--
components: Interpreter Core
messages: 380531
nosy: Yonatan Goldschmidt, vstinner
priority: normal
severity: normal
status: open
title: Use Py_NewRef & Py_XNewRef where applicable
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42283] test_idle is interactive on macOS 11

2020-11-07 Thread Ned Deily


Ned Deily  added the comment:

This is the behavior seen with Tk 8.6.8 *built* on macOS 11.0 Big Sur; I'm 
assuming that's what Ronald was testing. We'll be updating the macOS installers 
to use a more recent Tk for installers built on 11.0 and this should go away. 
Note that Tk 8.6.8 *built* on, say, 10.9 as in the current python.org 
installers does not exhibit this behavior when *run* on 11.0.

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



[issue42283] test_idle is interactive on macOS 11

2020-11-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ned, do you have any experience of tk acting so differently on different macOS 
versions?

--
nosy: +ned.deily

___
Python tracker 

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



[issue8488] Docstrings of non-data descriptors "ignored"

2020-11-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Ah, all correct. In doc.py unlike to the inlined code Descriptor is a subclass 
of property. And since fset is None the instance is classified as a readonly 
property.

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



[issue42286] f_trace gets call on different lines each loop

2020-11-07 Thread Cornelius Krupp


New submission from Cornelius Krupp :

When using a local trace function, sometimes the line event is issued at the 
wrong time. As can be seen from the example file `f_trace_wrong_line.py`, each 
loop iteration we get either 24 or 23, apparently in a fixed rhythm.

While this might seem harmless, it appears that the line event for 23 (In this 
example) is issued at a time where the state of the stack is not valid to 
switch line. I noticed this because I wanted to implement a context manager 
that skips to a specific line, but this broken with mysterious error message 
`TypeError: 'NoneType' object is not callable` which I think is caused by the 
`with`-line not being fully executed and the stack still having the return 
value of `__enter__` on it.



Here the intro line of the interpreter:

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit 
(AMD64)] on win32

--
components: Interpreter Core
files: f_trace_wrong_line.py
messages: 380527
nosy: trampchamp
priority: normal
severity: normal
status: open
title: f_trace gets call on different lines each loop
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49580/f_trace_wrong_line.py

___
Python tracker 

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



[issue8488] Docstrings of non-data descriptors "ignored"

2020-11-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Actually there is no bug in not showing docstring for "data" and "non_data". 
"Doc of a data-descriptor." is the docstring of the type of the descriptor, not 
the descriptor itself. If it would be "Type of a data-descriptor." it would be 
more obvious. To output the docstring for descriptor you need to set the 
__doc__ attribute of the instance.

The original bug is fixed. The non data descriptor is now shown in the correct 
section. If it would have own docstring it would be shown.

But the data descriptor is shown in wrong section. It is not readonly.

--

___
Python tracker 

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



[issue1475692] replacing obj.__dict__ with a subclass of dict

2020-11-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is no longer need to use OrderedDict as __dict__, but ctypes types have 
tp_dict which are instances of dict subclass (StgDict). Disabling setting it to 
anything that is not an exact dict would break ctypes.

--

___
Python tracker 

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



[issue10529] [doc] Write argparse i18n howto

2020-11-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This is a great idea.  I'm thinking that the Argparse Tutorial is the right 
place for this:  https://docs.python.org/3/howto/argparse.html

--
nosy: +rhettinger

___
Python tracker 

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



[issue1475692] replacing obj.__dict__ with a subclass of dict

2020-11-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm going to mark this as rejected.  After 14 years, no clean and performant 
solution has emerged, yet the world of Python seems to be fine with the status 
quo.  This issue doesn't seem to be getting in the way of people doing their 
job.

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



[issue42284] The grammar specification is inconsistent with the implementation of Python parser.

2020-11-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Georg.   

In writing compilers, it is often convenient to allow the grammar to be 
permissive and save the enforcement of additional syntax restrictions for the 
downstream semantic analysis phase.

For example, the C language grammar specifies the "break" statement in much the 
same way as Python does:  http://www.quut.com/c/ANSI-C-grammar-y.html

Thank you for the suggestion, but I'm going to mark this as declined.

--
nosy: +rhettinger
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



[issue14903] dictobject infinite loop in module set-up

2020-11-07 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I suspect so.  If any modern supported python 3.x version runs into an issue 
like this I think opening a fresh bugreport is good.

Closing as not reproducable / obsolete.

--
resolution:  -> out of date
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



[issue25259] readline macros can segfault Python

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue14003] __self__ on built-in functions is not as documented

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue42285] Missing spaces in list literals in Tutorial/Data Structures

2020-11-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but I'm going to mark it as declined for the reasons 
listed in the PR.

--
nosy: +rhettinger
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



[issue16221] tokenize.untokenize() "compat" mode misses the encoding when using an iterator

2020-11-07 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is fixed now - the tests in the patch are passing.

--
nosy: +iritkatriel

___
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 heap types: use PyType_FromSpec()

2020-11-07 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Thank you @erlendaasland !

--
components: +Extension Modules -C API, Subinterpreters
nosy: +pitrou
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
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 heap types: use PyType_FromSpec()

2020-11-07 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Oops, sorry, I hadn't noticed this was a catch-all issue. Reopening.

--
resolution: fixed -> 
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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-11-07 Thread miss-islington


miss-islington  added the comment:


New changeset 01c6aa43dc56b3b64d584c58a49c86f816c05a91 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40077: Convert _queuemodule to use heap types (GH-23136)
https://github.com/python/cpython/commit/01c6aa43dc56b3b64d584c58a49c86f816c05a91


--
nosy: +miss-islington

___
Python tracker 

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



[issue42285] Missing spaces in list literals in Tutorial/Data Structures

2020-11-07 Thread Jakub Moliński

Change by Jakub Moliński :


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

___
Python tracker 

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



[issue14903] dictobject infinite loop in module set-up

2020-11-07 Thread Irit Katriel


Irit Katriel  added the comment:

Is this a python 2-only issue?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42285] Missing spaces in list literals in Tutorial/Data Structures

2020-11-07 Thread Jakub Moliński

New submission from Jakub Moliński :

In the Data Structures section of the Tutorial there are examples of nested 
list comprehensions that include list literals where elements are written 
without spaces after commas (`[1,2,3]` instead `[1, 2, 3]`). 

This is a trivial problem but since this is a tutorial for newcomers (and one 
of the previous parts of this tutorial explicitly says that the spaces should 
be present after commas, and in other parts of the tutorial they are 
consistently put there) I think this deserves to be fixed.

--
assignee: docs@python
components: Documentation
messages: 380514
nosy: docs@python, jakub.molinski
priority: normal
severity: normal
status: open
title: Missing spaces in list literals in Tutorial/Data Structures
type: enhancement

___
Python tracker 

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



[issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory.

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory.

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 3.0 -> 4.0
pull_requests: +22095
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23192

___
Python tracker 

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



[issue42278] Remove usage of tempfile.mktemp in stdlib

2020-11-07 Thread E. Paine


Change by E. Paine :


--
components: +Distutils
nosy: +dstufft, eric.araujo

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-07 Thread E. Paine


E. Paine  added the comment:

Just checking: is this not because the lazy import should be in `__init__.py`? 
(the code provided works fine with `a.b.my_function` on my system)

--
components: +Interpreter Core -Library (Lib)
nosy: +brett.cannon, epaine, eric.snow, ncoghlan
type:  -> behavior

___
Python tracker 

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



[issue1250] Building external modules using Sun Studio 12

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.1, Python 
3.2

___
Python tracker 

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



[issue42233] GenericAlias does not support union type expressions

2020-11-07 Thread miss-islington


miss-islington  added the comment:


New changeset e81e09bfc8a29a44a649a962870a26fe0c097cfa by Miss Islington (bot) 
in branch '3.9':
bpo-42233: Correctly repr GenericAlias when used with typing module (GH-23081)
https://github.com/python/cpython/commit/e81e09bfc8a29a44a649a962870a26fe0c097cfa


--

___
Python tracker 

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



[issue42283] test_idle is interactive on macOS 11

2020-11-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Strange.  test_idle runs fine on my Mohave, so I cannot investigate what you 
see.  Tests of classes that create windows and call wait_window pass 
_utest_=True and wait_window calls are guarded by "if not _utest:".  I believe 
this is always in __init__.  You could grep idlelib for _utest, find a window 
that stays open, and add prints to see what tkinter call is causing the hang, 
and if it is in the not-_utest suite.

When I run the entire suite rather than just test_idle, I instead get multiple 
"Python quit unexpectedly" boxes and failures in 5 other tests.

--
assignee: terry.reedy -> 
title: test_idle is interactive -> test_idle is interactive on macOS 11

___
Python tracker 

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



[issue41712] REDoS in purge

2020-11-07 Thread Yash Shete


Change by Yash Shete :


--
pull_requests: +22094
pull_request: https://github.com/python/cpython/pull/23191

___
Python tracker 

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



[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-11-07 Thread hai shi


hai shi  added the comment:

> Do you mean something like "only expose a slot if you have a reason for > 
> exposing it"? That sounds like a tautology.
> Where in the docs would this go?

Add a friend Note in docs of `PyType_GetSlot` MAYBE?

> You mean nb_reserved, right?
Yes, thanks for your description.

--

___
Python tracker 

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



[issue42258] argparse: show choices once per argument

2020-11-07 Thread hai shi


New submission from hai shi :

I like your improvement.
But I suggest you should copy your first comment from your PR to here.(It's 
easy for discuss in here;)

--
nosy: +paul.j3, rhettinger, shihai1991

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-11-07 Thread Marc Culler


Marc Culler  added the comment:

Ned - do you have any news on the topic of packaging Tcl/Tk within the
Python bundle?

--

___
Python tracker 

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



[issue42280] The list of standard generic collections is incomplete

2020-11-07 Thread Ken Jin


Ken Jin  added the comment:

Dear Jack, good catch! My only worry is that if we make the list exhaustive,  
it would be too lengthy, or that it might not be feasible to continuously 
update it every time a new generic type supports the feature.

Maybe a line somewhere to mention that most container types in Python should 
support the feature, and that the list provided is non-exhaustive should 
suffice?

I'm not sure, nosy-ing Guido and Ivan to the list for their thoughts on this.

--
nosy: +gvanrossum, kj, levkivskyi

___
Python tracker 

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



[issue42282] Constant folding is skipped in named expressions

2020-11-07 Thread Nick Coghlan


Change by Nick Coghlan :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue42282] Constant folding is skipped in named expressions

2020-11-07 Thread Nick Coghlan


Nick Coghlan  added the comment:

Since this was only a performance issue, I'm not planning to backport it to 
earlier releases.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue42282] Constant folding is skipped in named expressions

2020-11-07 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 8805a4dad201473599416b2c265802b8885f69b8 by Nick Coghlan in 
branch 'master':
bpo-42282: Fold constants inside named expressions (GH-23190)
https://github.com/python/cpython/commit/8805a4dad201473599416b2c265802b8885f69b8


--

___
Python tracker 

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



[issue42284] The grammar specification is inconsistent with the implementation of Python parser.

2020-11-07 Thread Georg Brandl


Georg Brandl  added the comment:

This grammar specification doesn't contain a full specification of code that 
won't raise SyntaxError. There are several conditions that aren't checked by 
the generated parser, but at a later stage in the compilation process.

While probably possible to express in general, this would make the grammar much 
more complex.  For this example, it would require different definitions of 
`suite`, `stmt`, `simple_stmt`, `compound_stmt` and so on, to track where 
control-flow statements are allowed.  Other definitions need to track 
`nonlocal` and you'd get a combinatorial explosion of productions.

You could propose a PR to add a note somewhere on that page (but on the master 
branch, not 3.6 which is unmaintained).

--
nosy: +georg.brandl

___
Python tracker 

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



[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-11-07 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH
type:  -> behavior

___
Python tracker 

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



[issue41028] Move docs.python.org language and version switcher out of cpython

2020-11-07 Thread Julien Palard


Julien Palard  added the comment:


New changeset ee2549c2ba8bae00f2b2fea8a39c6dfbd1d06520 by Julien Palard in 
branch 'master':
bpo-41028: Doc: Move switchers to docsbuild-scripts. (GH-20969)
https://github.com/python/cpython/commit/ee2549c2ba8bae00f2b2fea8a39c6dfbd1d06520


--

___
Python tracker 

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



[issue42282] Constant folding is skipped in named expressions

2020-11-07 Thread Nick Coghlan


Change by Nick Coghlan :


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

___
Python tracker 

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



[issue42284] The grammar specification is inconsistent with the implementation of Python parser.

2020-11-07 Thread Xinmeng Xia


New submission from Xinmeng Xia :

In full grammar specification of Python 3.6 official documentation (Python 3.6 
official documentation: https://docs.python.org/3.6/reference/grammar.html ), 
we can find a very clear definition on the grammar about the usage of 'break'. 
According to the definition, we can find the following derivation, which 
indicates the keyword 'break' can appear in the block of if statement without 
being nested into a loop block:

%%
# Start symbols for the grammar:
#   single_input is a single interactive statement;

single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE

compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef 
| classdef | decorated | async_stmt

if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]

suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT

simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE

small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | 
global_stmt | nonlocal_stmt | assert_stmt)

flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt

break_stmt: 'break'
%%%

However, the implementation of the Python parser requires the 'break' can only 
be embedded into a loop statement.
See the following example:

Example A(without loop):
>>> compile("if True:break",'','exec')
Traceback (most recent call last):
File "", line 1, in 
File "", line 1
SyntaxError: 'break' outside loop

Example B(with a loop):
>>> compile("while True:\n\tif True:break",'','exec')
 at 0x7f5f4de90b70, file "", line 1>

Similar problems exist between if-statement and keywords: 'continue', 'yield', 
'return', 'nonlocal' in Python 3.6 and later versions.

--
assignee: docs@python
components: Documentation
messages: 380502
nosy: docs@python, xxm
priority: normal
severity: normal
status: open
title: The grammar specification is inconsistent with the implementation of 
Python parser.
type: compile error
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



[issue42283] test_idle is interactive

2020-11-07 Thread Ronald Oussoren


New submission from Ronald Oussoren :

I noticed this on a macOS 11.0.1 box: When I run "python -m test.regrtest 
-uall" the IDLE testsuite is run ('test_idle'), and those tests pop up windows 
and won't make progress until I close those windows.

--
assignee: terry.reedy
components: IDLE
messages: 380501
nosy: ronaldoussoren, terry.reedy
priority: normal
severity: normal
status: open
title: test_idle is interactive
versions: Python 3.10

___
Python tracker 

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



[issue42275] Jupyter Lab Terminals not available (error was No module named 'winpty.cywinpty')

2020-11-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The 'culprit' is that many 3rd party packages have not yet released 'official' 
wheels.  This is unfortunately typical this soon after a new version is 
released.  We are hoping that predictable yearly releases will improve the 
situation.  We will have to wait and see yet.

--
nosy: +terry.reedy
resolution: fixed -> not a bug

___
Python tracker 

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



[issue42222] Modernize integer test/conversion in randrange()

2020-11-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To put what I said another way: both items are mental paper cuts and I see 
benefit to both coredevs and users in getting rid of them.  That is not to say 
'no cost', but that there is a real benefit to be balanced against the real 
cost.

--

___
Python tracker 

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



[issue14791] setup.py only adds /prefix/lib, not /prefix/lib64

2020-11-07 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue42222] Modernize integer test/conversion in randrange()

2020-11-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To me, ValueError("non-integer arg 1 for randrange()") (ValueError('bad type') 
is a bit painful to read.  We do sometime fix such bugs, when not documented, 
in future releases.

Current the doc, "Return a randomly selected element from range(start, stop, 
step). This is equivalent to choice(range(start, stop, step))", implies that 
both accept the same values, which most would expect anyway from the names.  
Being selectively 'generous' in what is accepted is confusing.

For the future: both range and math.factorial raise
TypeError: 'float' object cannot be interpreted as an integer
The consistency is nice.  randrange should say the same after deprecation.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue20543] ** operator does not overflow to inf

2020-11-07 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks, @iritkatriel. Sounds good to me.

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42282] Constant folding is skipped in named expressions

2020-11-07 Thread Nick Coghlan


Change by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue42122] macOS complains about how fonts are accessed

2020-11-07 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm getting a similar warning on a macOS 11 box:

0:06:29 load avg: 1.58 [184/424/1] test_idle
2020-11-07 10:43:37.878 Python[97785:3275468] CoreText note: Client requested 
name ".applesystemuifontmonospaced", it will get Times-Roman rather than the 
intended font. All system UI font access should be through proper APIs such as 
CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-11-07 10:43:37.878 Python[97785:3275468] CoreText note: Set a breakpoint 
on CTFontLogSystemFontNameRequest to debug.
2020-11-07 10:43:37.881 Python[97785:3275468] CoreText note: Client requested 
name ".applesystemuifontmonospaced", it will get Times-Roman rather than the 
intended font. All system UI font access should be through proper APIs such as 
CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].


I'm leaving this issue as closed because the font name is not used in CPython's 
source code. This is an issue with Tcl/Tk.

--

___
Python tracker 

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



[issue42281] Inconsistent ProcessPoolExecutor behaviour on macOS between 3.7 and 3.8/9

2020-11-07 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

In 3.8 the spawn method for multiprocessing changed from "fork" to "spawn" (see 
https://docs.python.org/3/whatsnew/3.8.html#multiprocessing).

A side effect of this is that the module gets executed again in the child 
processes (the same as on Windows).

The reason for this change is that multiple higher level APIs, some of which 
used by the Python implementation, are are not safe to use with the "fork" 
spawning strategy (as in: causing crashing when using the fork strategy).

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> pending

___
Python tracker 

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