[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-23 Thread Alex Roussel


Alex Roussel  added the comment:

The impression I got from reading https://bugs.python.org/issue28494 was that 
this was fixed in python 3.7 ? Or perhaps as you say it's just a matter of 
stumbling across the rare files that generate false positives.

--

___
Python tracker 

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



[issue8084] pep-0370 on osx duplicates existing functionality

2020-10-23 Thread Ronald Oussoren


Change by Ronald Oussoren :


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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-10-23 Thread Ronald Oussoren


Change by Ronald Oussoren :


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

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've added a PR with a variation of my earlier patch. This version will bail 
out when specifying "--enable-universalsdk" with a version of Xcode that does 
not support i386 (the previous patch did not).

--

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-23 Thread Georges


Georges  added the comment:

@barry Thank you for your input on the PR.

>From what I understood this PR was nearly ready and only missing a small 
>addition to the documentation which I added. So it took me a bit to go through 
>it all :-).

I actually don't see how *parsedate_to_datetime* would ever return None. It is 
*_parsedate_tz* which returns None on bogus input, in which case 
*parsedate_to_datetime* raises a TypeError.
This is also covered in the tests, so those should be fine.

In order to continue I suggest to fix the documentation on 
*parsedate_to_datetime*, remove the mention of it returning None and replacing 
it with it possibly returning TypeError in case of an invalid date input.

Does that make sense ?


Regarding the backporting, as a user of this I must admit that it would be much 
appreciated if this could be backported :-).

--

___
Python tracker 

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



[issue34394] Descriptors HowTo doesn't mention __set_name__

2020-10-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

See https://github.com/python/cpython/pull/22906

--

___
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-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Raymond,

- What version of macOS are you on?
- How did you install python 3.10? Did you use the python.org installer?
- What version of Tk is used?
  (This can be found in the output of `python3.9 -m test.pythoninfo`)

--

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Inada Naoki


New submission from Inada Naoki :

BUILD_CONST_KEY_MAP can be optimized based on #41835 optimization.

1. compiler checks keys tuple is distinct.
2. Add distinct flag to BUILD_CONST_KEY_MAP oparg

To be considered:

* Should we use new opcode, instead of flag in oparg?
* Is this technique safe? Wrong co_consts can make invalid dict instance.

--
assignee: methane
components: Interpreter Core
messages: 379415
nosy: methane
priority: normal
severity: normal
status: open
title: Optimize BUILD_CONST_KEY_MAP for distinct keys
type: performance
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



[issue42035] [C API] PyType_GetSlot cannot get tp_name

2020-10-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Yes, for some cases the ship has sailed. I don't think we can add unions now -- 
the stable ABI needs to be stable.

--

___
Python tracker 

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



[issue9405] Test fix for past crash when calling urllib.getproxies() under OSX with subprocess / particular memory usage

2020-10-23 Thread Ronald Oussoren


Change by Ronald Oussoren :


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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

It looks like the test can be reenabled.

System: macOS 10.15, with Python 3.9 from Python.org

``python3.9 -m tkinter.test.test_tkinter.test_widgets`` runs without problems 
(571 tests, no crash), even if I remove the skip for test_image.

Likewise for ``python3.9 -m unittest discover tkinter.test.test_tkinter`` (703 
tests)

--

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Closing as out of date:

- python 2 issue
- I don't get this error when using the system libffi (bpo-41100)

--
resolution:  -> out of date
stage:  -> resolved

___
Python tracker 

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



[issue28491] Remove bundled libffi for OSX

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

added 41100 as a dependency because that switches to the system libffi (as a 
side effect of larger changes)

--
dependencies: +Build failure on macOS 11 (beta)

___
Python tracker 

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



[issue33090] race condition between send and recv in _ssl with non-zero timeout

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The script still fails on macOS 10.15 with python 3.9 (installed from 
python.org).

Interestingly enough:
- First run of the script worked without any problems
- Subsequent runs failed with various errors:

$ python3.9 t.py
Got connection from ('127.0.0.1', 60640)
Exception in thread ReadThread:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 950, in _bootstrap_inner
self.run()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 888, in run
self._target(*self._args, **self._kwargs)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 93, in 
read_thread
csocket.recv()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1226, in recv
return self.read(buflen)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1101, in read
return self._sslobj.read(len)
BlockingIOError: [Errno 35] Resource temporarily unavailable




Got connection from ('127.0.0.1', 60651)
.Traceback (most recent call last):
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 74, in 
server_thread
Exception in thread WriteThread:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 950, in _bootstrap_inner
Exception in thread ReadThread:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 950, in _bootstrap_inner
deal_with_client(newsocket)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 68, in 
deal_with_client
data = connstream.read()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1101, in read
self.run()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 888, in run
self.run()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 888, in run
self._target(*self._args, **self._kwargs)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 93, in 
read_thread
self._target(*self._args, **self._kwargs)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 89, in 
write_thread
return self._sslobj.read(len)
csocket.recv()
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or 
bad record mac (_ssl.c:2621)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1226, in recv
csocket.send(b'blah')
Closed connection from ('127.0.0.1', 60651)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1173, in send
return self.read(buflen)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1101, in read
return self._sslobj.write(data)
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2471)
return self._sslobj.read(len)
ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac 
(_ssl.c:2621)



