[issue42348] Language Reference: Set items

2020-11-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Raymond's last point is that set objects should be immutably hashable.  I would 
say 'must be' in the sense that mutably hashable objects break sets in various 
ways, starting with uniqueness.  If we were to make a change, I think the 
replacement should be 'immutably hashable'

'unique objects' would also need qualification.  As is, one might reasonably 
expect. for instance, {1+0j, 1.0, 1} to have 3 elements rather than 1.  It is 
really 'objects unique up to equality', where equality may or may not be by 
identity.

However, I am inclined to agree with Raymond that we should stick to the 
current easily read sentence.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42338] Enable Debug Build For Python Native Modules in Windows, with Visual Studio Toolchain

2020-11-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This tracker is for developing patches to the cpython repository.  Questions 
are better asked on the python-list and occasionally the pydev mailing lists.  
I am leaving this open in case there is a doc change request lurking somewhere.

--
components: +Windows
nosy: +paul.moore, steve.dower, terry.reedy, 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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread Daniel Hrisca


Daniel Hrisca  added the comment:

Under the hood perf_counter_ns already uses the two winapi calls (see 
https://github.com/python/cpython/blob/41761933c1c30bb6003b65eef1ba23a83db4eae4/Python/pytime.c#L970)
 just that it also sets up a static variable as a time origin which makes it 
process-wide instead of system-wide

--

___
Python tracker 

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



[issue42325] UnicodeDecodeError executing ./setup.py during build

2020-11-13 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

I got a similar issue on Arch Linux - see issue42351.

--
nosy: +yan12125

___
Python tracker 

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



[issue42351] Setup.py: UnicodeDecodeError in grep_headers_for

2020-11-13 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

I can also confirm the issue on our Arch Linux server [1]. The problematic file 
is also /usr/include/OMX_Other.h.

Looks like it is a regression from https://github.com/python/cpython/pull/22855 
(https://bugs.python.org/issue41100). Ronald Oussoren, mind to have a look?

[1] 
https://build.archlinuxcn.org/~imlonghao/log/python-git/2020-11-14T01:17:02.html

--
nosy: +ronaldoussoren, yan12125

___
Python tracker 

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



[issue27578] inspect.findsource raises exception with empty __init__.py

2020-11-13 Thread kernc


kernc  added the comment:

The proposed patch doesn't break any interfaces. 
`inspect.getsource/.getsourcelines()` still raise `OSError` if the source is 
unretrievable. `linecache.getlines()` is undocumented, but the change retains 
perfect compatibility with *docstrings* of both `linecache.getlines()` which is 
affected and `linecache.updatecache()` which is touched.

--

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-13 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yash, this is specifically a macOS issue.  Printing astral chars in 
tkinter/IDLE on Windows and Linux has 'worked' (details not important) for over 
a year.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42302] [Turtle] Add clockwise and anticlockwise method as alias to right and left

2020-11-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'Clockwise' and 'counterclockwise'* refer to an object either continuously 
spinning on an axis or possibly moving in a circle.  An object in linear motion 
turns right or left.  This is especially true for an organism or object with 
left or right sides#, and this is the model for turtle and logo.  Where 
relevant (such as planer maze theory), I believe same is true in math and 
physics.

* Counterclockwise and anticlockwise are the American and British terms 
respectively.  American English is the standard for Python, but using either 
term would confuse children barely coping with the other.  Either is a mouthful 
to say.

# Since people on a ship can face any which way, 'starboard' and 'port' are 
used to unambiguiously refer to the right and left *of the ship*.

Does anyone still object to closing this?

PS Ravi:  When responding to email, please delete the quoted text (except maybe 
for a line or two) as it is redundant noise when your response is posted.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue24886] open fails randomly on AIX

2020-11-13 Thread Inada Naoki


Change by Inada Naoki :


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



[issue42309] BUILD: AIX-64-bit segmentation fault

2020-11-13 Thread Kevin


Kevin  added the comment:

I have not encountered this problem when building Python 3.10 on AIX and PASE 
with GCC 6.3.

--
nosy: +kadler

___
Python tracker 

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



[issue24886] open fails randomly on AIX

2020-11-13 Thread Kevin


Kevin  added the comment:

Given that the AIX bug has long been fixed and Python 2.7 is EOL we can 
probably close this bug.

--
nosy: +kadler

___
Python tracker 

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



[issue24046] Incomplete build on AIX

2020-11-13 Thread Kevin


Kevin  added the comment:

Looks like RAND_egd was made optional in https://bugs.python.org/issue21356

Can this issue be closed?

--
nosy: +kadler

___
Python tracker 

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



[issue24501] configure does not find (n)curses in /usr/local/libs

2020-11-13 Thread Kevin


Kevin  added the comment:

There error indicates it can't find ncurses.h

configure:14223: xlc_r -c -qmaxmem=-1 -DSYSV -D_AIX -D_AIX71 -D_ALL_SOURCE 
-DFUNCPROTO=15 -O -I/usr/local/include  -I/usr/include/ncursesw conftest.c >&5
"conftest.c", line 311.10: 1506-296 (S) #include file  not found.

