[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is nothing wrong with writing two lines of code. And two lines of code 
may be more readable than one line of code. New method or parameter has a cost 
-- core developers need to maintain it, update documentation and tests if they 
conflict with new features, user will need to learn about it, remember 
differences between Python versions and implementations of different Path-like 
objects, it can be only used after dropping support of older Python versions, 
and it may be a source of common mistakes.

If you think that it is so important to use a single call for appending to a 
file, you can create a module which provides functions append_text() and 
append_bytes(). They could be used even in Python versions older than 3.11.

--

___
Python tracker 

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



[issue46558] Quadratic time internal base conversions

2022-01-30 Thread Tim Peters


Tim Peters  added the comment:

> todecstr treats it as an "input" conversion instead, ...

Worth pointing this out since it doesn't seem widely known: "input" base 
conversions are _generally_ faster than "output" ones. Working in the 
destination base (or a power of it) is generally simpler.

In the math.factorial(100) example, it takes CPython more than 3x longer 
for str() to convert it to base 10 than for int() to reconstruct the bigint 
from that string. Not an O() thing (they're both quadratic time in CPython 
today).

--

___
Python tracker 

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



[issue46558] Quadratic time internal base conversions

2022-01-30 Thread Tim Peters


Tim Peters  added the comment:

The factorial of a million is much smaller than the case I was looking at. Here 
are rough timings on my box, for computing the decimal string from the bigint 
(and, yes, they all return the same string):

native:   475seconds (about 8 minutes)
numeral:   22.3  seconds
todecstr:   4.10 seconds
gmp:0.74 seconds

"They recursively split the bigint into halves using % 10^n at each recursion 
step". That's the standard trick for "output" conversions. Beyond that, there 
are different ways to try to use "fat" multiplications instead of division. The 
recursive splitting all on its own can help, but dramatic speedups need 
dramatically faster multiplication.

todecstr treats it as an "input" conversion instead, using the `decimal` module 
to work mostly _in_ base 10. That, by itself, reduces the role of division (to 
none at all in the Python code), and `decimal` has a more advanced 
multiplication algorithm than CPython's bigints have.

--

___
Python tracker 

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



[issue46588] fix typo in test_calltip.py

2022-01-30 Thread Caio Agiani


Change by Caio Agiani :


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



[issue44977] Deprecate delegation of int to __trunc__

2022-01-30 Thread Zackery Spytz


Zackery Spytz  added the comment:

I have created a patch for this issue.  Please consider having a look.

--

___
Python tracker 

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



[issue44977] Deprecate delegation of int to __trunc__

2022-01-30 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +29214
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31031

___
Python tracker 

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



[issue46475] typing.Never and typing.assert_never

2022-01-30 Thread David Foster


Change by David Foster :


--
nosy: +David Foster

___
Python tracker 

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



[issue46540] dylibs not loading properly from NFS mounts

2022-01-30 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report but there are a lot of variables here that make this very 
difficult to act on. First, there have been many changes in macOS 10.15 
regarding file permissions and file system layouts (with APFS et al) and 
further changes in the more recent versions of macOS, 11 Big Sur and now 12 
Monterey. Further, Python 3.7 is now in the security-fix-only phase of its life 
cycle which means we no longer produce binary installers for macOS or Windows 
for 3.7. 3.7.9 was released prior to the official release of macOS 11 and so, 
as noted on the changelog for 3.7.9, macOS 11+ is not fully supported by 3.7.x. 
We have also learned more about these operating systems since then and there 
are changes in Python and in how we manufacture python.org macOS installers 
that are reflected in current releases of Python 3.9.x and 3.10.x. Beyond that, 
AFAIK, we do not do any testing of macOS NFS clients or servers and have no 
setup for that at hand. And throwing in a third-party extension module (
 shiboken2.abi3.so) plus use of @rpath on top of all that adds even more 
variability.

My suggestion is to try to reproduce this with a current, fully-supported 
python.org macOS installer download (i.e. the 3.10.2 universal2 installer) and 
preferably on a current version of macOS, currently 12.2 or possibly 11.6.3, 
and also check "System Preferences" -> "Security & Privacy" -> "Privacy 
settings" like "Full Disk Access" and "Files and Folders"; if problems persist, 
try doing some dynamic loader debugging using the DYLD_* environment variables 
documented in the macOS dyld man page (man dyld). Otherwise, as your issue 
stands now, it seems unlikely that anyone here would be willing to invest the 
significant time to try to reproduce and debug what seems to be an unusual 
macOS configuration with out-of-date OS and Python versions.

Perhaps a simpler option is to just avoid use of NFS file systems on macOS for 
this purpose.

Sorry I don't have a more positive answer for you.

--

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-01-30 Thread wesinator


Change by wesinator <13hu...@gmail.com>:


--
keywords: +patch
nosy: +wesinator
nosy_count: 1.0 -> 2.0
pull_requests: +29213
pull_request: https://github.com/python/cpython/pull/30251

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-01-30 Thread Terry J. Reedy


New submission from Terry J. Reedy :

I am opening this for a PR submitted without an issue.  The PR (not yet 
reviewed) makes the online IDLE doc link clickable.

Since a local copy of the online html page is also available on the Help menu, 
that link is almost unneeded.  But when using the online version, one can 
navigate to other parts of the doc.

There is also a mailto: link.  For me, on Windows, 
wb.open("mailto:m...@mail.addr;) works and returns True (not documented).  Is 
this system dependent?  I have previously seen mention that 'file:' links only 
work on some systems.  Maybe this has changed.  I would like to know more 
before addding this.

I am a bit worried about making spam easier and moderation of non-subscriber 
posts (by me) harder.  I would only want a link on a new Report Bugs page that 
explained how to search bpo, with a link to its search page with component:IDLE 
selected, and explanation of what to include in a bug report.
Before activating this, I would like to know what happens on a system where it 
does not work.  (The doc

--
assignee: terry.reedy
components: IDLE
messages: 412188
nosy: terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Make About IDLE links clickable
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2022-01-30 Thread Irit Katriel

Irit Katriel  added the comment:

Maybe I did something wrong. Will check tomorrow. In the meantime I’m updating 
the versions. Thanks for double checking.

--
resolution: out of date -> 
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2022-01-30 Thread Ned Deily


Ned Deily  added the comment:

> I tested 3.11 (on a Mac 11.6).

It still fails for me on current main HEAD (on 12.2 FWIW):

$ ./configure --prefix=/tmp/p
$ make -j6
$ mkdir /tmp/x
$ export PYTHONUSERBASE=/tmp/x/..
$ ./python -m test -w test_site test_sysconfig
Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 0.99 Run tests sequentially
0:00:00 load avg: 0.99 [1/2] test_site
test test_site failed -- multiple errors occurred; run in verbose mode for 
details
0:00:00 load avg: 0.99 [2/2/1] test_sysconfig -- test_site failed (2 failures)
test test_sysconfig failed -- Traceback (most recent call last):
  File 
"/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", 
line 314, in test_user_similar
self.assertEqual(user_path, expected)
^
AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11'
- /tmp/lib/python3.11
+ /tmp/x/../lib/python3.11
? +


test_sysconfig failed (1 failure)

== Tests result: FAILURE ==

2 tests failed:
test_site test_sysconfig
0:00:00 load avg: 0.99
0:00:00 load avg: 0.99 Re-running failed tests in verbose mode
0:00:00 load avg: 0.99 Re-running test_site in verbose mode (matching: 
test_get_path, test_s_option)
test_get_path (test.test_site.HelperFunctionsTests) ... FAIL
test_s_option (test.test_site.HelperFunctionsTests) ... FAIL

==
FAIL: test_get_path (test.test_site.HelperFunctionsTests)
--
Traceback (most recent call last):
  File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", 
line 209, in test_get_path
self.assertEqual(site._get_path(site._getuserbase()),
^
AssertionError: '/tmp/x/../lib/python/site-packages' != 
'/tmp/lib/python/site-packages'
- /tmp/x/../lib/python/site-packages
? -
+ /tmp/lib/python/site-packages


==
FAIL: test_s_option (test.test_site.HelperFunctionsTests)
--
Traceback (most recent call last):
  File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", 
line 218, in test_s_option
self.assertIn(usersite, sys.path)
^
AssertionError: '/tmp/x/../lib/python3.11/site-packages' not found in 
['/Users/nad/Projects/PyDev/active/dev/3x/source', '/tmp/p/lib/python311.zip', 
'/Users/nad/Projects/PyDev/active/dev/3x/source/Lib', 
'/Users/nad/Projects/PyDev/active/dev/3x/source/build/lib.macosx-12.2-x86_64-3.11',
 '/tmp/lib/python3.11/site-packages']

--
Ran 2 tests in 0.002s

FAILED (failures=2)
test test_site failed
0:00:00 load avg: 0.99 Re-running test_sysconfig in verbose mode (matching: 
test_user_similar)
test_user_similar (test.test_sysconfig.TestSysConfig) ... FAIL

==
FAIL: test_user_similar (test.test_sysconfig.TestSysConfig)
--
Traceback (most recent call last):
  File 
"/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", 
line 314, in test_user_similar
self.assertEqual(user_path, expected)
^
AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11'
- /tmp/lib/python3.11
+ /tmp/x/../lib/python3.11
? +


--
Ran 1 test in 0.001s

FAILED (failures=1)
test test_sysconfig failed
2 tests failed again:
test_site test_sysconfig

== Tests result: FAILURE then FAILURE ==

2 tests failed:
test_site test_sysconfig

2 re-run tests:
test_site test_sysconfig

Total duration: 350 ms
Tests result: FAILURE then FAILURE

--

___
Python tracker 

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

I tested 3.11 (on a Mac 11.6).

--

___
Python tracker 

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2022-01-30 Thread Ned Deily


Ned Deily  added the comment:

FWIW, I still see the same failures with 3.10.2 on a current macOS 12.2 system.

--
status: pending -> open

___
Python tracker 

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



[issue43320] test test_webbrowser "can't locate runnable browser" with enable-optimizations

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

3.8 is no longer maintained. Please create a new issue if you are seeing this 
problem on a current version (>= 3.9).

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



[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

I tested on a map and I only got the failure in test_s_option, which seems 
right because that directory is indeed not in sys.path.

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue29155] test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError:

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

3.6 is no longer maintained. Please create a new issue if you are seeing this 
problem on a current version (>= 3.9).

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



[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2022-01-30 Thread Ned Deily


Ned Deily  added the comment:

> Is there anything more to do here?

A belated response: probably not, so I'm OK with closing this.

A quick check shows that macOS behavior has changed a bit on more recent 
releases. On current macOS Big Sur (11.6.3) and Monterey (12.2) releases, Bo's 
test:

$ python3 -c 'import os; open(os.path.relpath("/tmp/test.txt"), "w")'

now works and Ronald's touch example now fails with a somewhat more meaningful 
message:

$ touch ../../foo.txt
touch: ../../foo.txt: Read-only file system

In general, though, even on pre-APFS older macOS systems, it is still best to 
avoid or at least be very careful about using /tmp with any sort of relative 
path testing because of the linking of /tmp to /private/tmp. :(

--

___
Python tracker 

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



[issue46590] I suggests to modify Include/object.h in 98 line

2022-01-30 Thread meow


Change by meow <4d656...@gmail.com>:


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



[issue30393] test_readline hangs

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

3.6 is no longer maintained. Please create a new issue if you are seeing this 
problem on a current version (>= 3.9).

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



[issue35081] Move internal headers to Include/internal/

2022-01-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-01-30 Thread STINNER Victor


Change by STINNER Victor :


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



[issue46590] I suggests to modify Include/object.h in 98 line

2022-01-30 Thread meow


Change by meow <4d656...@gmail.com>:


--
components:  -C API

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay, somebody can submit a PR!

--

___
Python tracker 

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



[issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors

2022-01-30 Thread STINNER Victor


STINNER Victor  added the comment:

https://devguide.python.org/#status-of-python-branches

--

___
Python tracker 

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



[issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors

2022-01-30 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.8 no longer accept bugfixes, I close this issue.

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



[issue46590] I suggests to modify Include/object.h in 98 line

2022-01-30 Thread meow


Change by meow <4d656...@gmail.com>:


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

___
Python tracker 

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



[issue46590] I suggests to modify Include/object.h in 98 line

2022-01-30 Thread meow


New submission from meow <4d656...@gmail.com>:

before version
#define Py_INVALID_SIZE (Py_ssize_t)-1

after version
#define Py_INVALID_SIZE ((Py_ssize_t)-1)

I think that the after version is more safety.
thanks to read this request.

--
components: C API
messages: 412175
nosy: 4d656f77
priority: normal
severity: normal
status: open
title: I suggests to modify Include/object.h in 98 line
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue46589] Improve documentation for typing._GenericAlias

2022-01-30 Thread Alex Waygood


Change by Alex Waygood :


--
assignee:  -> docs@python
components: +Documentation
keywords: +patch
nosy: +Jelle Zijlstra, docs@python, gvanrossum, kj
stage:  -> patch review

___
Python tracker 

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



[issue46374] Assertion failed in ceval.c

2022-01-30 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Did GH-30633 fix this? Is there further work to be done?

--
nosy: +erlendaasland
status: open -> pending

___
Python tracker 

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



[issue45990] Exception notes need more documentation

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

https://www.python.org/dev/peps/pep-0678/

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



[issue46558] Quadratic time internal base conversions

2022-01-30 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

Somebody pointed me to V8's implementation of str(bigint) today:

https://github.com/v8/v8/blob/main/src/bigint/tostring.cc

They say that they can compute str(factorial(1_000_000)) (which is 5.5 million 
decimal digits) in 1.5s:

https://twitter.com/JakobKummerow/status/1487872478076620800

As far as I understand the code (I suck at C++) they recursively split the 
bigint into halves using % 10^n at each recursion step, but pre-compute and 
cache the divisors' inverses.

--
nosy: +Carl.Friedrich.Bolz

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2022-01-30 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +29211
pull_request: https://github.com/python/cpython/pull/31030

___
Python tracker 

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



[issue46589] Improve documentation for typing._GenericAlias

2022-01-30 Thread Matthew Rahtz


New submission from Matthew Rahtz :

There's currently not much documentation in `typing.py` for `_GenericAlias`. 
Some fairly weird things go on in there, so it would be great to have more info 
in the class about what's going on and why various edge cases are necessary.

--
components: Library (Lib)
messages: 412171
nosy: matthew.rahtz
priority: normal
pull_requests: 29210
severity: normal
status: open
title: Improve documentation for typing._GenericAlias
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Eryk Sun

Eryk Sun  added the comment:

Why was it decided to not raise a syntax error when the NFKC normalization of a 
non-ASCII token matches a keyword? I don't see a use for cases such as `핚핗 = 1` 
and `핚핗 + 1`. It seems the cost in terms of confusion far outweighs any 
potential benefit.

--
nosy: +eryksun

___
Python tracker 

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



[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

Ok, I can definitely agree with Serhiy pov: "True" is a keyword that always 
evaluates to the object that you get when you call bool(1). There is usually no 
name "True" and directly assigning to it is forbidden. But there are various 
other ways to assign a name "True". One is eg globals("True") = 5, another one 
(discussed in this issue) is using identifiers that NFKC-normalize to the 
string "True".

--

___
Python tracker 

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



[issue46578] cant DEBUG os.spawnv()

2022-01-30 Thread Eryk Sun


Eryk Sun  added the comment:

> cmd310 = ["/LIBPATH:D:\\python310\\lib\\site-packages\\torch\\lib",

The `argv` parameter of os.spawnv() should begin with a command name to ensure 
that the application parses its command-line correctly. This doesn't 
necessarily have to be a file path since the `path` argument is what gets 
executed. For example, in this case I would use `cmd310 = ["link", ...]`.

That said, for various reasons, including the correct quoting of command-line 
arguments that contain spaces, I recommend that you use the subprocess module 
instead of os.spawnv(). For example, use `p = subprocess.run(cmd310, 
executable=executable)`. The first item of the argument list still needs to be 
"link" in this case. Or include the full path of "link.exe" at the start of 
cmd310, and use `p = subprocess.run(cmd310)`.

> But i cant DEBUG os.spawnv() on Pycharm.

In Windows, os.spawnv() is a builtin function from the nt extension module, 
defined in Modules/posixmodule.c. It is not defined in os.py. The C 
implementation is a minimal wrapper around the C runtime's _wspawnv() function 
[1]. Probably PyCharm isn't capable of debugging a builtin function.

---
[1] 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnv-wspawnv

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

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-01-30 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

https://docs.python.org/3/library/constants.html#built-in-constants

--

___
Python tracker 

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



[issue17206] Py_XDECREF() expands its argument multiple times

2022-01-30 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29209
pull_request: https://github.com/python/cpython/pull/30855

___
Python tracker 

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



[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

I'll close this in a week if there is no response. 

(It seems to have been abandoned by the OP after a minor code review 
disagreement if I understand their last comment.)

--
status: open -> pending

___
Python tracker 

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



[issue46585] Should we re-export `PyObj_FromPtr` in `ctypes`?

2022-01-30 Thread Eryk Sun


Eryk Sun  added the comment:

Alternatively, one can cast the address to py_object and dereference its 
`value`. For example:

>>> obj = bytearray(b'spam')
>>> sys.getrefcount(obj)
2
>>> obj2 = ctypes.cast(id(obj), ctypes.py_object).value
>>> obj2 is obj
True
>>> sys.getrefcount(obj)
3
>>> del obj2
>>> sys.getrefcount(obj)
2

--
nosy: +eryksun

___
Python tracker 

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



[issue46588] fix typo in test_calltip.py

2022-01-30 Thread Caio Agiani


Change by Caio Agiani :


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

___
Python tracker 

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



[issue46588] fix typo in test_calltip.py

2022-01-30 Thread Caio Agiani


Change by Caio Agiani :


--
components: Tests
nosy: caioagiani
priority: normal
severity: normal
status: open
title: fix typo in test_calltip.py
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors

2022-01-30 Thread ntrischi


ntrischi  added the comment:

Thanks for pointing out those PRs. I agree, this is not a security patch but it 
breaks the compilation process for users choosing to compile from source on 
Windows.

--

___
Python tracker 

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



[issue42390] Other Python implementations may not expose the module name in datetime type names

2022-01-30 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as the OP is unresponsive.

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

___
Python tracker 

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



[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2022-01-30 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue37091] subprocess - uncaught PermissionError in send_signal can cause hang

2022-01-30 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter

2022-01-30 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I think we could do it by looking at __qualname__.

--

___
Python tracker 

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



[issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors

2022-01-30 Thread Eryk Sun


Eryk Sun  added the comment:

PR 29396 and PR 29501 didn't get backported to 3.8 in November. Probably that 
was intentional since 3.8 only gets security fixes since 3.8.10, which was 
released in May. Supporting a newer build environment isn't a security issue. A 
core developer could make an exception for this case, so I'll leave this open 
for now.

--
components: +Windows
versions:  -Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

I agree that Jelle's proposal (Nikita's #2) looks best *if* we can implement it.

How do we ensure that

class A:
  ...

@no_type_check
class B:
  AA = A
  class C:
...
  ...

suppresses annotations in B and C but not in A?

--

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

1. Less change in behavior

2. From the purpose of the decorator, it makes sense for it to apply to nested 
classes as well as methods, even if the docs don't say so explicitly.

--

___
Python tracker 

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



[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-30 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 6.0 -> 7.0
pull_requests: +29206
pull_request: https://github.com/python/cpython/pull/31025

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Ken Jin, Jelle, can you please share your ideas why `(2)` is better than `(1)`?

--

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-01-30 Thread Alex Waygood


Change by Alex Waygood :


--
assignee: docs@python -> ethan.furman
nosy: +ethan.furman
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue46587] datetime and time tests use non-portal "%4Y" format

2022-01-30 Thread Christian Heimes


New submission from Christian Heimes :

Several test cases for datetime and time modules use the non-standard and 
non-portal width prefix for strftime:

>>> datetime.date(42, 1, 1).strftime("%4Y")
'0042'

According to man strftime(3) 
https://man7.org/linux/man-pages/man3/strftime.3.html the width field is 
glibc-specific extension:

> Glibc provides some extensions for conversion specifications.
> (These extensions are not specified in POSIX.1-2001, but a few
> other systems provide similar features.)  Between the '%'
> character and the conversion specifier character, an optional
> flag and field width may be specified.

The width field is not supported by Emscripten, which only implements 
POSIX.1-2001 compatible date and time formatting: 
https://github.com/emscripten-core/emscripten/blob/3.1.2/src/library.js#L735

Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 
14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf1412 on 
emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.date(42, 1, 1).strftime("%4Y")
'%4Y'

Also see bpo-13305

--
components: Tests
messages: 412157
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: datetime and time tests use non-portal "%4Y" format
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-01-30 Thread Dutcho


New submission from Dutcho :

https://docs.python.org/3.11/library/enum.html#module-contents contains:
property()
Allows Enum members to have attributes without conflicting with member names.

In above, property() is links to:
https://docs.python.org/3.11/library/functions.html#property
instead of to the proper:
https://docs.python.org/3.11/library/enum.html#enum.property

--
assignee: docs@python
components: Documentation
messages: 412156
nosy: Dutcho, docs@python
priority: normal
severity: normal
status: open
title: In documentation contents enum.property erroneously links to built-in 
property
versions: Python 3.11

___
Python tracker 

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



[issue46585] Should we re-export `PyObj_FromPtr` in `ctypes`?

2022-01-30 Thread Nikita Sobolev


New submission from Nikita Sobolev :

After looking at 
https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/ctypes/test/test_python_api.py#L5-L10
 in https://bugs.python.org/issue46584

it seems that we should address this comment:

```
# This section should be moved into ctypes\__init__.py, when it's ready.

from _ctypes import PyObj_FromPtr
```

by either:
1. Making `PyObj_FromPtr` public by re-exporting it from `ctypes`
2. Removing this comment

Arguments for `(1)`:
- It is quite widely used and there are a lot of articles mentioning it: 
https://www.programcreek.com/python/example/77012/_ctypes.PyObj_FromPtr and 
https://programtalk.com/python-examples/_ctypes.PyObj_FromPtr/ Basically, 
Google is filled with results.
- It looks useful for educational purposes.

I don't think that I am familiar with `ctypes`'s history well enough to make an 
educated dicision here.

But, I would love to work on this after this decision is made :)

--
components: ctypes
messages: 412155
nosy: amaury.forgeotdarc, belopolsky, meador.inge, sobolevn, zach.ware
priority: normal
severity: normal
status: open
title: Should we re-export `PyObj_FromPtr` in `ctypes`?
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue46584] Modernize `ctypes/test_python_api` by removing old version check

2022-01-30 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46584] Modernize `ctypes/test_python_api` by removing old version check

2022-01-30 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now Lib/ctypes/test/test_python_api.py has these lines:

```
if sys.version_info > (2, 4):
c_py_ssize_t = c_size_t
else:
c_py_ssize_t = c_int
```

Source: 
https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/ctypes/test/test_python_api.py#L13-L16

I think that there's no reason to keep code compat for python versions `<=2.3`. 
Other modules in CPython do refactor this by removing old and unused code, 
especially in tests.

I propose to do the same here.

--
components: Tests, ctypes
messages: 412154
nosy: amaury.forgeotdarc, belopolsky, meador.inge, sobolevn, zach.ware
priority: normal
severity: normal
status: open
title: Modernize `ctypes/test_python_api` by removing old version check
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Alex Waygood


Alex Waygood  added the comment:

I fully withdraw my suggestion of deprecating the decorator; it's evidently 
used more than I realised. I don't have any strong opinion on whether (1) or 
(2) would be a better solution.

--

___
Python tracker 

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



[issue39100] email.policy.SMTP throws AttributeError on invalid header

2022-01-30 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I confirmed I get the same error as Anton on 3.9 and 3.11 .

--

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Ken Jin


Ken Jin  added the comment:

I agree with Jelle, let's go with (2). It feels strange to have a decorator 
modify types that it doesn't own.

--

___
Python tracker 

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



[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Kodiologist


Kodiologist  added the comment:

> the builtin variable "True"

Is the existence of this entity, as separate from the constant `True`, 
documented anywhere? constants.rst doesn't seem to acknowledge it. Indeed, is 
its existence a feature, or is it a CPython quirk?

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Ken Jin


Ken Jin  added the comment:

Wow! Thanks, that's an interesting find. My hunch is that we should be passing 
in _typevar_types and _paramspec_tvars in the copy_with of _GenericAlias and 
_ConcatenateGenericAlias. Inconsistent copy_with could trigger subtle bugs in 
ForwardRefs and get_type_hints. I can reproduce a semi-bug right now:

>>> P = ParamSpec('P')
>>> Callable[P, int].__parameters__
(~P,)
>>> Callable[P, int].copy_with((P,int))
typing.Callable[~P, int]
>>> Callable[P, int].copy_with((P,int)).__parameters__
()
^ This shouldn't be empty!!

Would you like to submit a patch for this?

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
nosy: +sobolevn

___
Python tracker 

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



[issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check

2022-01-30 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check

2022-01-30 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now `selectors.py` contains this check on module-level:

```
if sys.version_info >= (3, 5):
   ...
```

Source: 
https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/selectors.py#L53

Learning from other modules, we tend to remove lines like this when some python 
version reaches EOL. And since 3.4 is not support for a long time now, this 
condition is always true.

I propose to delete it.

--
components: Library (Lib)
messages: 412148
nosy: asvetlov, sobolevn, yselivanov
priority: normal
severity: normal
status: open
title: Modernize `selectors.py` by removing unused `sys.version_info` check
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors

2022-01-30 Thread ntrischi


New submission from ntrischi :

Compiling Python3.8.9 from source on Windows 10 with VS2019. Running 
PCBuild\build.bat, I'm getting the following issue:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): 
error RC2188: 
C:\Python-3.8.9\PCbuild\obj\38amd64_Release\pythoncore\RCa09752(53) : fatal 
error RC1116: RC terminating after preprocessor errors 
[C:\Python-3.8.9\PCbuild\pythoncore.vcxproj]

I noticed this issue (https://bugs.python.org/issue45220) is closed but it 
doesn't seem to be resolved.

--
components: Build
messages: 412147
nosy: eric.snow, eryksun, lukasz.langa, miss-islington, ntrischi, paul.moore, 
serhiy.storchaka, sobolevn, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Windows builds fail: fatal error RC1116: RC terminating after 
preprocessor errors
type: compile error
versions: Python 3.10, Python 3.11, 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



[issue46400] Please update bundled libexpat to 2.4.4 with security fixes

2022-01-30 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +29203
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31022

___
Python tracker 

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



[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-30 Thread Alex Waygood


Alex Waygood  added the comment:

The desmper121 user appears to be a spammer; I am undoing all the changes they 
made to this BPO ticket.

--
nosy:  -barry, lys.nikolaou, pablogsal, r.david.murray, yselivanov
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



[issue43224] Add support for PEP 646

2022-01-30 Thread Matthew Rahtz


Change by Matthew Rahtz :


--
pull_requests: +29202
pull_request: https://github.com/python/cpython/pull/31021

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Alex Waygood


Change by Alex Waygood :


--
keywords:  -patch

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests:  -29201

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +gvanrossum, kj -miss-islington
stage: patch review -> 
type:  -> behavior

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Matt B


Matt B  added the comment:

Filed by request: 
https://github.com/python/cpython/pull/26091#issuecomment-1024900261

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +29201
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26091

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-01-30 Thread Matt B


New submission from Matt B :

c55ff1b352f8b82184f80d9dea220e832691acfc was submitted to fix #44098 and added 
the _typevar_types and _paramspec_tvars properties to _GenericAlias. However, 
those properties continue to be omitted from _GenericAlias.copy_with[1].

Further, typing.py is fairly intricate, which makes it hard to understand if 
that is the only place those properties are absent. A more careful review/audit 
may be in order.

[1]: 
https://github.com/python/cpython/blob/8b1b27f1939cc4060531d198fdb09242f247ca7c/Lib/typing.py#L1069-L1070

--
components: Library (Lib)
messages: 412144
nosy: posita
priority: normal
severity: normal
status: open
title: _typevar_types and _paramspec_tvars are missing from 
_GenericAlias.copy_with
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Christian Heimes


Christian Heimes  added the comment:

CPython's build system does not depend on setuptools.

The problem is that setuptools 60.0 introduced a .pth file and _distutils_hack 
to inject itself into Python import system. Under some circumstances Python's 
build system is affected by the hack and breaks.

--

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-01-30 Thread Matthew Rahtz


Change by Matthew Rahtz :


--
pull_requests: +29200
pull_request: https://github.com/python/cpython/pull/31019

___
Python tracker 

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



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

The problem is, that Python’s install target depends on the system-wide 
setuptools, if there is system-wide setuptools.  If there is no system-wide 
installed setuptools, apparently the installation works flawlessly.

The solution is to tweak the source code of Python, not to depend on 
(system-wide installed) Python code outside of Python’s tarball.

--

___
Python tracker 

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



[issue39100] email.policy.SMTP throws AttributeError on invalid header

2022-01-30 Thread Anton Khirnov


Anton Khirnov  added the comment:

Ping yet again. Can anyone please look at this?

--

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-01-30 Thread Matthew Rahtz


Change by Matthew Rahtz :


--
pull_requests: +29199
pull_request: https://github.com/python/cpython/pull/31018

___
Python tracker 

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



[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-30 Thread Barney Gale


Barney Gale  added the comment:

New users who want to add lines to a file will see this method and do:

for line in blah:
path.write_text(line, append=True)

Which repeatedly opens/closes the file. This is a foot-shotgun; it 
shouldn't be added to pathlib IMO.

--

___
Python tracker 

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



[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> The message is off

That's because the tokenizer sees the error before the parser even has time to 
see the other one. Not sure if is technically anything to fix here other than 
the order of reporting two different errors, which may be a bit tricky to fix.

--

___
Python tracker 

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



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Christian Heimes


Christian Heimes  added the comment:

You are affected by setuptools bug 
https://github.com/pypa/setuptools/issues/3007 . The setuptools issues has a 
workaround. The next version of setuptools will come with a fix.

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



[issue46580] email.utils.unquote strips too many slashes

2022-01-30 Thread hbandi


New submission from hbandi :

email.utils.unquote currently unescapes all backslashes, then unescapes all 
double quotes in the resulting string. it may removes too many backslashes. see 
GH PR for an example.

--
components: email
messages: 412137
nosy: barry, hbandi, r.david.murray
priority: normal
pull_requests: 29198
severity: normal
status: open
title: email.utils.unquote strips too many slashes
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-01-30 Thread Georg Brandl


Georg Brandl  added the comment:

Sure!

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-01-30 Thread Julien Palard


Julien Palard  added the comment:

> You gave me a small shock, but I checked and it was only 11/12 years ago :D

HAha! Either I misstyped 12 as 21, either I'm bad at math, sorry for the shock 
;)

> I'm fine with moving this out of tree; please coordinate with the Sphinx 
> maintainers whether it should be an "official" extension or completely 
> separate.

They propose [1] to have it in sphinx-contrib ("A collection of Sphinx 
extensions maintained by their respective authors. It is not an official part 
of Sphinx."), what do you think?

[1] https://github.com/sphinx-doc/sphinx/issues/10143#issuecomment-1025093280

--

___
Python tracker 

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



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Дилян Палаузов

New submission from Дилян Палаузов :

I compile python from source:

$ python --version
Python 3.10.1+
$ cat /etc/config.site 
ax_cv_c_float_words_bigendian=no
enable_silent_rules=yes
$ git describe 
v3.10.2-74-ga5451c96a1
$ ./configure --enable-loadable-sqlite-extensions --disable-ipv6 
--with-system-expat --with-system-libmpdec --enable-shared
$ make
gcc -c -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden  -I./Include/internal  -I. -I./Include   -fPIC 
-DPy_BUILD_CORE -o Modules/_math.o Modules/_math.c
LD_LIBRARY_PATH=/git/cpython CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG 
-g -fwrapv -O3 -Wall'_TCLTK_INCLUDES='-I/usr/local/include' 
_TCLTK_LIBS='-L/usr/local/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6'
 ./python -E ./setup.py  build
Traceback (most recent call last):
  File "/git/cpython/./setup.py", line 50, in 
from distutils.command.install import install
  File 
"/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/install.py",
 line 20, in 
from .. import _collections
  File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 
16, in 
import setuptools.version
  File "/usr/local/lib/python3.10/site-packages/setuptools/version.py", line 1, 
in 
import pkg_resources
  File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", 
line 23, in 
import zipfile
  File "/git/cpython/Lib/zipfile.py", line 6, in 
import binascii
ModuleNotFoundError: No module named 'binascii'
make: *** [Makefile:637: sharedmods] Error 1


When I compiled python 3.10 using python 3.8 one or two months ago, there was 
no such problem.

Compiling python from source code, shall use the bundled distutils, not the 
installed one.

My Linux From Scratch system appears not to have module binascii:

$ locate binascii
/usr/local/lib/python3.10/lib-dynload/binascii.cpython-310-x86_64-linux-gnu.so
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-1.pyc
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-2.pyc
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.pyc
/usr/local/lib/python3.10/test/test_binascii.py
/usr/local/lib/python3.8/lib-dynload/binascii.cpython-38-x86_64-linux-gnu.so
/usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/@python2/binascii.pyi
/usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/binascii.pyi
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-1.pyc
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-2.pyc
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.pyc
/usr/local/lib/python3.8/test/test_binascii.py
/git/cpython/Modules/binascii.c
/git/cpython/Modules/clinic/binascii.c.h
/git/cpython/Lib/test/test_binascii.py
/git/cpython/Doc/library/binascii.rst

--
components: Installation
messages: 412134
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: Compiling from source prints «ModuleNotFoundError: No module named 
'binascii'»
type: compile error
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



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-30 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +29197
pull_request: https://github.com/python/cpython/pull/31015

___
Python tracker 

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



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-30 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

If a decent parallelism CI systems are not available from github (they seem 
stuck at 2-3 threads per 
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners),
 an alternative approach could be to shard across multiple parallel CI tasks. 
Shard such that each one gets only one of the slow tests.

Unfortunately if each of these were a line item in Github's poor CI UI sharding 
a single config's tests across 5-10 tasks would be a nightmare to navigate on a 
PR.  I expect everyone would hate that.

Providing our own runners with decent parallelism could help: 
https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners

But we're always going to be bound by our longest tail test if we don't fix our 
test parallelism to be more granular.

--

___
Python tracker 

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



[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-30 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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