Got connection from ('127.0.0.1', 60636)
.Exception in thread ReadThread:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 950, in _bootstrap_inner
Traceback (most recent call last):
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 74, in 
server_thread
self.run()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 888, in run
deal_with_client(newsocket)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 68, in 
deal_with_client
self._target(*self._args, **self._kwargs)
  File "/Users/ronald/Projects/python/github/cpython-ronald/t.py", line 93, in 
read_thread
csocket.recv()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1226, in recv
data = connstream.read()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1101, in read
return self.read(buflen)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 
1101, in read
return self._sslobj.read(len)
return self._sslobj.read(len)
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or 
bad record mac (_ssl.c:2621)
Closed connection from ('127.0.0.1', 60636)
BlockingIOError: [Errno 35] Resource temporarily unavailable
Exception in thread WriteThread:
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", 
line 950, in _bootstrap_inner

--

___
Python tracker 

___
_

[issue31359] `configure` script incorrectly detects symbols as available on Mac w/ Xcode 8+

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Added 41100 as a dependency because the active PR for that issue will fix this 
issue as well.

--
dependencies: +Build failure on macOS 11 (beta)

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is the approach in the PR:

# JUMP_BOTH
while ...:
if haystack[j + cut] != needle[cut]:
# Sunday skip
j += table[haystack[j + len(needle)]]
continue
j += rest_of_the_two_way_algorithm()

If I understand correctly, this is what you're suggesting:

# JUMP_MAX
while ...:
shift = rest_of_the_two_way_algorithm()
j += max(shift, table[haystack[j + len(needle)]])

I implemented this and on my Zipf benchmark, and JUMP_BOTH was faster on 410 
cases (at most 1.86x faster), while JUMP_MAX was faster on 179 cases (at most 
1.3x faster).

Some things to notice about the JUMP_BOTH approach:

* The if-statement is actually the first step of the 
rest_of_the_two_way_algorithm, so there's no extra comparison over the pure 
two-way algorithm.

* The if-block only executes in situations where the two-way algorithm would 
say to skip ahead by only 1. In all other situations, the two-way algorithm 
skips by at least 2.

The typical purpose of the Sunday skip (as far as I can tell) is that in 
Sunday's algorithm, we find a mismatch, then have no a priori idea of how far 
ahead to skip, other than knowing that it has to be at least 1, so we check the 
character 1 to the right of the window. Another way of thinking about this 
would be to increment the window by 1, look at the last character in the new 
window, and jump ahead to line it up.

However, with the hybrid method of the PR, we *do* have some a priori skip, 
bigger than 1, known before we check the table. So instead of doing the maximum 
of the two-way skip and the Sunday skip, why not do both? As in: do the two-way 
shift, then extend that with a Sunday shift in the next iteration.

I tried another version also with this in mind, something like:

# JUMP_AFTER
while ...:
# Guaranteed to jump to a mismatched poisition
j += rest_of_the_two_way_algorithm() - 1
j += table[haystack[j + len(needle)]]

But this resulted in slightly-worse performance: JUMP_BOTH was faster in 344 
cases (at most 1.9x faster), while JUMP_AFTER was faster in 265 cases (at most 
1.32x faster). My guess for the explanation of this is that since most of the 
time is spent on Sunday shifts lining up the cut character, it's beneficial for 
the compiler to generate specialized code for that case.

--

___
Python tracker 

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



[issue33090] race condition between send and recv in _ssl with non-zero timeout

2020-10-23 Thread Christian Heimes


Christian Heimes  added the comment:

The demo script uses the same connection socket in two threads. Neither OpenSSL 
nor Python guarantee that a single SSLSocket object can be used by multiple 
threads. https://www.openssl.org/blog/blog/2017/02/21/threads/ contains more 
information about thread safety.

tl;dr SSLObject and SSLSocket cannot be safely used by multiple threads at the 
same time. SSLContext can be shared across multiple threads. However it's not 
safe to reconfigure a context once it's attached to a connection. Only getters, 
wrap_*(), and load_verify_locations() are safe.

--

___
Python tracker 

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



[issue33090] race condition between send and recv in _ssl with non-zero timeout

2020-10-23 Thread Christian Heimes


Christian Heimes  added the comment:

I'm turning this into a docs bug.

--
assignee: christian.heimes -> docs@python
components: +Documentation -macOS
nosy: +docs@python
stage:  -> needs patch
type: crash -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, 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



[issue42122] macOS complains about how fonts are accessed

2020-10-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

python.org 3.10 mac is still using 8.6.8.  It is on IDLE/Python => About

--

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +21843
pull_request: https://github.com/python/cpython/pull/22912

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21844
pull_request: https://github.com/python/cpython/pull/22913

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset da6f098188c9825f10ae60db8987056b3a54c2e8 by Christopher 
Marchfelder in branch 'master':
bpo-40592: shutil.which will not return None anymore if ; is the last char in 
PATHEXT (GH-20088)
https://github.com/python/cpython/commit/da6f098188c9825f10ae60db8987056b3a54c2e8