Are you sure you don't need -I/usr/include/ncurses instead of -I/usr/include?

--
nosy: +kadler

___
Python tracker 

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for the quick fix. It works!

--

___
Python tracker 

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



[issue17454] ld_so_aix not used when linking c++ (scipy)

2020-11-13 Thread Kevin


Kevin  added the comment:

This was fixed by https://github.com/python/cpython/pull/10437

--
nosy: +kadler

___
Python tracker 

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



[issue42293] Installation of pyinstaller in Windows fails with utf8 error

2020-11-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A 'crash' is when the program hangs or stops unexpectedly *without* an 
Exception and message.

Lib/site-packages/sitecustomize.py is an optional added module.
https://docs.python.org/3/library/site.html#index-5
Apparently, attempted installation of pyinstaller resulted in an attempt to add 
it.  Or it was later attempting to read a badly written file, and removed it 
when cleaning up.

In any case, this appears to be a 3rd party bug that should be reported on the 
pypa/pip tracker.  Paul, are you involved with pip?  If so, can you add 
anything?

--
nosy: +paul.moore, terry.reedy
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread Eryk Sun


Eryk Sun  added the comment:

> QPC typically has a frequency of 1e7, 

Never mind. Apparently with some combinations of chipset, processor, and 
Windows version, the QPC frequency runs far beyond the 1-10 MHz range. I 
thought Windows divided by 1024 instead of letting it run in the GHz range, but 
apparently not from what I see in search results. I misread "*in many cases*, 
QueryPerformanceFrequency returns the TSC frequency divided by 1024".

--

___
Python tracker 

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



[issue42290] Display of Unicode strings with bidi characters

2020-11-13 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Unicode inconsistent display after concencated -> Display of Unicode 
strings with bidi characters

___
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-13 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Xia, when saying 'unexpected', one usually needs to also say what was expected. 
 When discussing mixed direction chars, we need to be especially careful in 
describing what we see with different terminals, different browsers, and 
different OSes.

Steven: On Windows, I see the same thing: "Daleth 1" prints as that in both 
IDLE's Shell and Python's REPL in Command Prompt (with D a replacement box in 
the latter) but is reversed here 'ܯ1' in Firefox (and the same in Microsoft 
Edge.  But, I just discovered, the two browsers (and Notepad and LibreOffice 
Writer and likely other text editors) treat runs of latin digits specially: 
"Daleth a" pastes in that order, 'ܯa', and "Daleth 1 2" pastes as "1 2 Daleth", 
'ܯ12'.

The block, but not the individual digits, is reversed.  This allows R2L writers 
to use what are now the global digits.  In Arabic, numbers are written and read 
R 2 L low order to high.  So Europeans used to writing and reading L 2 R high 
to low kept the same order.  Perhaps the bidi property of the digits in the 
unicode datebase is different from that of other latin chars.

It seems that '=' is also bidirectional, but properly not treated as digit.  
"Daleth = 1" is reversed in both browsers and text editors to read 'Daleth' 
'equals' 'one' when read right to left.

The general rule is that blocks of same direction chars are written 
appropriately as encountered.  It seems that the classification of some 
characters depends on the context.  The following is as expected,
>>> 'ab'+chr(1837)+chr(1838)+chr(1839)+'cd'
'abܭܮܯcd'
with the R2L triplet reversed.

In any case, Steven is correct that Python correctly stores chars in the  order 
given and that there is no Python bug.

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



[issue42336] Make PCbuild/build.bat build x64 by default

2020-11-13 Thread Steve Dower


Steve Dower  added the comment:

I hope you'll find that PR suitable ambitious :)

It would really be nice to have proper Powershell scripts for these, but that 
would be a more significant rewrite (and probably require changing argument 
names...). I'm not *that* ambitious.

--

___
Python tracker 

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



[issue42336] Make PCbuild/build.bat build x64 by default

2020-11-13 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread Eryk Sun


Eryk Sun  added the comment:

> suggest to use time.perf_counter_ns() instead of time.perf_counter() 
> for best precision.

QPC typically has a frequency of 1e7, which requires 24 bits for the fraction 
of a second. So a system can be up for years before the 53-bit precision of a 
float is an issue. What am I missing?

--
nosy: +eryksun

___
Python tracker 

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



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2020-11-13 Thread Brett Cannon


Change by Brett Cannon :


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



[issue42131] [zipimport] Update zipimport to use specs

2020-11-13 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset d2e94bb0848e04a90efa51be401f0ce8a9e252f2 by Brett Cannon in 
branch 'master':
bpo-42131: Add PEP 451-related methods to zipimport (GH-23187)
https://github.com/python/cpython/commit/d2e94bb0848e04a90efa51be401f0ce8a9e252f2


--

___
Python tracker 

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



[issue32803] smtplib: LMTP broken in the case of multiple RCPT

2020-11-13 Thread Jacob Middag


Jacob Middag  added the comment:

It would be nice if someone could take a look.

--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread miss-islington


miss-islington  added the comment:


New changeset faadc52e755cdb316a53f3db5aa11cb97f1c4b87 by Miss Islington (bot) 
in branch '3.9':
bpo-40754: Adds _testinternalcapi to Windows installer for test suite (GH-23271)
https://github.com/python/cpython/commit/faadc52e755cdb316a53f3db5aa11cb97f1c4b87


--

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread miss-islington


miss-islington  added the comment:


New changeset 8a4557240b98c322d611bfbba3ea51eac3fb841a by Miss Islington (bot) 
in branch '3.8':
bpo-40754: Adds _testinternalcapi to Windows installer for test suite (GH-23271)
https://github.com/python/cpython/commit/8a4557240b98c322d611bfbba3ea51eac3fb841a


--
nosy: +miss-islington

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
nosy:  -miss-islington
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



[issue42339] official embedded Python fails to import certain modules

2020-11-13 Thread Steve Dower


Steve Dower  added the comment:

Sorry about the PR mess - copied the wrong issue number down, though I am 
looking at this one right now.

My suspicion is something in the newer vcruntime140_1.dll is to blame - does it 
work with Python 3.9?

You might need to update to KB3118401 [1], though I wouldn't have thought it 
was necessary (plus it should auto-update once you add the earlier version). It 
would be good to know if that's the case.

[1]: https://support.microsoft.com/kb/3118401

--

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22170
pull_request: https://github.com/python/cpython/pull/23274

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +22169
pull_request: https://github.com/python/cpython/pull/23273

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9b6934230c35e24d8582ea8c58456fa8eab72ae2 by Steve Dower in branch 
'master':
bpo-40754: Adds _testinternalcapi to Windows installer for test suite (GH-23271)
https://github.com/python/cpython/commit/9b6934230c35e24d8582ea8c58456fa8eab72ae2


--

___
Python tracker 

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



[issue42339] official embedded Python fails to import certain modules

2020-11-13 Thread Steve Dower


Change by Steve Dower :


--
pull_requests:  -22167

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread Daniel Hrisca


Daniel Hrisca  added the comment:

That would be perfect and would help a lot with timings/synchronization across 
multiple processes.

Which Pyhton version will get this fix?

--

___
Python tracker 

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



[issue40754] Test installers before releasing (ModuleNotFoundErrors)

2020-11-13 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue42339] official embedded Python fails to import certain modules

