[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread miss-islington


miss-islington  added the comment:


New changeset b952f60213c60f89a50e4538783a18ced64ca91f by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45772: socket.socket should be a class instead of a function 
(GH-23960) (GH-29543)
https://github.com/python/cpython/commit/b952f60213c60f89a50e4538783a18ced64ca91f


--

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread miss-islington


miss-islington  added the comment:


New changeset 3f15792d60011639d9b170d8a76c6db7f6e83665 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45772: socket.socket should be a class instead of a function 
(GH-23960) (GH-29542)
https://github.com/python/cpython/commit/3f15792d60011639d9b170d8a76c6db7f6e83665


--

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread Oleg Iarygin


Change by Oleg Iarygin :


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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +27790
pull_request: https://github.com/python/cpython/pull/29542

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27791
pull_request: https://github.com/python/cpython/pull/29543

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27792
pull_request: https://github.com/python/cpython/pull/29544

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 4c792f39e688b11c7c19e411ed4f76a7baa44638 by Hong Xu in branch 
'main':
bpo-45772: socket.socket should be a class instead of a function (GH-23960)
https://github.com/python/cpython/commit/4c792f39e688b11c7c19e411ed4f76a7baa44638


--
nosy: +asvetlov

___
Python tracker 

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



[issue45755] Specialized generic class does not return class attributes in dir

2021-11-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be an issue with typing than mock since mock just uses the output 
from dir() . I am not able to bisect the relevant change but below is the 
output of dir(Foo[int]) in Python 3.6 and master.

Python 3.6.9

['__abstractmethods__', '__args__', '__class__', '__delattr__', '__dict__', 
'__dir__', '__doc__', '__eq__', '__extra__', '__format__', '__ge__', 
'__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', 
'__le__', '__lt__', '__module__', '__ne__', '__new__', '__next_in_mro__', 
'__orig_bases__', '__origin__', '__parameters__', '__reduce__', 
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', 
'__str__', '__subclasshook__', '__tree_hash__', '__weakref__', '_abc_cache', 
'_abc_generic_negative_cache', '_abc_generic_negative_cache_version', 
'_abc_registry', '_gorg', 'bar']


master branch : 

['__args__', '__call__', '__class__', '__delattr__', '__dict__', '__dir__', 
'__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', 
'__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', 
'__instancecheck__', '__le__', '__lt__', '__module__', '__mro_entries__', 
'__ne__', '__new__', '__or__', '__origin__', '__parameters__', '__reduce__', 
'__reduce_ex__', '__repr__', '__ror__', '__setattr__', '__sizeof__', 
'__slots__', '__str__', '__subclasscheck__', '__subclasshook__', '__weakref__', 
'_inst', '_name', '_paramspec_tvars', '_typevar_types', 'copy_with']

--
nosy: +gvanrossum, kj
title: Mock spec with a specialized generic class does not mock class 
attributes -> Specialized generic class does not return class attributes in dir

___
Python tracker 

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



[issue45292] Implement PEP 654: Exception Groups

2021-11-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The tests emit some deprecation warnings : 

PYTHONWARNINGS=always ./python -Wall -m test test_exception_group
0:00:00 load avg: 0.39 Run tests sequentially
0:00:00 load avg: 0.39 [1/1] test_exception_group
/home/karthikeyan/stuff/python/cpython/Lib/test/test_exception_group.py:41: 
DeprecationWarning: invalid escape sequence '\('
  MSG = 'second argument \(exceptions\) must be a sequence'
/home/karthikeyan/stuff/python/cpython/Lib/test/test_exception_group.py:47: 
DeprecationWarning: invalid escape sequence '\('
  MSG = 'second argument \(exceptions\) must be a non-empty sequence'
/home/karthikeyan/stuff/python/cpython/Lib/test/test_exception_group.py:52: 
DeprecationWarning: invalid escape sequence '\('
  MSG = ('Item [0-9]+ of second argument \(exceptions\)'

== Tests result: SUCCESS ==

1 test OK.

Total duration: 51 ms
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread Ned Deily


Ned Deily  added the comment:

> Would osx_framework_user scheme for macOS be a satisfactory entry?

Yes, it should be there.

--

___
Python tracker 

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



[issue44995] "Hide the prompts and output" works abnormal

2021-11-12 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +newcomer friendly

___
Python tracker 

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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread Catherine Holloway


Catherine Holloway  added the comment:

Hey thanks Ned, sysconfig was exactly what I was looking for when I was reading 
the sys documentation.

--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On pydev, Guido said "There was talk of deprecating colorsys, but PEP 594 now 
lists it under "modules to keep".  Victor, do you know enough to review?

--

___
Python tracker 

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



[issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15

2021-11-12 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've looked into this and the hang happens on this line:

https://github.com/python/cpython/blob/de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d/Lib/test/test_builtin.py#L2030

So the issue is that on the second run, there's nothing to read on that fd. 
I've tried using os.stat to check if there's data on the fd, but it returned 0 
data in both 1st and 2nd runs.

However, if a small sleep is added before running os.stat, it does return size 
of data on 1st run and returns 0 on 2nd run, meaning it's possible to avoid the 
hang and error out instead (is that an improvement?)

This is on MacOS 11.4 Big Sur by the way.

This is my test debug branch:

https://github.com/python/cpython/compare/main...akulakov:Test-check_input_tty-FIX?expand=1

--
nosy: +andrei.avk, kj

___
Python tracker 

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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ned, I like your idea.  In particular, link to sysconfig.get_paths for how 
prefix is used on a particular machine to define installation paths.

Sidenote:
https://docs.python.org/3/library/sysconfig.html#installation-paths
says "Python currently supports seven schemes:" and lists 5  get_scheme_names 
list 6, with the extra one being
'osx_framework_user'.  Would
  osx_framework_user: scheme for macOS
be a satisfactory entry?

--

___
Python tracker 

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



[issue45764] Parse error improvement forgetting ( after def

2021-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Normally we don't backport new errors to old versions so we can close this. 
Thanks for the ping!

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



[issue45742] python -h can't find -R option

2021-11-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Which doc is wrong?

Currently -R overrides a non-zero seed value in PYTHONHASHSEED. The behavior 
changed in 3.7. Either the docs or the behavior need to be fixed. To repeat my 
previous example (this time in Windows):

C:\>set PYTHONHASHSEED=37

C:\>py -3.6 -c "print(hash('spam'))"
-1810080452065497889
C:\>py -3.6 -Rc "print(hash('spam'))"
-1810080452065497889

C:\>py -3.7 -c "print(hash('spam'))"
-1810080452065497889
C:\>py -3.7 -Rc "print(hash('spam'))"
-7199637890859510937

C:\>py -3.10 -Rc "print(hash('spam'))"
7684061207513636658

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Also all those files are 0 bytes - even the working ones.

The files should have no data, just appexec links. It's just an empty file if 
there's no link set.

> Since I cannot even run the actual executable there seems to be 
> an issue with the executables on top of the broken appexec link.

The executable under "%ProgramFiles%\WindowsApps" can only be executed 
unconditionally by processes that are running as SYSTEM, LOCAL SERVICE, or 
NETWORK SERVICE. Otherwise it requires an access token that contains a 
WIN://SYSAPPID security attribute that contains the package name. When 
executing an appexec link from the user's local "WindowsApps", CreateProcessW() 
uses the information in the link to construct this access token, and the call 
basically becomes CreateProcessAsUserW(hToken, ...). The EXEs and DLLs in the 
package can be executed from within the app itself. For example, 
subprocess.call('python') directly spawns the app's "python.exe". 

FYI, an access token is a kernel object that defines a security context, 
including the user, groups, privileges, capabilities, integrity level, trust 
level, security attributes, claim attributes, default owner, default 
permissions, associated logon session, and associated Windows session. Every 
process must have a primary token, which is permanently associated with the 
process. Each thread within a process may have an impersonation token, which is 
temporarily associated with the thread until it's replaced or removed.

> That didn't work. The link is wrong on the disk and that 
> setting just controls the usage of it not the creation.

Yes, the links in the app's subdirectory of the local "WindowsApps" are the 
basis for the ones that get created in the local WindowsApps when the alias is 
enabled. The system reads the source reparse point via FSCTL_GET_REPARSE_POINT 
and sets it on an empty file via FSCTL_SET_REPARSE_POINT. If the source appexec 
link is wrong or missing, then disabling and enabling the alias won't help. 

>From the end user's perspective, the simplest solution is to uninstall the 
>app; make sure its subdirectory is removed from the local "WindowsApps" (e.g. 
>"%LocalAppData%\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0");
> and install the app again.

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Steve Dower


Steve Dower  added the comment:

You're right. You probably need to uninstall and reinstall for the 
subdirectories of WindowsApps.

--

___
Python tracker 

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



[issue45797] AMD64 Arch Linux Asan Debug buildbot sometimes hangs before tests complete

2021-11-12 Thread STINNER Victor


New submission from STINNER Victor :

Example:

AMD64 Arch Linux Asan Debug 3.10:
https://buildbot.python.org/all/#/builders/621/builds/351

(...)
1:13:40 load avg: 1.85 [420/421/1] test_reprlib passed
1:13:41 load avg: 1.85 [421/421/1] test_funcattrs passed
command timed out: 1200 seconds without output running [b'make', 
b'buildbottest', b'TESTOPTS=-j1 -x test_ctypes test_capi test_crypt 
test_decimal test_faulthandler test_interpreters --junit-xml test-results.xml 
${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', b'TESTTIMEOUT=900'], attempting to 
kill
make: *** [Makefile:1255: buildbottest] Terminated
process killed by signal 15
program finished with exit code -1
elapsedTime=5623.934168


Can it be related to bpo-45200 "Address Sanitizer: libasan dead lock in 
pthread_create() (test_multiprocessing_fork.test_get() hangs)"?

--
components: Tests
messages: 406256
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: AMD64 Arch Linux Asan Debug buildbot sometimes hangs before tests 
complete
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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, with recent file movement, is "while the platform independent header 
> files (all except pyconfig.h) are stored in prefix/include" still true?

Are you talking about Include/cpython/ and Include/internal/ subdirectories?

> Should 'include' be augmented with 'or its subdirectories'?

You can add it if you want.

--

___
Python tracker 

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



[issue45742] python -h can't find -R option

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> I input python -h on the command line, and I can't find any -R option.

If you want to document it, the "usage" is in Python/initconfig.c. See also the 
-R option. My notes on adding a command line option:
https://pythondev.readthedocs.io/pyconfig.html#add-a-new-command-line-option

> Victor, A sentence about hash randomization you wrote for #32329 in PR-4873 
> is not currently correct.  Change code or doc?

In Python/initconfig.c, the -R option sets config->use_hash_seed to 0. It 
overrides PYTHONHASHSEED env var, as documented at:
https://docs.python.org/3.10/using/cmdline.html#cmdoption-R

IMO it's the expected behavior. Cmd line must have the priority over env vars.

Which doc is wrong?

--

___
Python tracker 

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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread Ned Deily


Ned Deily  added the comment:

Which installations paths are used varies on other factors besides platform. 
Rather than duplicate information here, I suggest simplifying the sys.prefix 
doc here by removing the details about installation paths and instead refer to 
the Installation Paths section of the sysconfig module documentation, which 
should be the primary reference for this info:

https://docs.python.org/3/library/sysconfig.html#installation-paths

--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread STINNER Victor

STINNER Victor  added the comment:

> A link to an authoritative reference with the formulas would be necessary to 
> merge this.

The PR says: "ATSC BT.709 standard constants".

For exmaple, I found:
https://en.wikipedia.org/wiki/Rec._709#Luma_coefficients

"When encoding Y’CBCR video, BT.709 creates gamma-encoded luma (Y’) using 
matrix coefficients 0.2126, 0.7152, and 0.0722 (together they add to 1)."

--
nosy: +vstinner

___
Python tracker 

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



[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Verified in IDLE also.  Thanks for doing the test I should have done.

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



[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Andre Roberge


Andre Roberge  added the comment:

What version are you using?  As far as I can test, it has become a syntax error 
since 3.10. Here is the result with the latest 3.11 alpha

> python
Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov  5 2021, 20:00:05) [MSC v.1929 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> del __debug__
  File "", line 1
SyntaxError: cannot delete __debug__
>>> exit()

> python
Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov  5 2021, 20:00:05) [MSC v.1929 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> def f():
...del __debug__
...
  File "", line 2
SyntaxError: cannot delete __debug__

--
nosy: +aroberge

___
Python tracker 

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



[issue45788] Doc sys.prefix lib & include directories on Windows and Mac

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Windows, I believe the correct sentence would be "On Windows, they are in 
prefix/Lib and prefix/include".  Ned, how to complete "On macOS, they are in ?."

Victor, with recent file movement, is "while the platform independent header 
files (all except pyconfig.h) are stored in prefix/include" still true?  In 
what way is pyconfig.h exceptional?  Should 'include' be augmented with 'or its 
subdirectories'?

--
nosy: +ned.deily, steve.dower, terry.reedy, vstinner
stage:  -> needs patch
title: sys.prefix include directory on Windows -> Doc sys.prefix lib & include 
directories on Windows and Mac
type: enhancement -> behavior
versions: +Python 3.11 -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



[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For comparison:

True = 0
SyntaxError: cannot assign to True
del True
SyntaxError: cannot delete True

It almost seems like __debug__ is a hidden keyword value, but with a 
startup-dependent value

--
components: +Interpreter Core
nosy: +pablogsal, terry.reedy
stage:  -> test needed
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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A link to an authoritative reference with the formulas would be necessary to 
merge this.  I inquired of pydev list whether improvement is allowed.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Filter, map, and zip are documented as functions to allow other interpreters to 
implement them as such, with generator functions.  That does not apply here, 
but maybe there is another reason for socket being called a 'function.

Antoine, git blame credits you with socket.rst, line 565
.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
https://docs.python.org/3/library/socket.html#socket.socket

PR-23960 changes 'function' to 'class'.  What do you think?

--
nosy: +pitrou, terry.reedy
stage:  -> patch review
type:  -> behavior
versions:  -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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

All typing related tests are fixed by updating 
types.GenericAlias.__getattribute__. So the only thing is left to make all 
tests passed is removing some special methods tests.

The lookup of __instancecheck__ and __subclasscheck__ was changed by Benjamin 
in fb6fb062e8f677dd63943f3a4b8a45c6665b3418. It looks like deliberate change. 
Benjamin, do you remember the reasons of the original change?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue45764] Parse error improvement forgetting ( after def

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Pablo, did you intend to backport to 3.10 or should this be closed?

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



[issue45762] Missing `list` symbols in the object inventory

2021-11-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +eric.araujo, ezio.melotti, mdk, willingc
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue45796] Using tab to cycle through tkinter widgets breaks foreground styling

2021-11-12 Thread Chris Eykamp


New submission from Chris Eykamp :

Attached is a slightly modifed example of the code sample in Bryan Oakley's 
response to:

https://stackoverflow.com/questions/30337351/how-can-i-ensure-my-ttk-entrys-invalid-state-isnt-cleared-when-it-loses-focus

I have modified it by changing the style.map to change the widget's foreground 
color (rather than background), and by adding a button below the text input.

Typing a string containing "invalid" into the textbox causes it to fail 
validation (its state is shown in the bottom label, updated every second).  As 
expected, the foreground changes to red.

However, if I use [tab] to toggle between the elements, the foreground of the 
text entry gets changed to black, even if the item is invalid.

Adding 
style.map("TEntry",  selectforeground=[('invalid', "green")])
creates a new set of weirdness, where the invalid text becomes green when 
tabbing through the widgets.


I'm running on Windows 10, Python 3.83.

--
components: Tkinter
files: simple.py
messages: 406242
nosy: watusimoto
priority: normal
severity: normal
status: open
title: Using tab to cycle through tkinter widgets breaks foreground styling
versions: Python 3.8
Added file: https://bugs.python.org/file50437/simple.py

___
Python tracker 

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



[issue45796] Using tab to cycle through tkinter widgets breaks foreground styling

2021-11-12 Thread Chris Eykamp


Chris Eykamp  added the comment:

I'll add that when the red text incorrectly turns black, on my display, I can 
see a very subtle red halo, as if the text is being printed first as red, then 
as black in a second pass.

--

___
Python tracker 

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



[issue45761] recursive ProcessPoolExecutor invoke unable to return result

2021-11-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +bquinlan, pitrou

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

That didn't work. The link is wrong on the disk and that setting just controls 
the usage of it not the creation.

--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Should we just remove ' array,' from things that cannot be copied, or does this 
need more discussion?

--
keywords: +easy, newcomer friendly
nosy: +lukasz.langa, terry.reedy
versions:  -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



[issue45742] python -h can't find -R option

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Victor, A sentence about hash randomization you wrote for #32329 in PR-4873 is 
not currently correct.  Change code or doc?

--
nosy: +terry.reedy, vstinner

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-12 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d by Irit Katriel in 
branch 'main':
bpo-45711: assert that the type of exc_info is redundant (GH-29518)
https://github.com/python/cpython/commit/de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d


--

___
Python tracker 

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



[issue45732] Make python.org Windows and macOS installers use Tk 8.6.12

2021-11-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Update python.org Windows and macOS installers to use Tk 8.6.12 -> Make 
python.org Windows and macOS installers use Tk 8.6.12

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

I believe that the PEP 3119 example doesn't work (I've confirmed something
simpler) but I have a feeling that the uses of __instancecheck__ in
typing.py are actually okay. For example, isinstance(42, typing.Any)
correctly calls _SpecialForm.__instancecheck__ -- because Any is not a
type, it's an instance of typing._SpecialForm so it all works out
correctly. (I haven't checked out the other -- @Serhiy do you have time to
look into that one?)

--

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> I will be able to take a look later in the weekend

Please take some time for yourself, I added you as you were the original author 
of the patch to make you aware. I believe most projects can workaround that for 
now.

--

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +BTaskaya, lys.nikolaou

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will be able to take a look later in the weekend, so if someone is able to 
give it a go before, that would be great.

--

___
Python tracker 

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



[issue37824] IDLE: Handle Shell input SyntaxWarning & DeprecationWarning

2021-11-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Might want to special case running certain console commands in Shell, such as 
'pip install'.
https://stackoverflow.com/questions/69936921/packages-not-installing-in-idle-shell
SyntaxError: invalid syntax. Perhaps you forgot a comma?

--

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e4c5a5eabadd1dcd0b522ffbd70157cd95506ad1 by Miss Islington (bot) 
in branch '3.10':
bpo-45235:  Revert an argparse bugfix that caused a regression (GH-29525) 
(GH-29530)
https://github.com/python/cpython/commit/e4c5a5eabadd1dcd0b522ffbd70157cd95506ad1


--

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I've restored the prior state of affairs.

Leaving this issue open because it still isn't clear what should be guaranteed 
or whether further improvements need to be made.

--
priority: high -> normal

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 587ff7f50bcbfd8346c6d5db459a1628a350c04d by Miss Islington (bot) 
in branch '3.9':
bpo-45235:  Revert an argparse bugfix that caused a regression (GH-29525) 
(GH-29531)
https://github.com/python/cpython/commit/587ff7f50bcbfd8346c6d5db459a1628a350c04d


--

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's an example in PEP 3119 that appears to work but actually bypasses the 
method:

from abc import ABCMeta, abstractmethod

class Sized(metaclass=ABCMeta):
@abstractmethod
def __hash__(self):
return 0
@classmethod
def __instancecheck__(cls, x):
print('Called')
return hasattr(x, "__len__")
@classmethod
def __subclasscheck__(cls, C):
return hasattr(C, "__bases__") and hasattr(C, "__len__")

$ python3.10 -i demo_3119.py
>>> isinstance([], Sized)
True

--

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Most of failed tests are related to typing, but there is a purposed test for 
__instancecheck__ and __subclasscheck__ bypassing __getattr__ and 
__getattribute__ 
(test.test_descr.ClassPropertiesAndMethods.test_special_method_lookup).

--

___
Python tracker 

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



[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-12 Thread Victor Milovanov


Victor Milovanov  added the comment:

I think documentation should clarify that. Right now this line in the docs got 
me thinking that anything with an external strong reference won't be 
deallocated: "Memory tied up in circular references between objects is not 
freed."

--
status: pending -> open

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I did a scan of the standard library and code in the wild.  It looks like 
almost all uses are in metaclasses (which makes sense because that matches the 
AppendableSequence example in PEP 3119).

However, the typing module does have some cases of __instancecheck__ being used 
in regular classes.  AFAICT that code is completely inoperative and there is no 
way for it to ever get called by isinstance().

I think people who __instancecheck__ in regular classes aren't noticing that 
their code isn't being called at all.  The likely reasons are that isinstance() 
has a fast path for exact type matches and type() defines an __instancecheck__ 
in a reasonable way.  So unless someone tests a case not already covered by 
those two paths, they won't notice the dead code.

The two cases in typing.py are _Final and _BaseGenericAlias.  The 
__instancecheck__ methods in those were written by Ivan and by GvR likely with 
the expectation that that code would by called by isinstance().

--

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Failed tests:

==
FAIL: test_isinstance_with_or_union 
(test.test_isinstance.TestIsInstanceIsSubclass)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_isinstance.py", line 223, in 
test_isinstance_with_or_union
with self.assertRaises(TypeError):
^^
AssertionError: TypeError not raised

==
FAIL: test_isinstance (test.test_genericalias.BaseTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_genericalias.py", line 249, in 
test_isinstance
with self.assertRaises(TypeError):
^^
AssertionError: TypeError not raised

==
FAIL: test_issubclass (test.test_genericalias.BaseTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_genericalias.py", line 255, in 
test_issubclass
with self.assertRaises(TypeError):
^^
AssertionError: TypeError not raised

==
FAIL: test_callable_instance_type_error 
(test.test_typing.CollectionsCallableTests)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_typing.py", line 490, in 
test_callable_instance_type_error
with self.assertRaises(TypeError):
^^
AssertionError: TypeError not raised

==
FAIL: test_self_subclass (test.test_typing.CollectionsCallableTests)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_typing.py", line 446, in 
test_self_subclass
with self.assertRaises(TypeError):
^^
AssertionError: TypeError not raised

==
FAIL: test_special_method_lookup (test.test_descr.ClassPropertiesAndMethods)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_descr.py", line 2097, in 
test_special_method_lookup
runner(X())
^^^
  File "/home/serhiy/py/cpython/Lib/test/test_descr.py", line 2032, in 
do_isinstance
return isinstance(int, obj)
   
  File "/home/serhiy/py/cpython/Lib/test/test_descr.py", line 2077, in 
__getattribute__
test.fail("__getattribute__ called with {0}".format(attr))
^^
AssertionError: __getattribute__ called with __instancecheck__

--

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Steve Dower


Steve Dower  added the comment:

> Could it be possible that it might not be able to replace that link when it 
> is currently in use?

That (or something like that) would be my suspicion. It's happened 
before, though as Eryk Sun says the link itself does not remain in use 
very long at all.

I think we've collected enough data about the broken link. You should be 
able to disable and re-enable the execution alias to get the correct one.

--

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Note that with the following example, exec and CommandCompiler return a 
different error:

from codeop import CommandCompiler

# identical errors
#exec('1,\\#\n2') SystemError
#CommandCompiler()('1,\\#\n2', symbol='exec') SystemError

# one is syntax the other is System.
exec('a \ \n')  # SyntaxError
CommandCompiler()('a \ \n', symbol='exec') # SystemError

--

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Yep, this also break IPython command completions when users press tab in some 
places in multiline code.

88f4ec88e282bf861f0af2d237e9fe28fbc8deac is the first offending commit for me 
in the 3.9 branch:

[3.9] bpo-45494: Fix parser crash when reporting errors involving invalid 
continuation characters (GH-28993) (#29071)

There are two errors that this commit fixes:

* The parser was not correctly computing the offset and the string
  source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
  exception happened in rules involving optionals ('?', [...]) as we
  always make them return valid results by using the comma operator. We
  need to check first if we don't have an error before continuing..
(cherry picked from commit a106343f632a99c8ebb0136fa140cf189b4a6a57)

Co-authored-by: Pablo Galindo Salgado 

NOTE: unlike the cherry-picked original, this commit points at a crazy 
location
due to a bug in the tokenizer that required a big refactor in 3.10 to fix.
We are leaving as-is for 3.9.

--
nosy: +mbussonn

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +pablogsal

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, I discovered the issue when experimenting with ways to use the class 
pattern in structural pattern matching.


--- Code that should work but doesn't ---

class Warm:
def __instancecheck__(cls, inst):
return inst in {'red', 'orange', 'blue'}
  
match 'red':
case Warm():  # This doesn't match but should
print('Glowing')


--- What you have to do to get it to work ---

class MetaWarm(type):
def __instancecheck__(cls, inst):
return inst in {'red', 'orange', 'blue'}

class Warm(metaclass=MetaWarm):
pass

match 'red':
case Warm():  # This matches
print('Hot')

--

___
Python tracker 

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



[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
title: __instancecheck__ being checked of type(cls) instead of cls -> 
__instancecheck__ being checked on type(cls) instead of cls

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

The "python3.9.exe" link is that one also points to the earlier version. All 
other links are fine.

Also all those files are 0 bytes - even the working ones.

Since I cannot even run the actual executable there seems to be an issue with 
the executables on top of the broken appexec link.

I also checked the actual executables and they are binary identical as well as 
having the identical permissions and timestamps.

--

___
Python tracker 

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



[issue45795] urllib http client vulnerable to DOS attack

2021-11-12 Thread Muhammad Farhan


New submission from Muhammad Farhan :

Hi, During my recent tests I have discovered that the urllib http client 
(urllib.request.urlopen()) is vulnerable to DOS attack using a simple but 
effective trick.

I am attaching a file named server.py download it and run it using latest 
version of python. After running it execute the following python code in python 
interactive mode. (python -i)

import urllib.request
request = urllib.request.Request('http://127.0.0.1:1338')
response = urllib.request.urlopen(req, timeout=1)

DOS limit: We can achieve DOS for unlimited time.
 
How to fix?
Implement a good logic for timeout in urllib.request.urlopen(url, timeout). 
Timeout value should not be reset after client receives a data(bytes), because 
it can easily be abused to achieve DOS.

--
components: Library (Lib)
files: server.py
messages: 406220
nosy: haqsek2
priority: normal
severity: normal
status: open
title: urllib http client vulnerable to DOS attack
type: security
versions: Python 3.10
Added file: https://bugs.python.org/file50436/server.py

___
Python tracker 

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



[issue45791] __instancecheck__ being checked of type(cls) instead of cls

2021-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm torn. It's been like this for a very long time and Serhiy's reasoning makes 
some sense.

OTOH it *does* make more sense as it's written in the PEP. The basic idea is 
"the class has control over what is considered an instance of it" and it would 
be nice if this didn't require writing a metaclass. (Metaclasses are often 
problematic.)

As an experiment, could you implement the proposed behavior and see what fails 
in e.g. the stdlib or the test suites of the 100 most popular packages?

--

___
Python tracker 

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



[issue45745] ./python -m test --help output for refleaks seems wrong

2021-11-12 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



[issue45745] ./python -m test --help output for refleaks seems wrong

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9d3271438431c37c29c359f5b73e8094b5f82912 by Victor Stinner in 
branch 'main':
bpo-45745: Remove regrtest --findleaks options (GH-29514)
https://github.com/python/cpython/commit/9d3271438431c37c29c359f5b73e8094b5f82912


--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun


Eryk Sun  added the comment:

> The python3.9.exe file in the WindowsApps folder looks like 
> a real executable and not a link.

As requested, and as shown in the output, you tested the file in Python 3.9's 
subdirectory of "WindowsApps", not in "WindowsApps" itself.

If the size in the `dir` output is 0 bytes, then it's an empty file without a 
reparse point. That would explain the stale link in the parent "WindowsApps" 
directory, since there's no source reparse point to clone. It doesn't explain 
why some of the links in the app's subdirectory weren't created correctly.

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

The python3.9.exe file in the WindowsApps folder looks like a real executable 
and not a link. The script also backs that

python3 read_appexec.py "c:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0\python3.9.exe"
Traceback (most recent call last):
  File "s:\Downloads\read_appexec.py", line 74, in 
link = read_appexec_link(sys.argv[1])
  File "s:\Downloads\read_appexec.py", line 66, in read_appexec_link
raise ctypes.WinError(ctypes.get_last_error())
OSError: [WinError 4390] The file or directory is not a reparse point.

Although I did this as Administrator so I can successfully list the directory I 
am not able to run that executable. It fails with "Access is denied.". Others 
are working fine.

idle3.9.exe - works
pip3.9.exe - works
python.exe - Access is denied.
python3.9.exe - Access is denied.
pythonw.exe - Access is denied.
pythonw3.9.exe - works

I opened both pythonw* files in the old "Dependency Walker" and it loaded them 
both fine and the dependencies appear to be identical by just taking a short 
look beside it not showing anything suspicious in them. The non-suffix version 
didn't run with "Failure starting the process. Access is denied (5).".

--

___
Python tracker 

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



[issue28533] Remove asyncore, asynchat and smtpd modules

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

See also the (dfaft) PEP 594: "Removing dead batteries from the standard 
library"
https://www.python.org/dev/peps/pep-0594/

--

___
Python tracker 

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



[issue28533] Remove asyncore, asynchat and smtpd modules

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

For example, what *if* aiosmtpd deprecated a function

--

___
Python tracker 

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



[issue28533] Remove asyncore, asynchat and smtpd modules

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> One concern I have is when users follow internet examples and look out for 
> these modules or examples.

Well, we cannot modify printed books :-)


> What is the best way to show them the modern usage?

Buy new books? :-)


> Should Python docs show some example snippet of the most common usage of 
> aiosmtpd ?

I don't think that we should start providing tutorial for 3rd party modules. 
There are enough places on the Internet for that.

For example, what is aiosmtpd deprecated a function and our doc uses it? Once a 
Python version reaches its "security-only" fixes, we cannot modify the doc 
anymore, and you fall into the same problem again.


> A stdlib page dedicated to removal, and showing examples using these modules, 
> especially aiostmpd as it is not a part of stdlib, might be a good idea.

IMO it's way better to maintain such documentation outside Python itself. It's 
simpler to keep it up to date.

--

___
Python tracker 

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



[issue31842] pathlib: "Incorrect function" during resolve()

2021-11-12 Thread Erik Aronesty


Erik Aronesty  added the comment:

bug is worse than that:

perfectly valid redirected paths (winfsp ram drives for example) now break in 
python 3.9.6 (maybe fixed in later version?)


>>> import pathlib
>>> p=pathlib.Path('C:\\Users\\erik\\Atakama')
>>> p.resolve()
Traceback (most recent call last):
  File "", line 1, in 
  File "c:\users\erik\.pyenv\pyenv-win\versions\3.9.6\Lib\pathlib.py", line 
1205, in resolve
s = self._flavour.resolve(self, strict=strict)
  File "c:\users\erik\.pyenv\pyenv-win\versions\3.9.6\Lib\pathlib.py", line 
206, in resolve
s = self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 1005] The volume does not contain a recognized file system.


... yet

dir 'C:\\Users\\erik\\Atakama'
Desktop.ini  Personal\ Files  Vault

mounted via winfsp

--
nosy: +earonesty
versions: +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



[issue28533] Remove asyncore, asynchat and smtpd modules

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

Senthil: "+1 to these modules removal"

Would you mind to formally approve the PR 
https://github.com/python/cpython/pull/29521 ?

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Could it be possible that it might not be able to replace that 
> link when it is currently in use?

Appexec links are only used briefly to find the real executable and create the 
access token that allows executing it. I don't know how your local profile 
directory ended up with a stale link. Maybe Steve has more insight.

There should be a "PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0" 
subdirectory in your local "WindowsApps" directory. Check the "python3.9.exe" 
link in that directory as well. It's the basis for the link of the same name 
that gets created in the parent directory.

Note that I wrote read_appexec.py in a hurry based on someone's blog (appexec 
links are undocumented), which I shouldn't have trusted. I've uploaded a new 
version just now with what are hopefully more accurate fields and field names. 
The previous target path result was correct, however. For example:

C:\>read_appexec.py "%LocalAppData%\Microsoft\WindowsApps\python3.9.exe"
Package Name: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
Application User Model ID: 
PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0!Python
Target Path:
C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0\python3.9.exe

--
Added file: https://bugs.python.org/file50435/read_appexec.py

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-12 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8f1b71de731dda668aede7c9b34d0ad7afb8f6a8 by Brandt Bucher in 
branch 'main':
bpo-45711: Re-bump the magic number and update doc (GH-29528)
https://github.com/python/cpython/commit/8f1b71de731dda668aede7c9b34d0ad7afb8f6a8


--

___
Python tracker 

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



[issue28533] Remove asyncore, asynchat and smtpd modules

2021-11-12 Thread STINNER Victor


STINNER Victor  added the comment:

> There is an option: keep removed modules but replace each module content
> with 'raise ImportError("Please use  instead")' stub.
> The actual module removal can be postponed for years until most internet 
> resources reflect this fact.

That prevents someone to provide asyncore for Python 3.11 under the same name, 
"asyncore". The stdlib module has the priority over the third-party module.

--

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread Eryk Sun


Change by Eryk Sun :


Removed file: https://bugs.python.org/file50434/read_appexec.py

___
Python tracker 

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



[issue10202] ftplib doesn't check close status after sending file

2021-11-12 Thread mike mcleod


mike mcleod  added the comment:

I would like to help on this issue. I understand the arguments here but it has 
been a lone time since this was raised and there does not seem to be any 
further issues discussed or support for this issue.

--
nosy: +mikecmcleod

___
Python tracker 

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



[issue45789] Python execution broken after update via Windows Store

2021-11-12 Thread firewave


firewave  added the comment:

Thanks a lot for all the details.

I used the script to check all the 3.9 appexec links and only the "python3.9" 
one points to the wrong executable.

Version: 3
Package ID: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
Entry Point: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0!Python
App Type: 0
Target Path:
C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\python3.9.exe

Version: 3
Package ID: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
Entry Point: PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0!Pip
App Type: 0
Target Path:
C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2288.0_x64__qbz5n2kfra8p0\pip3.9.exe

Could it be possible that it might not be able to replace that link when it is 
currently in use?

Also the "Reliability Monitor" shows a warning to install the "Python 3.9" app 
but I never saw anything about it in the "Windows Store".

Installation Failure: Windows failed to install the following update with error 
0x80073D02: 9P7QFQMJRFP7-PythonSoftwareFoundation.Python.3.9.

A day later the success entry is found.

Installation Successful: Windows successfully installed the following update: 
9P7QFQMJRFP7-PythonSoftwareFoundation.Python.3.9

--

___
Python tracker 

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



[issue45794] Email policy option for disabling RFC2231 Mime parameter folding

2021-11-12 Thread Ezekeel


New submission from Ezekeel :

I am using the Python email module extensively and noticed that the Microsoft 
Outlook client does not support RFC2231 for Mime parameter folding. Since that 
mail client unfortunately is the de facto standard in the corporate world there 
should be a policy option to disable it.

I have implemented that option: 
https://github.com/netcon-consulting/cpython/commit/9f485f0a6a5b7f2c207f1d5db7d1e520c71ac3b7

--
components: email
messages: 406205
nosy: Ezekeel, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Email policy option for disabling RFC2231 Mime parameter folding
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



[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

IMHO your code is buggy, as Hai Shi also indicates.

After Py_Finalize all objects in all (sub-)interpreters are deallocated unless 
there are bugs in the interpreter. Because of this "..., item should still be 
alive" in your sample code is incorrect: the reference should be considered to 
be invalid and cannot be used again.

--
nosy: +ronaldoussoren
resolution:  -> not a bug
stage:  -> resolved
status: open -> pending

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-11-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The problem will go away when you install and use an arm64 or universal2 
variant of Python.

This is behaviour of macOS and cannot be changed in CPython.

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 8b6a474071bcc88ec3453e16f079181e551513c3 by Miss Islington (bot) 
in branch '3.9':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29536)
https://github.com/python/cpython/commit/8b6a474071bcc88ec3453e16f079181e551513c3


--

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 628667ac9a634c7a7fa7f681dd2f98ff5841c843 by Miss Islington (bot) 
in branch '3.10':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29535)
https://github.com/python/cpython/commit/628667ac9a634c7a7fa7f681dd2f98ff5841c843


--

___
Python tracker 

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



[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2021-11-12 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue.
I note that when I test against 3.10 this error does not show. Also, all tests 
for test_tarfile pass.
I am wondering if it may be reasonable to close this due to the age and 
currently its not an issue in the latest Python version.

--
nosy: +mikecmcleod

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27787
pull_request: https://github.com/python/cpython/pull/29537

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset e501d70b347c5093018d12482c30a7a98aab86d0 by Hynek Schlawack in 
branch 'main':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533)
https://github.com/python/cpython/commit/e501d70b347c5093018d12482c30a7a98aab86d0


--
nosy: +asvetlov

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27786
pull_request: https://github.com/python/cpython/pull/29536

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27788
pull_request: https://github.com/python/cpython/pull/29538

___
Python tracker 

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread junyixie


junyixie  added the comment:

> What's the architecture for the python binary (run "file $(which python3)" in 
> a shell to get this information, excluding the quotes)?
yeah, is x86_64 python executable
.../opt/anaconda3/bin/python3: Mach-O 64-bit executable x86_64

--

___
Python tracker 

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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread junyixie


junyixie  added the comment:

when run pyperformance compile in apple silicon also have this problem

--

___
Python tracker 

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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm assuming you run on a M1* system. 

What's the architecture for the python binary (run "file $(which python3)" in a 
shell to get this information, excluding the quotes)?

If the binary supports only x86_64 you might run into a "feature" of macOS: 
subprocesses started from a Rosetta 2 process also prefer to run in emulation.

This can also be demonstrated using the system install of perl, for example:

% perl -e 'print `arch`'
arm64

% arch -x86_64 perl -e 'print `arch`'
i386

There sadly doesn't appear to be documentation about this on Apple's site.

Note that the universal2 variants of the installers on python.org natively 
support both x86_64 and arm64.

--

___
Python tracker 

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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread junyixie


junyixie  added the comment:

subprocess.Popen([], executable=os.path.join(cpython_dir, "configure"), 
cwd=cpython_dir).wait()

--

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-11-12 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27784
pull_request: https://github.com/python/cpython/pull/29534

___
Python tracker 

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



[issue45793] execute shell command ./configure with python subprocess.popen, os.system ... checking build system type... is wrong

2021-11-12 Thread junyixie


New submission from junyixie :

wrong:
checking build system type... x86_64-apple-darwin20.5.0
checking host system type... x86_64-apple-darwin20.5.0


expect:
checking build system type... arm-apple-darwin20.5.0
checking host system type... arm-apple-darwin20.5.0

--
components: macOS
messages: 406194
nosy: JunyiXie, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: execute shell command ./configure with python subprocess.popen, 
os.system ... checking build system type...  is wrong
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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Hynek Schlawack


Change by Hynek Schlawack :


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

___
Python tracker 

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



[issue45791] __instancecheck__ being checked of type(cls) instead of cls

2021-11-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> As in most (but not all) cases of dunder methods it
> is looked up in a class, ignoring instance attributes.

That is true, but the starting point in this case is a class so the attribute 
lookup should be in that class, not its metaclass.

Guido's original code was correct and it became broken in 3.1 in the switch 
from PyObject_GetAttr(cls, name) to _PyObject_LookupSpecial(cls, 
___instancecheck__).

Also, the demonstration code I gave (that matches the documentation) used to 
work in 3.0 and prior.  It broken in 3.1.

--
nosy: +gvanrossum

___
Python tracker 

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



  1   2   >