--

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the contribution! Looking forward to your next one :)

--
nosy:  -miss-islington
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue37586] macOS: posix_spawn(..., setsid=True)

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm including a fix for this in the active PR on bpo-41100

--
dependencies: +Build failure on macOS 11 (beta)

___
Python tracker 

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2020-10-23 Thread Irit Katriel


Change by Irit Katriel :


--
status: open -> closed

___
Python tracker 

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



[issue39825] EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows)

2020-10-23 Thread Lumír Balhar

Change by Lumír Balhar :


--
nosy: +frenzy

___
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-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I know, but what I don't know is if Raymond uses the python.org installer. The 
initial message seems to indicate he's using a local build ("python.exe"). 

That will by default pick up the system version of Tk, which is ancient and is 
known to have problems.


And for completeness sake: I don't get these warnings, neither in IDLE nor when 
using your scriptlet (adjusted to try all fonts in "frames').

--

___
Python tracker 

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



[issue24908] sysconfig.py and distutils.sysconfig.py disagree on directory spelling on Windows

2020-10-23 Thread Lumír Balhar

Change by Lumír Balhar :


--
nosy: +frenzy

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Inada Naoki


Inada Naoki  added the comment:

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 23.5 ns 
+- 0.2 ns
/home/inada-n/work/python/cpython/python: . 22.4 ns +- 0.1 
ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 23.5 ns +- 
0.2 ns -> [/home/inada-n/work/python/cpython/python] 22.4 ns +- 0.1 ns: 1.05x f
aster (-5%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 83.5 ns 
+- 0.3 ns
/home/inada-n/work/python/cpython/python: . 96.7 ns +- 0.2 
ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 83.5 ns +- 
0.3 ns -> [/home/inada-n/work/python/cpython/python] 96.7 ns +- 0.2 ns: 1.16x s
lower (+16%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2,3:3}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 108 ns 
+- 0 ns
/home/inada-n/work/python/cpython/python: . 110 ns +- 1 ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 108 ns +- 0 
ns -> [/home/inada-n/work/python/cpython/python] 110 ns +- 1 ns: 1.01x slower
(+1%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2,3:3,4:4}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 134 ns 
+- 1 ns
/home/inada-n/work/python/cpython/python: . 122 ns +- 1 ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 134 ns +- 1 
ns -> [/home/inada-n/work/python/cpython/python] 122 ns +- 1 ns: 1.10x faster
(-9%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2,3:3,4:4,5:5}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 168 ns 
+- 1 ns
/home/inada-n/work/python/cpython/python: . 112 ns +- 1 ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 168 ns +- 1 
ns -> [/home/inada-n/work/python/cpython/python] 112 ns +- 1 ns: 1.50x faster
(-33%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2,3:3,4:4,5:5,6:6}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 223 ns 
+- 1 ns
/home/inada-n/work/python/cpython/python: . 150 ns +- 4 ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 223 ns +- 1 
ns -> [/home/inada-n/work/python/cpython/python] 150 ns +- 4 ns: 1.48x faster
(-33%)

$ ./python -m pyperf timeit --compare-to ~/pyenv/versions/3.10-dev/bin/python 
'{1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}'
/home/inada-n/pyenv/versions/3.10-dev/bin/python: . 273 ns 
+- 1 ns
/home/inada-n/work/python/cpython/python: . 177 ns +- 1 ns

Mean +- std dev: [/home/inada-n/pyenv/versions/3.10-dev/bin/python] 273 ns +- 1 
ns -> [/home/inada-n/work/python/cpython/python] 177 ns +- 1 ns: 1.54x faster
(-35%)

--

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Mark Shannon


Mark Shannon  added the comment:

Is this worthwhile?

Statically, BUILD_CONST_KEY_MAP represents 0.14% of all bytecode instructions 
in the standard library, but only 0.03% of the bytecode instructions in 
functions.
Which suggests that dynamically only 1 in 3000 instructions executed is 
BUILD_CONST_KEY_MAP. The implication is that making BUILD_CONST_KEY_MAP more 
complex is just as likely to slow things down as speed them up.

Do you have any evidence that this will make a measurable difference?

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue26515] Update extending/embedding docs to new way to build modules in C

2020-10-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

There is now PEP 630. Still not done enough to move it out of draft status, but 
usable for converting simple modules.

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +21845
pull_request: https://github.com/python/cpython/pull/22915

___
Python tracker 

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



[issue42117] asyncio calls from sync/async, better docs or api support

2020-10-23 Thread Blaze Spinnaker


Change by Blaze Spinnaker :


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



[issue42117] asyncio calls from sync/async, better docs or api support

2020-10-23 Thread Blaze Spinnaker


Blaze Spinnaker  added the comment:

Ah, thanks.  Looked around for something like that but couldn't find it.  Will 
close this.

--

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Inada Naoki


Inada Naoki  added the comment:

It is difficult to estimate. Real world applications has different code-style 
than stdlib. And pyperformance didn't include whole real world applications too.
Some application may use dict display in heavy loop. But it is difficult to say 
how much exactly.

One example from pyperformance. It uses inner function and function annotations 
heavily.
BUILD_CONST_KEY_MAP is used to build annotation dict, instead of dict display.
https://github.com/tornadoweb/tornado/blob/5eb7bb8efb4e1be8a2cec1744c857a8dadd43af9/tornado/gen.py

```
591  32 LOAD_CONST   1 ('Future')
 34 LOAD_CONST   2 ('None')
 36 LOAD_CONST   3 (('future', 'return'))
 38 BUILD_CONST_KEY_MAP  5
 40 LOAD_CLOSURE 3 (quiet_exceptions)
 42 BUILD_TUPLE  1
 44 LOAD_CONST   4 ()
 46 LOAD_CONST   5 
('with_timeout..error_callback')
 48 MAKE_FUNCTION   12 (annotations, closure)
 50 STORE_DEREF  0 (error_callback)
```

I have not posted pyperformance result because this pull request is based on 
#41835 and I don't measure each performance.
But #41835 + this is 16% faster than master on bm_tornado_http.

--

___
Python tracker 

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



[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Inada Naoki


Inada Naoki  added the comment:

@Marco Sulla Please take a look at GH-22909. It is simplified version of your 
PR. And I wrote another optimization based on it #42126.

--

___
Python tracker 

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



[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Mark Shannon


Mark Shannon  added the comment:

Could we get a pyperformance benchmark run on this please?

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Mark Shannon


Mark Shannon  added the comment:

It sounds like the root cause is that annotations are repeatedly being 
computed. We should address the underlying issue, IMO.

--

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

All this needs is a PR filed against latest master that updates 
Doc/whatsnew/3.9.rst and labeled with needs-backport-3.9.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue42127] functools.cached_property possibly disables key-sharing instance dictionaries

2020-10-23 Thread Yonatan Goldschmidt


New submission from Yonatan Goldschmidt :

Key-sharing dictionaries, defined by https://www.python.org/dev/peps/pep-0412/, 
require that any resizing of the shared dictionary keys will happen before a 
second instance of the class is created.

cached_property inserts its resolved result into the instance dict after it is 
called. This is likely to happen *after* a second instance has been created, 
and it is also likely to cause a resize of the dict, as demonstrated by this 
snippet:

from functools import cached_property
import sys

def dict_size(o):
return sys.getsizeof(o.__dict__)

class X:
def __init__(self):
self.a = 1
self.b = 2
self.c = 3
self.d = 4
self.e = 5

@cached_property
def f(self):
return id(self)

x1 = X()
x2 = X()

print(dict_size(x1))
print(dict_size(x2))

x1.f

print(dict_size(x1))
print(dict_size(x2))

x3 = X()
print(dict_size(x3))

Essentially it means that types using cached_property are less likely to enjoy 
the benefits of shared keys. It may also incur a certain performance hit, 
because a resize + unshare will happen every time.

A simple way I've thought of to let cached_property play more nicely with 
shared keys, is to first create a single object of the class, and set the 
cached_property attribute to some value (so the key is added to the shared 
dict). In the snippet above, if you add "x0 = X(); x0.f = None" before creating 
x1 and x2, you'll see that the cached_property resolving does not unshare the 
dicts.

But I wonder if there's a way to do so without requiring user code changes.

--
components: Library (Lib)
messages: 379439
nosy: Yonatan Goldschmidt
priority: normal
severity: normal
status: open
title: functools.cached_property possibly disables key-sharing instance 
dictionaries
type: performance
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



[issue40060] socket.TCP_NOTSENT_LOWAT is missing in official macOS builds

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The active PR on bpo-41100 will make it possible to build the installer on the 
latest version of macOS (which will be needed to be able to provide support for 
"Apple Silicon").

IMHO it is not necessary to remove unavailable constants, on some platforms (in 
particular Linux) some of the constants might not work because the relevant 
kernel module is not loaded. That's something you can only find by actively 
probing, which is too expensive and error prone. 

I propose closing this issue: the installers are what they are for a reason, 
and a better solution than proposed in this issue is on its way.

--
dependencies: +Build failure on macOS 11 (beta)

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2020-10-23 Thread Atsuo Ishimoto


Atsuo Ishimoto  added the comment:

After this fix, some functions like multiprocessing.Pool cannot be used in 
threaded code(https://bugs.python.org/issue41567).

importerror-sample.tgz contains simplified code to reproduce the same error 
without multiprocessing module. Is this an expected behaviour of this change?

Tested with Python 3.9.0/macOS 10.15.5.

--
nosy: +ishimoto
Added file: https://bugs.python.org/file49537/importerror-sample.tgz

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher


New submission from Brandt Bucher :

PEP 634 has not yet been accepted, but we'd like to hit the ground running and 
get this into alphas as soon as it (hopefully) is.

Several people have volunteered to review the implementation, since it's so 
huge. Other reviews are very welcome, if anybody has a bit of time to pitch in. 
This touches tons of stuff: the parser, the compiler, the VM, the builtins, the 
stdlib, the tests... I'd like as many eyeballs as possible!

I'll have a draft PR up against master in a few minutes. Let's try to keep all 
of the review comments there.

--
assignee: brandtbucher
components: Interpreter Core
messages: 379442
nosy: BTaskaya, brandtbucher, gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
stage: patch review
status: open
title: Structural Pattern Matching (PEP 634)
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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

Sorry, just resolving some changes with master. Are you parser people finished 
breaking my grammar yet? Sheesh. ;)

--

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Weiliang Li


Weiliang Li  added the comment:

Well, it looks like there is no CONTAINS_OP part under the subtitle "CPython 
bytecode changes" in master's Doc/whatsnew/3.9.rst

Maybe it's some discrepancy?

--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-23 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +21846
pull_request: https://github.com/python/cpython/pull/22917

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-23 Thread Mark Roseman


Mark Roseman  added the comment:

Tal, I gave it a try, I think this is great. For "simple" searches (i.e. what 
people do most of the time), a search bar is a lot less klunky than bringing up 
a dialog.  

Patch seems to work well, would just need a cosmetic update (ttk widgets etc.).

Things may get a bit complex for users if too many things are stuck in there, 
and you run out of space real quick when you have a fairly narrow window. 

My suggestion would be to keep it to just a simple search without options, and 
keep the rest (search with options, replace) in a separate unified dialog that 
merges the current "Search Dialog" and "Replace Dialog". A button ("...") in 
the search bar to open that dialog would make for a nice transition between the 
search bar and the dialog.

--
nosy: +markroseman

___
Python tracker 

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



[issue33051] IDLE: Create new tab for editor options in configdialog

2020-10-23 Thread Mark Roseman


Change by Mark Roseman :


--
nosy: +markroseman

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Honestly I don't see it in the 3.9 branch either. It seems the whole section 
mentioned in the closed PR doesn't exist anywhere. Maybe it was reverted for 
some reason. Let's close this issue.

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



[issue13139] multiprocessing.map skips finally blocks

2020-10-23 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> needs patch
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, 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



[issue42122] macOS complains about how fonts are accessed

2020-10-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm only Catalina 10.15.7 and am using a local build constructed with:

   ./configure --with-openssl=$(brew --prefix openssl) && make

Perhaps that is using the system Tk and we don't need to worry about this.

--

___
Python tracker 

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



[issue41434] IDLE: Option to warn user on "Run Module" if file is not Python source

2020-10-23 Thread Mark Roseman


Mark Roseman  added the comment:

I like Terry's idea of providing a better error message than just "invalid 
syntax" when we run something that likely isn't a Python file. There doesn't 
seem to be any great danger in trying to run any file that would justify a 
warning beforehand.

--
nosy: +markroseman

___
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-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Could you check "/tmp/py310/bin/python3 -m test.pythoninfo | grep -i tk". If 
that says your using Tk 8.5 you're almost certainly using the system version.

You could also check _tkinter itself:

otool -vL /tmp/py310/lib/python3.10/lib-dynload/_tkinter.cpython-310-darwin.so
/tmp/py310/lib/python3.10/lib-dynload/_tkinter.cpython-310-darwin.so:
/System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl 
(compatibility version 8.5.0, current version 8.5.9)
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility 
version 8.5.0, current version 8.5.9)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1292.0.0)