2020-11-13 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

Since I added time.perf_counter_ns() to Python 3.7, it would be acceptable to 
reduce the "t0" variable and suggest to use time.perf_counter_ns() instead of 
time.perf_counter() for best precision.

--

___
Python tracker 

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



[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-13 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-13 Thread Trey Hunner


New submission from Trey Hunner :

The below code worked on Python 3.5, 3.6, 3.7, and 3.8, but it now crashes on 
Python 3.9.


from contextlib import contextmanager


@contextmanager
def open_files(names):
yield names  # This would actually return file objects


with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
print(first, rest)


The error shown is:

with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
 ^
SyntaxError: invalid syntax

--
messages: 380932
nosy: trey
priority: normal
severity: normal
status: open
title: Tuple unpacking with * causes SyntaxError in with ... as ...
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



[issue42348] Language Reference: Set items

2020-11-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I recommend leaving the text as is, and possibly creating a new FAQ entry 
discussing the relationship between immutability and hashability (something 
that I consider to be an intermediate or advanced topic).

Other thought:

* The set discussion should remain parallel that for mappings (a few 
paragraphs) after.  That text also discusses immutability

* We've never had a user incident regarding this text, so there is no actual 
evidence that this current wording is confusing anyone.

* It is common for users to equate hashability with immutability, so I think 
the current wording is reasonable.  My experience with users indicate that 
"hashable" is more cryptic than "immutable" because the former implies a 
knowledge of how hash tables work.

* It's easy for us thinking we're helping by making precise distinctions but 
have the actual effect of making the docs more opaque.  That is why first-aid 
books say "bruise" instead of "subdermal hematoma" :-)

* The word "immutable" is a reasonable first approximation that doesn't require 
knowledge of hash table mechanics.  For the most part, it is how everyday users 
think about dict keys and set elements. 

* That approximation is useful because a fuller discussion would say that if 
__hash__ is defined, it should do so on fields that don't mutate.

--

___
Python tracker 

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



[issue41552] uuid.uuid1() on certain Macs does not generate unique IDs

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

the most recent UUID implementation on opensource.apple.com: 
https://opensource.apple.com/source/Libc/Libc-1353.100.2/uuid/uuidsrc/gen_uuid.c.auto.html