I propose closing this issue if you are indeed using the system copy of Tk.

--

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2020-10-23 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In 
[importlib_resources#68](https://github.com/python/importlib_resources/issues/68),
 the project identified a deficiency with respect to pkg_resources for 
resources in namespace packages.

The project has since merged support for these packages, slated to go out with 
the importlib_resources 3.2 release.

This issue is to track the incorporation of those changes into 
importlib.resources.

--
assignee: jaraco
messages: 379451
nosy: jaraco
priority: normal
severity: normal
status: open
title: Support resources in namespace packages
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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Weiliang Li


Weiliang Li  added the comment:

It's here 
https://github.com/python/cpython/blob/3.9/Doc/whatsnew/3.9.rst#cpython-bytecode-changes

Just several pixels below

--

___
Python tracker 

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



[issue25509] PyImport_ImportModule inaccurately described

2020-10-23 Thread Brett Cannon


Brett Cannon  added the comment:

The docs for PyImport_ImportModule() is 
https://docs.python.org/3/c-api/import.html?highlight=pyimport_importmodule#c.PyImport_ImportModule
 and https://github.com/python/cpython/blob/master/Doc/c-api/import.rst.

--
keywords: +easy (C) -easy

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Weiliang Li

Weiliang Li  added the comment:

And the "What’s New In Python 3.9" page (updated today): 

https://docs.python.org/3/whatsnew/3.9.html#cpython-bytecode-changes

--

___
Python tracker 

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



[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-23 Thread Taras Voinarovskyi


New submission from Taras Voinarovskyi :

Hi, during migration to Python 3.8.6 we encountered a behavior change from 
previous versions: wait_for ignored the request to cancellation and returned 
instead. After investigation, it seems to be related to the update in bpo-32751 
and is only reproduced if the waited task is finished when cancellation of 
wait_for happens (code mistakes external CancelledError for a timeout).

The following example can reproduce the behavior on both 3.8.6 and 3.9.0 for me:

```

import asyncio


async def inner():
return

async def with_for_coro():
await asyncio.wait_for(inner(), timeout=100)
await asyncio.sleep(1)
print('End of with_for_coro. Should not be reached!')

async def main():
task = asyncio.create_task(with_for_coro())
await asyncio.sleep(0)
assert not task.done()
task.cancel()
print('Called task.cancel()')
await task  # -> You would expect a CancelledError to be raised.


asyncio.run(main())
```

Changing the wait time before cancellation slightly will return the correct 
behavior and CancelledError will be raised.

--
components: asyncio
messages: 379454
nosy: asvetlov, tvoinarovskyi, yselivanov
priority: normal
severity: normal
status: open
title: AsyncIO's wait_for can hide cancellation in a rare race condition
type: behavior
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



[issue42129] Support resources in namespace packages

2020-10-23 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, I guess my repo is out of date. Sorry. So it is in master? Let's fix it 
there then.

--
resolution: out of date -> 
stage: resolved -> needs patch
status: closed -> open
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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Weiliang Li


Weiliang Li  added the comment:

The whole CONTAINS_OP stuff is gone in master, but it's still there in 3.9 
branch.

I don't know why.

Any plan to resolve the discrepancy?

--

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

There really shouldn't be any differences between that doc in the 3.9 and 
master branch (with rare exceptions). Can you post a diff here between the two 
so we can sort it out?

Also can you find the commit where it was added to the 3.9 branch?

--

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2020-10-23 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue26131] Raise ImportWarning when loader.load_module() is used

2020-10-23 Thread Brett Cannon


Change by Brett Cannon :


--
stage: test needed -> commit review

___
Python tracker 

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



[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Marco Sulla


Marco Sulla  added the comment:

@methane: well, to be honest, I don't see much difference between the two 
pulls. The major difference is that you merged insertdict_init in 
dict_merge_init.

But I kept insertdict_init separate on purpose, because this function can be 
used in other future dedicated function on creation time only. Furthermore it's 
more simple to maintain, since it's quite identical to insertdict.

--

___
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-10-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm going to mark this as closed, not a bug.  If you're not seeing the same 
result, it is almost certainly an issue with my local build.

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



[issue16094] Tuple extraction in a lambda isn't supported by 2to3

2020-10-23 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-10-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

I close this issue as rejected!

During the sprint, I could hear a lot of opinions from core devs including 
Guido, Tal, and Christian.

The overall conclusion for me is not to add this time.
if the mimetypes module is extracted from stdlib to pypi package, we can 
discuss to add this feature at that time!

Thank you everyone for the discussion!

--
nosy: +christian.heimes, taleinat
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



[issue614557] LookupError etc. need API to get the key

2020-10-23 Thread Irit Katriel


Change by Irit Katriel :


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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Dong-hee, I recommend that you turn this into a 3rd party package on PyPI
yourself. That way your effort and code will live on!

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-10-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Well, I'm happy to say that 3.9.0 is finally released with the ast.unparse 
interface. After tens of PRs, I think it is time for us to move on. For all 
future bugs, please create a new issue and nosy me. Thanks everyone who has 
participated this journey!

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-10-23 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue3760] PEP 3121 --- PyType_Copy is missing

2020-10-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

The need is covered by PEP 384's PyType_FromSpec (and later additions, the 
latest being PyType_FromModuleAndSpec).

Thanks for closing!

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-23 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Aside: I noticed that on _parseaddr.py:68, there's a bare `return`.  That 
should really be `return None` (EIBTI).  Can you fix that in your PR?

I think it's confusing to raise both TypeError and ValueError.  I suggest we 
check the `None` return from _parsedate_tz() and raise ValueError explicitly in 
that case, avoiding the implicit TypeError on the failing tuple unpack.

+1 on removing the mention of returning None from the documentation.  Then with 
the above, it would document raising ValueError on invalid date input.

As for backporting, I'm nosing Ned and Łukasz to weigh in.  Given that the 
patch is adding a new defect class (which it should), this won't break existing 
code, but it does mean that existing code would have different semantics 
depending on the patch version release of 3.9, 3.8, and 3.7.  I'm not 
completely comfortable with that, but let's see what the RMs say.  I guess I'm 
currently -0 on backporting.

--
nosy: +lukasz.langa, ned.deily

___
Python tracker 

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



[issue42058] Process not running with args

2020-10-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

bpo is the issue tracker for patching the python cpython repository.  We 
support running python from system command line terminals and icons that we 
install, as specified in the CPython docs.  Ask questions about running python 
otherwise on other forums.

--
nosy: +terry.reedy
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue13464] HTTPResponse is missing an implementation of readinto