The implementation of get_node_id() doesn't ignore the iBridge interface, which 
means uuid_generate_time(3) could run into this issue (and because of that, 
Python's uuid module)

I've filed an issue with Apple about this: FB889

Note that switching to libuuid from util-linux wouldn't help here, that also 
doesn't ignore the iBridge interface.

I'm tempted to close this issue as "3th-party" because this is bug in the 
system implementation of uuid_generate_time.

--

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2020-11-13 Thread Daniel Hrisca


Daniel Hrisca  added the comment:

I'm actually surprised that this problem gets so little interest. It's probably 
so obscure that most people don't even realize it.

Why isn't it implemented using winapi calls for the windows platform?

I took inspiration from this SO thread 
https://stackoverflow.com/questions/56502111/should-time-perf-counter-be-consistent-across-processes-in-python-on-windows
 
and came up with this function for 64 bit Python (a few more lines would be 
needed for error checking)

#include 
static PyObject* perf_counter(PyObject* self, PyObject* args)
{
PyObject* ret;

QueryPerformanceFrequency(lpFrequency);
QueryPerformanceCounter(lpPerformanceCount);

ret = PyFloat_FromDouble(((double) lpPerformanceCount->QuadPart ) / 
lpFrequency->QuadPart);

return ret;
}

--
nosy: +danielhrisca

___
Python tracker 

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



[issue42353] Proposal: re.prefixmatch method (alias for re.match)

2020-11-13 Thread Gregory P. Smith


New submission from Gregory P. Smith :

A well known anti-pattern in Python is use of re.match when you meant to use 
re.search.

re.fullmatch was added in 3.4 via https://bugs.python.org/issue16203 for 
similar reasons.

re.prefixmatch would be similar: we want the re.match behavior, but want the 
code to be obvious about its intent.  This documents the implicit ^ in the name.

The goal would be to allow linters to ultimately flag re.match as the 
anti-pattern when in 3.10+ mode.  Asking people to use re.prefixmatch or 
re.search instead.

This would help avoid bugs where people mean re.search but write re.match.

The implementation is trivial.

This is **not** a decision to deprecate the widely used in 25 years worth of 
code's re.match name.  That'd be painful and is unlikely to be worth doing 
without spreading it over a 8+ year timeline.

--
components: Library (Lib)
messages: 380928
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Proposal: re.prefixmatch method (alias for re.match)
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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread Eryk Sun


Change by Eryk Sun :


--
priority: release blocker -> 
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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread Eryk Sun


Eryk Sun  added the comment:

> That sounds like a micro-optimization which is not worth it.

In the back of my mind I was also thinking to generalize the behavior at 
runtime whenever a signal is tripped by a non-Python thread (e.g. a thread 
created by an extension module or ctypes), instead of special-casing Windows. 

To examine this, I created a C library in Linux that defines a test() function 
that creates two threads via pthread_create(). The first thread sleeps for 10 
seconds, and the second thread sleeps for 5 seconds and then calls 
pthread_kill() to send a SIGINT to the first thread. In 3.8, calling the test() 
function via ctypes followed by executing an infinite loop will interrupt the 
loop with a KeyboardInterrupt as soon as the second thread sends SIGINT. But in 
3.10, the loop never gets interrupted because the C signal handler isn't called 
on the main thread, so eval_breaker never gets set.

--
keywords: +patch -3.9regression
priority:  -> release blocker
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



[issue37737] mmap module track anonymous page on macOS

2020-11-13 Thread Ronald Oussoren


New submission from Ronald Oussoren :

I've closed the PR because I don't think this is a useful feature.

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



[issue41611] IDLE: problems with completions on Mac

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

It looks like the lack of completions in msg375769 is a problem with Tk 8.6.8 
as used by the python.org installers.

I have a build of master with Tk 8.6.10 on my DTK system and with that 
Edit->Show completions works in a shell window.

However: Ctrl+s does not show the completion pop-up, even though the "Edit" 
button in the application menu flashes (which indicates that Ctrl+s is 
recognised as a keyboard shortcut).  Just using Tab for completion works fine 
though (shows the completion pop-up).

---

I did get a similar traceback to the one in msg375764 once, this is without 
using multiprocessing. I haven't been able to reproduce this yet.

python3.10 -m idlelib  
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py",
 line 1884, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/idlelib/autocomplete_w.py",
 line 248, in winconfig_event
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py",
 line 1290, in winfo_width
self.tk.call('winfo', 'width', self._w))
_tkinter.TclError: bad window path name 
".!listedtoplevel.!frame.text.!toplevel8"

--

___
Python tracker 

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



[issue40485] Provide an abstraction for a select-able Event

2020-11-13 Thread Christian Heimes


Christian Heimes  added the comment:

os.eventfd() has landed in Python 3.10.

--
nosy: +christian.heimes
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

> And yet one question. What do you see if you print '\udcf0\udc9f\udc98\udc80' 
> in IDLE?

This prints a smiley emoji, likewise for printing chr(128516)

--

___
Python tracker 

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



[issue41001] Provide wrapper for eventfd

2020-11-13 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset cd9fed6afba6f3ad2e7ef723501c739551a95fa8 by Christian Heimes in 
branch 'master':
bpo-41001: Add os.eventfd() (#20930)
https://github.com/python/cpython/commit/cd9fed6afba6f3ad2e7ef723501c739551a95fa8


--

___
Python tracker 

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



[issue42352] A string representation of slice objects with colon syntax

2020-11-13 Thread Ross Barnowski


New submission from Ross Barnowski :

It would be nice if there were a way to get a string representation of a slice 
object in extended indexing syntax, e.g.

```
>>> myslice = slice(None, None, 2)
>>> print(myslice)
'::2'
```

One motivating use-case is in descriptive error messages, e.g.

```
TypeError(f"Can't slice {myobj}, try list({myobj})[{myslice}]")
```

In this case, it is much more natural for `myslice` to use the extended 
indexing syntax than the slice str/repr.

Perhaps this could be done via __str__, or if that is too big a change, maybe 
via __format__ e.g. `f"{myslice:asidx}"`

It's simple enough to write a conversion function, but this feels like a 
feature that would fit best upstream. I searched the issue tracker, PRs on 
GitHub, and the Python documentation and didn't see any related 
issues/PRs/articles.

xref: https://github.com/networkx/networkx/pull/4304

--
messages: 380921
nosy: rossbar
priority: normal
severity: normal
status: open
title: A string representation of slice objects with colon syntax
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



[issue41001] Provide wrapper for eventfd

2020-11-13 Thread Christian Heimes


Change by Christian Heimes :


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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And yet one question. What do you see if you print '\udcf0\udc9f\udc98\udc80' 
in IDLE?

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can ignore msg380917. It was written before I read msg380908. Now I have 
the needed information. Thank you.

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

When I assign root.clipboard_get() to "v" I get:

>>> print(ascii(v))
'\udced\udca0\udcbd\udced\udcb8\udc84'
>>> print(v)
??

This is with Tk 8.6.10.

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Well, try copy 😀 (or other text with color emoji) to clipboard and run the 
following code:

import tkinter
root = tkinter.Tk()
print(ascii(root.clipboard_get()))

--

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 4defeb007195d2d17ea404b0b6291d1d233010f4 by Miss Islington (bot) 
in branch '3.9':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) 
(GH-23270)
https://github.com/python/cpython/commit/4defeb007195d2d17ea404b0b6291d1d233010f4


--

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset cb2b2035ca752529755440990c4073d5164e80df by Miss Islington (bot) 
in branch '3.8':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) 
(GH-23269)
https://github.com/python/cpython/commit/cb2b2035ca752529755440990c4073d5164e80df


--

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22166
pull_request: https://github.com/python/cpython/pull/23270

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +22165
pull_request: https://github.com/python/cpython/pull/23269

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset bbeb2d266d6fc1ca9778726d0397d9d6f7a946e3 by Jürgen Gmach in 
branch 'master':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264)
https://github.com/python/cpython/commit/bbeb2d266d6fc1ca9778726d0397d9d6f7a946e3


--

___
Python tracker 

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



[issue42350] Calling os.fork() at Python exit logs: AttributeError: 'NoneType' object has no attribute '_at_fork_reinit'

2020-11-13 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42351] Setup.py: UnicodeDecodeError in grep_headers_for

2020-11-13 Thread E. Paine


New submission from E. Paine :

When compiling the master branch (i.e. running 'make'), I get a 
UnicodeDecodeError as follows:
Traceback (most recent call last):
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 2619, in 