2020-10-23 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


--
nosy: +fbidu
nosy_count: 5.0 -> 6.0
pull_requests: +21847
pull_request: https://github.com/python/cpython/pull/22737

___
Python tracker 

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



[issue21032] Socket leak if HTTPConnection.getresponse() fails

2020-10-23 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


--
nosy: +fbidu
nosy_count: 3.0 -> 4.0
pull_requests: +21848
pull_request: https://github.com/python/cpython/pull/22737

___
Python tracker 

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



[issue42070] Revisit IsoCalendarDate being private from pickle perspective

2020-10-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If the current situation is not a bug, a mismatch between behavior and doc, a 
change would be an enhancement limited to the next release.

--
nosy: +terry.reedy
title: I think the rationale to keep IsoCalendarDate private from the pickle 
perspective should get revisited -> Revisit IsoCalendarDate being private from 
pickle perspective
type: behavior -> enhancement
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



[issue23797] Mac OS X locale setup in thread happens sometime after run() is called

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've been using the scriptlet below to try to attempt to reproduce the problem. 
I'm not sure if this matches the way the program of the OP is set up.

The scriptlet below works for me without problems (macOS 10.15, Python 3.4 - 
3.9).

This either means the problem has been fixed in the meantime (if it was an OS 
bug), or my script doesn't reproduce the problematic setup.