main()
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 2589, in 
main
setup(# PyPI Metadata (PEP 301)
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/core.py", line 
148, in setup
dist.run_commands()
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/dist.py", line 
966, in run_commands
self.run_command(cmd)
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/dist.py", line 
985, in run_command
cmd_obj.run()
  File 
"/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/command/build.py", 
line 135, in run
self.run_command(cmd_name)
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/cmd.py", line 
313, in run_command
self.distribution.run_command(command)
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/dist.py", line 
985, in run_command
cmd_obj.run()
  File 
"/home/elisha/Documents/Python/cp0/cpython/Lib/distutils/command/build_ext.py", 
line 340, in run
self.build_extensions()
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 471, in 
build_extensions
self.detect_modules()
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 1825, in 
detect_modules
self.detect_ctypes()
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 2205, in 
detect_ctypes
if grep_headers_for('ffi_prep_cif_var', ffi_headers):
  File "/home/elisha/Documents/Python/cp0/cpython/./setup.py", line 246, in 
grep_headers_for
if function in f.read():
  File "/home/elisha/Documents/Python/cp0/cpython/Lib/codecs.py", line 322, in 
decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 4210: 
invalid start byte

The problematic file it is trying to read is /usr/include/OMX_Other.h which is 
part of the libomxil-bellagio package (a copy of this package can be downloaded 
from 
https://www.archlinux.org/packages/extra/x86_64/libomxil-bellagio/download/). 
More specifically, there are several characters in the comments which cannot be 
decoded correctly (the first of these is on line 93).

The fix is a very simple one and is just to add errors='replace' to line 244 of 
setup.py (I cannot see this having any ill-effects).

I couldn't find who to nosy for this so apologies about that.

--
components: Build
messages: 380913
nosy: epaine
priority: normal
severity: normal
status: open
title: Setup.py: UnicodeDecodeError in grep_headers_for
type: compile error
versions: Python 3.10, 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



[issue42350] Calling os.fork() at Python exit logs: AttributeError: 'NoneType' object has no attribute '_at_fork_reinit'

2020-11-13 Thread STINNER Victor


New submission from STINNER Victor :

The following code logs an error:
---
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/threading.py", line 1508, in 
_after_fork
thread._reset_internal_locks(True)
  File "/home/vstinner/python/master/Lib/threading.py", line 847, in 
_reset_internal_locks
self._tstate_lock._at_fork_reinit()
AttributeError: 'NoneType' object has no attribute '_at_fork_reinit'
---

Code:
---
#!/usr/bin/python3
import atexit
import subprocess


def preexec():
pass


def exit_handler():
proc = subprocess.Popen(
["pwd"],
preexec_fn=preexec,
)
proc.communicate()


if __name__ == "__main__":
atexit.register(exit_handler)
---


It is a regression caused by the following bpo-40089 fix:

commit 87255be6964979b5abdc4b9dcf81cdcfdad6e753
Author: Victor Stinner 
Date:   Tue Apr 7 23:11:49 2020 +0200

bpo-40089: Add _at_fork_reinit() method to locks (GH-19195)

--
components: Library (Lib)
messages: 380912
nosy: vstinner
priority: normal
severity: normal
status: open
title: Calling os.fork() at Python exit logs: AttributeError: 'NoneType' object 
has no attribute '_at_fork_reinit'
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue42349] Compiler front-end produces a broken CFG

2020-11-13 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue42349] Compiler front-end produces a broken CFG

2020-11-13 Thread Mark Shannon


New submission from Mark Shannon :

The front-end of the bytecode compiler produces a broken CFG.
A number of "basic-block"s have terminators before their end.
This makes the back-end optimizations unsafe as they rely of a well-formed CFG.

The fix is simple. Insert a check that the CFG is well-formed before doing any 
optimizations, then fix up the front-end.

Once done, we can be more aggressive with optimizations without worrying that 
things will break for no apparent reason.

--
assignee: Mark.Shannon
messages: 380911
nosy: BTaskaya, Mark.Shannon, pablogsal, yselivanov
priority: normal
severity: normal
status: open
title: Compiler front-end produces a broken CFG
type: behavior

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

BTW. The unicodeFromTclStringAndSize() basically undoes the special treatment 
of \0 in Modified UTF-8 [1]. That page says that all known implementation of 
MUTF-8 treat surrogate pairs the same as CESU-8 [2], which is UTF-8 with 
characters outside of the BMP encoded as surrogate pairs which are then 
converted to UTF-8.

Neither encoding is currently supported by Python.

[1] https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8
[2] https://en.wikipedia.org/wiki/CESU-8

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@Pixmew: I get this error with Tk 8.6.10 on macOS 11. With Tk 8.6.8 on macOS 
10.15 (from the python.org installer) I get the behaviour described in 
msg380906.

8.6.10 is the version of Tk we'd like to switch to for the "universal2", it is 
the latest release in the 8.6.x branch and contains numerous bug fixes.

The "Intel" installers (the ones currently on Python.org) we'll continue to use 
Tk 8.6.8 due to build issues on macOS 10.9 with newer Tk versions.

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

With 8.6.10:

>>> print(ascii("😀")) raises the SyntaxError mentioned earlier
>>> print(ascii(input())) works and prints:
'\udced\udca0\udcbd\udced\udcb8\udc84'

In an editor window I don't get spurious text, but syntax colouring is a bit 
off: The text after the closing quote is coloured as if it is inside the string 
literal. That continues for the characters on the next line

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Yash Shete

Yash Shete  added the comment:

Well for me in Python 3.9.0
print("😀")   prints 😀  and 
 print(ascii("😀"))   prints '\U0001f600'

It does not Raises error "utf-8' codec can't encode characters in position 
7-12: surrogates not allowed." as you are suggesting

--
nosy: +Pixmew

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-13 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

With 8.6.8 both "hang", in that the Shell window no longer accepts input. I've 
checked that ``print(input())`` works when I don't use an emoji. 

Interestingly enough, pasting ``print(ascii("😀"))`` into an edit window does 
work, I can continue editing, but the display is messed up. It looks like:

   print(ascii("😀"))print(ascii("

But with the first two identifiers coloured and the two other identifiers 
black. Saving the file results in the expected file contents.

--

___
Python tracker 

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



[issue42348] Language Reference: Set items

2020-11-13 Thread Yash Shete


Yash Shete  added the comment:

Should it be "These represents hashable objects"

--
nosy: +Pixmew

___
Python tracker 

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

Probably the implementation focused on static typing, not runtime checking.

Can you come up with a PR for a fix?

--
stage:  -> needs patch
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 0f4dd87a31130b245ec4c6ded9fd6f247e700c0d by Dong-hee Na in branch 
'3.9':
[3.9] bpo-42042: Use ids attribute instead of names attribute (GH-22739) 
(GH-23265)
https://github.com/python/cpython/commit/0f4dd87a31130b245ec4c6ded9fd6f247e700c0d


--

___
Python tracker 

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



[issue42348] Language Reference: Set items

2020-11-13 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

The data types section of the language reference 
(https://docs.python.org/3.10/reference/datamodel.html#the-standard-type-hierarchy)
 has this description directly under the Set type (which has 2 childs, set and 
frozenset). 

> These represent unordered, finite sets of unique, immutable objects.

I feel like this wording is a bit confusing, considering the items doesn't have 
to be immutable at all. Can we replace this with hashable?

--
messages: 380901
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Language Reference: Set items

___
Python tracker 

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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, I hope that this issue it's really fixed ;-) Thanks again Joshua Root.

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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ec306a2fd91d8b961b2a80c080dd2262bb17d862 by Victor Stinner in 
branch '3.9':
bpo-41617: Add _Py__has_builtin() macro (GH-23260) (GH-23262)
https://github.com/python/cpython/commit/ec306a2fd91d8b961b2a80c080dd2262bb17d862


--

___
Python tracker 

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



[issue42348] Language Reference: Set items

2020-11-13 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, rhettinger

___
Python tracker 

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



[issue40968] urllib does not send http/1.1 ALPN extension

2020-11-13 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f97406be4c0a02c1501c7ab8bc8ef3850eddb962 by Christian Heimes in 
branch 'master':
bpo-40968: Send http/1.1 ALPN extension (#20959)
https://github.com/python/cpython/commit/f97406be4c0a02c1501c7ab8bc8ef3850eddb962


--

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread miss-islington


miss-islington  added the comment:


New changeset 5ad468d4a8cfeb8a320659016964c23735c12a07 by Miss Islington (bot) 
in branch '3.8':
bpo-42042: Use ids attribute instead of names attribute (GH-22739)
https://github.com/python/cpython/commit/5ad468d4a8cfeb8a320659016964c23735c12a07


--

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +lukasz.langa
versions: +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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +22162
pull_request: https://github.com/python/cpython/pull/23265

___
Python tracker 

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



[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

Thanks for your feedback. I created a PR on github.

--
keywords: +patch
message_count: 2.0 -> 3.0
pull_requests: +22161
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23264

___
Python tracker 

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



[issue38914] Clarify wording for warning message when checking a package

2020-11-13 Thread Jürgen Gmach

Change by Jürgen Gmach :


--
pull_requests: +22160
pull_request: https://github.com/python/cpython/pull/23264

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 09490a109faaee9cc393b52742a8575c116c56ba by Dong-hee Na in branch 
'master':
bpo-42042: Use ids attribute instead of names attribute (GH-22739)
https://github.com/python/cpython/commit/09490a109faaee9cc393b52742a8575c116c56ba


--

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-11-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +22159
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23263

___
Python tracker 

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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22158
pull_request: https://github.com/python/cpython/pull/23262

___
Python tracker 

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



[issue42347] loop.call_exception_handler documentation is lacking

2020-11-13 Thread Ash Holland


New submission from Ash Holland :

The call_exception_handler documentation lists seven permissible context keys, 
but the docstring lists nine, and there are two keys referred to in the 
default_exception_handler implementation that aren't listed in either.

The docstring (but not the documentation) mentions "task" ("Task instance") and 
"asyncgen" ("Asynchronous generator that caused the exception."), though at 
least "asyncgen" doesn't appear to be used in any exception handler in stdlib 
as far as I can tell. No documentation mentions "source_traceback" or 
"handle_traceback", but they're used by the default exception handler and are 
also provided by e.g. aiohttp: 
https://github.com/aio-libs/aiohttp/blob/a8d9ec3f1667463e80545b1cacc7833d1ff305e9/aiohttp/client_reqrep.py#L750

--
assignee: docs@python
components: Documentation, asyncio
messages: 380895
nosy: asvetlov, docs@python, sorrel, yselivanov
priority: normal
severity: normal
status: open
title: loop.call_exception_handler documentation is lacking
type: enhancement

___
Python tracker 

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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b3b98082c5431e77c64cab2c85525a804436b505 by Victor Stinner in 
branch 'master':
bpo-41617: Add _Py__has_builtin() macro (GH-23260)
https://github.com/python/cpython/commit/b3b98082c5431e77c64cab2c85525a804436b505


--

___
Python tracker 

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +3.9regression -patch

___
Python tracker 

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

> This code cannot be interrupted with ^C on Windows (e.g. in the REPL)

I tested manually: it's now fixed in 3.9 and master branches.

Thanks for the bug report Guido.


Signal handling is hard. Threads + signals is worse! :-) I modified 
_PyEval_SignalReceived() to always set eval_breaker to 1. See comments of my 
commit for the long rationale ;-)


If someone knows how to write an automated test for that on Windows, please 
create a PR and open a new issue ;-)

--
priority: release blocker -> 
resolution:  -> fixed
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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

> SIGNAL_PENDING_CALLS() is called on a Python thread via signal.raise_signal() 
> or _thread.interrupt_main() / PyErr_SetInterrupt(). If you'd rather keep the 
> COMPUTE_EVAL_BREAKER() call in that case, the console control-event case can 
> be distinguished via PyGILState_GetThisThreadState(). It returns NULL if 
> there's no thread state, i.e. WINAPI TlsGetValue returns NULL.

That sounds like a micro-optimization which is not worth it. The code is 
already quite complicated. I don't think that it's a big deal to call 
eval_frame_handle_pending() *once* when a signal is received whereas the 
"current" Python thread cannot handle it. This function is quite simple: when 
there is no nothing to do, it only reads 3 atomic variable and one tstate 
attribute. It's cheap.

--

___
Python tracker 

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue42346] [subinterpreters] Deny os.fork() in subinterpreters?

2020-11-13 Thread STINNER Victor


New submission from STINNER Victor :

_PyInterpreterState_DeleteExceptMain() contains the following check:

PyThreadState *tstate = _PyThreadState_Swap(gilstate, NULL);
if (tstate != NULL && tstate->interp != runtime->interpreters->main) {
return _PyStatus_ERR("not main interpreter");
}

os.fork() is allow in subinterpreters and PyOS_AfterFork_Child() doesn't seem 
to update runtime->interpreters->main.

Either we should update runtime->interpreters->main after fork in the child 
process, or os.fork() should be denied in subinterpreters.

In bpo-37266, I denied the creation of daemon threads in subinterpreters. But I 
had to revert this change: see bpo-40234.

--
components: Subinterpreters
messages: 380891
nosy: vstinner
priority: normal
severity: normal
status: open
title: [subinterpreters] Deny os.fork() in subinterpreters?
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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

See also "Removal of _Py_ForgetReference from public header in 3.9 issue" 
thread on python-dev list:
https://mail.python.org/archives/list/python-...@python.org/thread/CQYVR7TZZITURBZKVWIEOBGF343GI52W/#CQYVR7TZZITURBZKVWIEOBGF343GI52W

And "Re: [Python-Dev] Removal of _Py_ForgetReference from public header in 3.9 
issue" thread on capi-sig list:
https://mail.python.org/archives/list/capi-...@python.org/thread/4EOCN7P4HI56GQ74FY3TMIKDBIPGKL2G/

--

___
Python tracker 

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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Unfortunately the patch ultimately committed did not fix the build there. 
> Clang reports its version as "Apple LLVM version 4.2 (clang-425.0.28) (based 
> on LLVM 3.2svn)". __clang_major__ is 4 and __clang_minor__ is 2.