The traceback in the first message is due to LC_CTYPE=UTF-8 in the default 
shell environment on macOS, which wasn't recognised by locale.py for a long 
time. That issue has been fixed though.


# 
import locale
import threading

def thread():
print("thread locale:", locale.getlocale())

locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
#locale.getlocale()

t = threading.Thread(target=thread)
t.start()
t.join()

--

___
Python tracker 

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



[issue23797] Mac OS X locale setup in thread happens sometime after run() is called

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm closing this issue as "works for me". Please re-open if there is more 
information on how to reproduce the problem.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue42074] setup error on windows

2020-10-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you for attaching the log instead of including it inline.  But when you 
reply by email, please delete the message you are responding too, as it 
duplicates the original already on the web page.

The first error in the log is a failure to make a restore point.  Then the 
fatal error reported:
ESOMEUSERor 0x80070002: Failed to install MSI package.
ESOMEUSERor 0x80070002: Failed to configure per-user MSI package.
Applied execute package: core_JustForMe, result: 0x80070002, restart: None
ESOMEUSERor 0x80070002: Failed to execute MSI package.

I added the Windows component so a Windows expert can try to interpret this.  
Since it was installing just for you, in AppData, I don't think permissions 
should have been a problem.  I presume that 1703 is recent enough that the 
installer should work.

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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-10-23 Thread Tal Einat


Tal Einat  added the comment:

> Dong-hee, I recommend that you turn this into a 3rd party package on PyPI 
> yourself.

+1

--

___
Python tracker 

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



[issue41101] Support "arm64" in Mac/Tools/pythonw

2020-10-23 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This change is part of the active PR in #41100. Therefore closing this issue.

--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed
superseder:  -> Build failure on macOS 11 (beta)
type:  -> enhancement

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-10-23 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
pull_requests: +21849
pull_request: https://github.com/python/cpython/pull/21114

___
Python tracker 

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



[issue42075] Verbose/confusing default format on warnings

2020-10-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

An application *can* change warnings.  See lib/idlelib/run for an example.  
Library code should not make changes as they will be global or overwritten.  A 
project that is both can restrict the changes to when run as main module.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue34394] Descriptors HowTo doesn't mention __set_name__

2020-10-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 
3.7, Python 3.8

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-23 Thread Tal Einat


Tal Einat  added the comment:

> Why would having all 'a's on a page light up when I type 'a' be a plus?

The auto-highlighting could be disabled for 1-2 character search queries, or 
delayed for a bit to allow typing to continue.

I find auto-highlighting very useful when I'm looking for "where is this 
variable used?", I just Ctrl-f, start typing its name, and get the answer very 
quickly, even if I haven't typed the whole name.

Also, this PR supports Alt+/ completion in the search bar, which makes the 
above even more effective.

--

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-23 Thread Tal Einat


Tal Einat  added the comment:

Thanks Mark, your feedback is greatly appreciated!

--

___
Python tracker 

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