Oh... I wrote PR 23260 which is based on your original PR 21942. I added a new 
_Py__has_builtin() macro rather than defining a __has_builtin() which always 
returns 0.

--

___
Python tracker 

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-13 Thread Dominik V.


New submission from Dominik V. :

[PEP 
586](https://www.python.org/dev/peps/pep-0586/#shortening-unions-of-literals) 
specifies that

Literal[v1, v2, v3]

is equivalent to

Union[Literal[v1], Literal[v2], Literal[v3]]

Since the equality of Unions doesn't take into account the order of arguments, 
Literals parametrized with multiple arguments should not be order dependent 
either. However they seem to:

>>> Literal[1, 2] == Literal[2, 1]
False

Compare with the equivalent form:

>>> Union[Literal[1], Literal[2]] == Union[Literal[2], Literal[1]]
True

In addition to that, the PEP specifies that nested Literals should be 
equivalent to the flattened version 
(https://www.python.org/dev/peps/pep-0586/#legal-parameters-for-literal-at-type-check-time).
 This section is titled "Legal parameters for Literal at type check time" but 
since the PEP doesn't specify runtime behavior differently, I think it makes 
sense to assume it is the same. It seems to be different though:

>>> Literal[Literal[1, 2], 3]
typing.Literal[typing.Literal[1, 2], 3]
>>> Literal[Literal[1, 2], 3] == Literal[1, 2, 3]
False

Also the flattening follows from the above definition `Literal[v1, v2, v3] == 
Union[Literal[v1], Literal[v2], Literal[v3]]` and the fact that Unions are 
flattened.

--
messages: 380888
nosy: Dominik V.
priority: normal
severity: normal
status: open
title: Equality of typing.Literal depends on the order of arguments
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



[issue41617] __builtin_bswap16 is used without checking it is supported

2020-11-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22157
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23260

___
Python tracker 

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



  1   2   >