[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Marco Sulla


Marco Sulla  added the comment:

@Mark.Shannon I tried to run pyperformance, but wheel does not work for Python 
3.10. I get the error:

AssertionError: would build wheel with unsupported tag ('cp310', 'cp310', 
'linux_x86_64')

--

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2020-10-23 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

I've narrowed down the traverse problems to Py_VISIT(state->CacheType). 
Suspecting this has to do with the cyclic references in cache/connection. 
Preliminary tests with GC tracking `cache->factory` look promising, but this is 
a part of the C API that's _completely_ unknown to me (yet), so I'm on thin ice 
here.

--

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


miss-islington  added the comment:


New changeset c437fe39cf5318f27f3381a983fbf320f65064bc by Miss Skeleton (bot) 
in branch '3.9':
[3.9] bpo-40592: shutil.which will not return None anymore if ; is the last 
char in PATHEXT (GH-20088) (GH-22912)
https://github.com/python/cpython/commit/c437fe39cf5318f27f3381a983fbf320f65064bc


--

___
Python tracker 

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



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


miss-islington  added the comment:


New changeset 8b4842b7a830299870067bba59f53529b13647a2 by Miss Skeleton (bot) 
in branch '3.8':
[3.8] bpo-40592: shutil.which will not return None anymore if ; is the last 
char in PATHEXT (GH-20088) (GH-22913)
https://github.com/python/cpython/commit/8b4842b7a830299870067bba59f53529b13647a2


--
nosy: +miss-islington

___
Python tracker 

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



[issue42127] functools.cached_property possibly disables key-sharing instance dictionaries

2020-10-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Essentially it means that types using cached_property are less
> likely to enjoy the benefits of shared keys.

I don't think anything can be done about it.  @cached_property and key-sharing 
dicts are intrinsically at odds with one another.  Likewise, @cached_property 
doesn't work with classes that define __slots__.

FWIW, there is an alternative that works with both key-sharing dicts and 
__slots__.  You can stack property() on top of functools.cache():

class A:
def __init__(self, x):
self.x = x

@property
@cache
def square(self):
print('Called!')
return self.x ** 2


>>> a = A(10)
>>> a.square
Called!
100
>>> b = A(11)
>>> b.square
Called
121
>>> a.square
100
>>> b.square
121

--
nosy: +rhettinger

___
Python tracker 

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



[issue42070] Revisit IsoCalendarDate being private from pickle perspective

2020-10-23 Thread Paul Ganssle

Paul Ganssle  added the comment:

Even if it were accidental (and it wasn't — it was actually somewhat difficult 
to achieve), I'd still argue for not changing it in 3.9, because it would mean 
that pickles created in 3.9.(n+1) would not be readable in 3.9.n.

Still, I don't think I'd be convinced without some real-life use cases. The SO 
question is asking about the reasoning for this in the abstract — the poster 
noticed that we designed it this way and saw a possible objection to this, but 
it was one that we had considered and decided to make the trade-off a different 
way.

I informally asked many people about this, since it was by far the weirdest 
design decision made in that issue (I say that in the passive tense not to 
deflect from the fact that I made the decision, but to own the fact that it was 
weirder than any of the design decisions made by anyone else, either 😛), and 
generally they could not give me any concrete reasons it would break (but they 
also all counseled not to try to get too clever with pickling logic).

I think I'm happy with the decision if we remain in the realm of the abstract, 
but I recognize how weird it is, and I think if someone came up with a 
compelling workflow that this breaks, we could change it (in a feature 
release). This was specifically proposed to avoid backwards-compatibility 
problems, so it wouldn't be any more of a breakage to change it in future 
feature releases than it would have been to do it in 3.9.

--

___
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-10-23 Thread Brett Cannon


New submission from Brett Cannon :

zipimport only supports old PEP 302 APIs and not PEP 451 module specs (i.e. it 
uses load_module() instead of create_module()/exec_module(), find_mdoule() 
instead of find_spec()).

Uses of both load_module() and find_module() are documented as deprecated for 
the import system and are slated to eventually go away.

--
components: Library (Lib)
messages: 379481
nosy: brett.cannon, twouters
priority: normal
severity: normal
status: open
title: [zipimport] Update zipimport to use specs
type: behavior
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



[issue42070] Revisit IsoCalendarDate being private from pickle perspective

2020-10-23 Thread Paul Ganssle


Paul Ganssle  added the comment:

I'm glad that Terry brought up documentation, though, because I realized that 
this is not a documented behavior: 
https://docs.python.org/3/library/datetime.html#datetime.date.isocalendar

We should maybe document it? Though if we document it it might be considered 
more of a breaking change to change the behavior than if it's an undocumented 
feature.

--

___
Python tracker 

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



[issue42132] Use specs instead of just __loader__ in C code

2020-10-23 Thread Brett Cannon


New submission from Brett Cannon :

_warnings.c, pylifecycle.c, and pythonrun.c all either use or set `__loader__` 
but without also falling back on `__spec__`.

--
components: Interpreter Core
messages: 379483
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Use specs instead of just __loader__ in C code
type: behavior
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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Weiliang Li


Weiliang Li  added the comment:

The diff is here:

https://gist.github.com/kigawas/c0c3900e5f56552f13160c7989612c28

Looks like it is not trivial.

And the commit at branch 3.9 is:

https://github.com/python/cpython/commit/9cf6752276e6fcfd0c23fdb064ad27f448aaaf75#diff-ec874d66bbcf13046b9928aa3716d14a93632f568b914eba32baf46ff4c9eb36R1180

Hope this would help.

--

___
Python tracker 

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum

Guido van Rossum  added the comment:

Oh, I see. Łukasz (@ambv) prepared the 3.9.0 release and didn't merge his 
changes into master yet.

I'll contact him.

--
nosy: +lukasz.langa

___
Python tracker 

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



  1   2   >