[issue45073] windows installer quiet installation targetdir escapes "quote"-symbol

2021-08-31 Thread Eryk Sun


Eryk Sun  added the comment:

A literal backlash has to be escaped by doubling it if it precedes a double 
quote, else it escapes the double quote character. This is how typical 
command-line argument parsing handles backslash in Windows [1]: 

* 2n backslashes followed by a quotation mark produce n backslashes
  followed by begin/end quote. This does not become part of the
  parsed argument, but toggles the "in quotes" mode.
* (2n) + 1 backslashes followed by a quotation mark again produce n
  backslashes followed by a quotation mark literal ("). This does
  not toggle the "in quotes" mode.
* n backslashes not followed by a quotation mark simply produce n
  backslashes.

For example:

import ctypes
shell32 = ctypes.WinDLL('shell32', use_last_error=True)
shell32.CommandLineToArgvW.restype = ctypes.POINTER(ctypes.c_wchar_p)
n = ctypes.c_int()

Escape the trailing backslash as a literal backslash:

>>> cmd = r'/quiet TargetDir="D:\pyt hon\\" AssociateFiles=0'
>>> args = shell32.CommandLineToArgvW(cmd, ctypes.byref(n))
>>> args[:n.value]
['/quiet', 'TargetDir=D:\\pyt hon\\', 'AssociateFiles=0']

Escape the double quote as a literal double quote:

>>> cmd = r'/quiet TargetDir="D:\pyt hon\" AssociateFiles=0'
>>> args = shell32.CommandLineToArgvW(cmd, ctypes.byref(n))
>>> args[:n.value]
['/quiet', 'TargetDir=D:\\pyt hon" AssociateFiles=0']

---

[1] 
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw

--
components: +Windows
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



[issue45074] asyncio hang in subprocess wait_closed() on Windows, BrokenPipeError

2021-08-31 Thread William Fisher


New submission from William Fisher :

I have a reproducible case where stdin.wait_closed() is hanging on
Windows. This happens in response to a BrokenPipeError. The same code 
works fine on Linux and MacOS.

Please see the attached code for the demo.

I believe the hang is related to this debug message from the logs:


DEBUG <_ProactorWritePipeTransport closing fd=632>: Fatal write error on pipe 
transport
Traceback (most recent call last):
  File 
"C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\proactor_events.py", 
line 379, in _loop_writing
f.result()
  File 
"C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\windows_events.py", 
line 812, in _poll
value = callback(transferred, key, ov)
  File 
"C:\hostedtoolcache\windows\Python\3.9.6\x64\lib\asyncio\windows_events.py", 
line 538, in finish_send
return ov.getresult()
BrokenPipeError: [WinError 109] The pipe has been ended


It appears that the function that logs "Fatal write error on pipe transport" 
also 
calls _abort on the stream. If _abort is called before stdin.close(), 
everything is okay. 
If _abort is called after stdin.close(), stdin.wait_closed() will hang.

Please see issue #44428 for another instance of a similar hang in wait_closed().

--
components: asyncio
files: wait_closed.py
messages: 400810
nosy: asvetlov, byllyfish, yselivanov
priority: normal
severity: normal
status: open
title: asyncio hang in subprocess wait_closed() on Windows, BrokenPipeError
type: behavior
versions: Python 3.10, Python 3.9
Added file: https://bugs.python.org/file50250/wait_closed.py

___
Python tracker 

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



[issue45073] windows installer quiet installation targetdir escapes "quote"-symbol

2021-08-31 Thread DMI-1407


New submission from DMI-1407 :

If the windows installer (Python 3.8.9 64bit exe) is run in quiet mode and the 
TargetDir option is used, then the last quote (") symbol gets escaped if the 
path ends with an backslash (\).

Example: /quiet TargetDir="D:\pyt hon\" AssociateFiles=0
Result: TargetDir=hon\" AssociateFiles=0
this raises the error that the path contains a invalid character... (the quote 
ofc)

Example: /quiet TargetDir="D:\pyt hon" AssociateFiles=0
Result: installs correctly


so in general "D:\pyt hon" indicates a file thats named "pyt hon" where "D:\pyt 
hon\" indicates a folder.
whatever "D:\pyt hon\" should be valid and i dont understand why the first 
backslash does not escape the p and leads to "D:pyt hon" ...

its really annoying, pls do at least write a notice into the docs that the 
installer behaves like this. :/

--
components: Installation
messages: 400809
nosy: DMI-1407
priority: normal
severity: normal
status: open
title: windows installer quiet installation targetdir escapes "quote"-symbol
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-31 Thread Inada Naoki


Inada Naoki  added the comment:

I don't want all frozen header files to be committed in git repository.
Can't we just build them during build process?

--

___
Python tracker 

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



[issue45071] python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6

2021-08-31 Thread Zachary Ware


Zachary Ware  added the comment:

This is a duplicate of bpo-44549.

For future reports, please first check for existing issues, and also ensure 
that you are looking at the latest release of the version you are reporting 
against.

--
nosy: +zach.ware
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> BZip 1.0.6 Critical Vulnerability

___
Python tracker 

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



[issue45070] python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associate

2021-08-31 Thread Zachary Ware


Zachary Ware  added the comment:

As noted in bpo-45068, these executables are helpers for deprecated 
functionality.  It is safe to delete them if they concern you and you don't 
need the deprecated functionality.  They will not be updated except to remove 
them.

--
components: +Distutils, Windows
nosy: +dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware
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



[issue45072] python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3

2021-08-31 Thread Zachary Ware


Zachary Ware  added the comment:

As noted in bpo-45068, v3.9.2 is out of date.  v3.9.7 includes pip v21.2.3.

--
nosy: +zach.ware
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



[issue45068] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2021-08-31 Thread Zachary Ware

Zachary Ware  added the comment:

v3.9.2 is rather out of date at this point; v3.9.7 was released just yesterday 
and includes OpenSSL v1.1.1l.  If you're concerned about issues in the version 
of OpenSSL included with Python v3.9.2, you are encouraged to update to the 
latest v3.9.7, or replace the OpenSSL DLLs with your own.

The various wininst-*.exe executables are helpers for the deprecated distutils 
bdist_wininst command, and you are encouraged to not use them :).  You can 
safely remove them if you do not need bdist_wininst functionality.  They will 
not be updated.

--
nosy: +zach.ware
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
title: python 3.9.2 contains wininst-10.0-amd64.exe. 
wininst-10.0.exe.wininst-7.1.exe. 
wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe 
and wininst-14.0.exe associates CVE-2016-9843、CVE-2016-9841、CVE-2016-9840 and 
CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) -> python 3.9.2 contains 
libcrypto-1_1.dll and libssl-1_1.dll associates 
CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449
 of openssl-1.1.1i

___
Python tracker 

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



[issue34561] Replace list sorting merge_collapse()?

2021-08-31 Thread Tim Peters


Change by Tim Peters :


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

___
Python tracker 

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



[issue45072] python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3

2021-08-31 Thread xcl-1


New submission from xcl-1 <1318683...@qq.com>:

python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3

--
messages: 400803
nosy: xcl123
priority: normal
severity: normal
status: open
title: python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of 
pip-20.2.3

___
Python tracker 

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



[issue45071] python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6

2021-08-31 Thread xcl-1


New submission from xcl-1 <1318683...@qq.com>:

python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of 
bzip2-1.0.6

--
messages: 400802
nosy: xcl123
priority: normal
severity: normal
status: open
title: python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and 
CVE-2016-3189 of bzip2-1.0.6

___
Python tracker 

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



[issue45070] python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associate

2021-08-31 Thread xcl-1

New submission from xcl-1 <1318683...@qq.com>:

python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. 
wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe 
and wininst-14.0.exe associates CVE-2016-9843、CVE-2016-9841、CVE-2016-9840 and 
CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5)

--
messages: 400801
nosy: xcl123
priority: normal
severity: normal
status: open
title: python 3.9.2 contains wininst-10.0-amd64.exe. 
wininst-10.0.exe.wininst-7.1.exe. 
wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe 
and wininst-14.0.exe associates CVE-2016-9843、CVE-2016-9841、CVE-2016-9840 and 
CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5)

___
Python tracker 

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



[issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2021-08-31 Thread xcl-1


New submission from xcl-1 <1318683...@qq.com>:

python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates 
CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449
 of openssl-1.1.1i

--
messages: 400800
nosy: xcl123
priority: normal
severity: normal
status: open
title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates 
CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449
 of openssl-1.1.1i

___
Python tracker 

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



[issue45068] python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associate

2021-08-31 Thread xcl-1

xcl-1 <1318683...@qq.com> added the comment:

python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. 
wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe 
and wininst-14.0.exe associates CVE-2016-9843、CVE-2016-9841、CVE-2016-9840 and 
CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5)

--
title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates 
CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449
 of openssl-1.1.1i -> python 3.9.2 contains wininst-10.0-amd64.exe. 
wininst-10.0.exe.wininst-7.1.exe. 
wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe 
and wininst-14.0.exe associates CVE-2016-9843、CVE-2016-9841、CVE-2016-9840 and 
CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5)

___
Python tracker 

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



[issue45068] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2021-08-31 Thread xcl-1


New submission from xcl-1 <1318683...@qq.com>:

Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow 
the output length argument in some cases where the input length is close to the 
maximum permissable length for an integer on the platform. In such cases the 
return value from the function call will be 1 (indicating success), but the 
output length value will be negative. This could cause applications to behave 
incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this 
issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL 
versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is 
out of support and no longer receiving public updates. Premium support 
customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade 
to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 
1.0.2y (Affected 1.0.2-1.0.2x).

--
components: Build
messages: 400798
nosy: xcl123
priority: normal
severity: normal
status: open
title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates 
CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449
 of openssl-1.1.1i
type: security

___
Python tracker 

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



[issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems

2021-08-31 Thread Gregory Szorc


Gregory Szorc  added the comment:

I think patch broke building on macOS < 11 when building with a 11.0+ SDK and 
targeting macOS < 11? This build configuration previously used to work with 
3.9.6.

clang -Wno-unused-result -Wsign-compare -g -O0 -Wall -arch x86_64 
-mmacosx-version-min=10.9 -Wno-nullability-completeness 
-Wno-expansion-to-defined -Wno-undef-prefix -isysroot 
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
 -fPIC 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include
 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include/ncursesw
 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include/uuid
 -Werror=unguarded-availability-new   -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes 
-Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal 
 -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 
-Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix 
-isysroot 
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/S
 DKs/MacOSX11.1.sdk -fPIC 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include
 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include/ncursesw
 
-I/var/folders/24/8k48jl6d249_n_qfxwsl6xvmgn/T/tmpkfji88v7/tools/deps/include/uuid
 -Werror=unguarded-availability-new   -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 
-DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 
-DHAVE_FFI_CLOSURE_ALLOC=1 -DPy_BUILD_CORE_BUILTIN  -I_ctypes/darwin -c 
./Modules/_ctypes/callproc.c -o Modules/callproc.o
python-3.9> ./Modules/_ctypes/callproc.c:1459:15: error: redefinition of 
'_dyld_shared_cache_contains_path' as different kind of symbol
cpython-3.9> static bool (*_dyld_shared_cache_contains_path)(const char *path);
cpython-3.9>   ^
cpython-3.9> 
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13:
 note: previous definition is here
cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) 
  __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) 
DYLD_DRIVERKIT_UNAVAILABLE;
cpython-3.9> ^
cpython-3.9> ./Modules/_ctypes/callproc.c:1464:42: error: non-object type 'bool 
(const char *)' is not assignable
cpython-3.9> _dyld_shared_cache_contains_path = 
dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
cpython-3.9>  ^
cpython-3.9> ./Modules/_ctypes/callproc.c:1464:9: error: 
'_dyld_shared_cache_contains_path' is only available on macOS 11.0 or newer 
[-Werror,-Wunguarded-availability-new]
cpython-3.9> _dyld_shared_cache_contains_path = 
dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
cpython-3.9> ^~~~
cpython-3.9> 
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13:
 note: '_dyld_shared_cache_contains_path' has been marked as being introduced 
in macOS 11.0 here, but the deployment target is macOS 10.9.0
cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) 
  __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) 
DYLD_DRIVERKIT_UNAVAILABLE;
cpython-3.9> ^
cpython-3.9> ./Modules/_ctypes/callproc.c:1464:9: note: enclose 
'_dyld_shared_cache_contains_path' in a __builtin_available check to silence 
this warning
cpython-3.9> _dyld_shared_cache_contains_path = 
dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
cpython-3.9> ^~~~
cpython-3.9> ./Modules/_ctypes/callproc.c:1482:10: error: 
'_dyld_shared_cache_contains_path' is only available on macOS 11.0 or newer 
[-Werror,-Wunguarded-availability-new]
cpython-3.9>  if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) {
cpython-3.9>  ^~~~
cpython-3.9> ./Modules/_ctypes/callproc.c:1474:5: note: expanded from macro 
'HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME'
cpython-3.9> _dyld_shared_cache_contains_path != NULL
cpython-3.9> ^~~~
cpython-3.9> 
/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13:
 note: '_dyld_shared_cache_contains_path' has been marked as being introduced 
in macOS 11.0 here, but the deployment target is macOS 10.9.0
cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) 
  __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) 
DYLD_DRIVERKIT_UNAVAILABLE;
cpython-3.9> ^
cpython-3.9> ./Modules/_ctypes/callproc.c:1482:10: note: 

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-08-31 Thread Ned Batchelder


Ned Batchelder  added the comment:

Looks like this is fixed with 3.10.0rc1, thanks.

--

___
Python tracker 

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



[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-08-31 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue45062] test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9

2021-08-31 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-31 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-08-31 Thread Senthil Kumaran


New submission from Senthil Kumaran :

I verified that ncurses-devel is installed.

./configure is able to verify ncurses

checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for term.h... yes

But _curses fails to build, this is the output message from `make`


gcc -pthread -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 -DHAVE_NCURSESW=1 
-I/usr/include/ncursesw -I./Include -I. -I/usr/local/include 
-I/local/home/senthilx/cpython/Include -I/local/home/senthilx/cpython -c 
/local/home/senthilx/cpython/Modules/_curses_panel.c -o 
build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o
gcc -pthread -shared 
build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o
 -L/usr/local/lib -lpanelw -lncursesw -o 
build/lib.linux-x86_64-3.11/_curses_panel.cpython-311-x86_64-linux-gnu.so
*** WARNING: renaming "_curses_panel" since importing it failed: No module 
named '_curses'

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  pwd   time


Failed to build these modules:
_curses


Following modules built successfully but were removed because they could not be 
imported:
_curses_panel

--
messages: 400795
nosy: orsenthil
priority: normal
severity: normal
status: open
title: Failed to build _curses on CentOS 7
type: compile error
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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

Oh, I see now what you meant. 

I think you're right that it's cleanup. I changed dash_R_cleanup to put the 
sys._clear_type_cache() after clear_caches() and the leak is gone:

@@ -166,9 +166,6 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
 zipimport._zip_directory_cache.clear()
 zipimport._zip_directory_cache.update(zdc)
 
-# clear type cache
-sys._clear_type_cache()
-
 # Clear ABC registries, restoring previously saved ABC registries.
 abs_classes = [getattr(collections.abc, a) for a in 
collections.abc.__all__]
 abs_classes = filter(isabstract, abs_classes)
@@ -181,6 +178,12 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
 
 clear_caches()
 
+# clear type cache
+sys._clear_type_cache()
+
+support.gc_collect()
+



I did this because I suspected it's something related to types, because it only 
happen when we define the exception classes (A and B) inside the test function. 

So maybe the type objects of these exceptions are not cleared from the type 
cache because they have refcount > 0 but by the time  clear_caches() and 
gc.collect() finish they are cleared?


Note this doesn't mean the change I made is always right - maybe the whole body 
of dash_R_cleanup should be in a loop until nothing changes?

--

___
Python tracker 

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



[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Géry

Géry  added the comment:

No worries, it was almost twenty years ago.

> But it's probably better to raise a dedicated exception in that case and 
> catch it in main(), rather than just calling sys.exit() deep inside the other 
> code.

Yes I agree, and I think you explained very clearly why it is better in the 
blog post:

> Another refinement is to define a Usage() exception, which we catch in an 
> except clause at the end of main():
> […]
> This gives the main() function a single exit point, which is preferable over 
> multiple return 2 statements.

So I think you made two independent points:

- raising a dedicated exception instead of calling `sys.exit` inside nested 
functions and catching it inside `main` allows a single exit point;
- calling `sys.exit` outside of `main` instead of inside prevents exiting the 
Python interpreter in an interactive session.

--

___
Python tracker 

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



[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

To get a better insight into what is going on, see
https://docs.python.org/3/howto/descriptor.html#invocation-from-an-instance
  
The relevant text is, "So if __getattr__() exists, it is called whenever 
__getattribute__() raises AttributeError (either directly or in one of the 
descriptor calls)."

If needed, you can bypass the __getattr__ hook by calling 
object.__getattribute__ directly:

>>> object.__getattribute__(C(), 'test')
Traceback (most recent call last):
  File "", line 1, in 
  object.__getattribute__(c, 'test')
  File "/Users/raymond/Documents/tmp14.py", line 26, in __get__
raise AttributeError("Python bug?")
AttributeError: Python bug?

--
nosy: +rhettinger

___
Python tracker 

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



[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Jack DeVries

Jack DeVries  added the comment:

> Your docs seem to promote the second, whereas I've usually preferred the
> former. Was this a considered choice on your part?

First and foremost, stupid GitHub is not letting the permalink load for some
reason, but yes; this was discussed in the conversation with @graingert on
June 29th – it was his suggestion. Later, @pradyunsg from PyPa added some
suggestions about how the document described console script entrypoints,
and the documentation around this issue changed a bit again.

As far as my perspective, I also never personally use the sys.exit idiom
myself. After all, an exception is going to cause a non-zero exit code, and a
traceback is always going to have a lot more value than an exit code.

I was, however, surprised to learn how pip treats console script entry points
in the course of working on this document. Specifically, it generates an
executable script that does wrap the function in sys.exit.I definitely think
that the way the document communicates this fact while teaching the idiom is a
good thing, so I think that whole "Idiomatic Usage" section is good.

I do think we can tweak the document slightly to make it less prescriptive,
though, because in reality a lot of people _don't_ use this idiom, so
presenting it as a de-facto standard is misleading. Plus, it's not
Pythonic to dole out prescriptive boilerplate.

I attached a diff that steers in that direction. What do you all think? It is
a pretty slight change, but I think it better strikes a balance.

--
Added file: https://bugs.python.org/file50249/less_prescriptive.diff

___
Python tracker 

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



[issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

Nice!

--
nosy: +vstinner

___
Python tracker 

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



[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

Hi Mateusz,

It's not a bug, it's expected behavior.

__getattr__ called when the default attribute access fails with an 
AttributeError (either __getattribute__() raises an AttributeError because name 
is not an instance attribute or an attribute in the class tree for self; or 
__get__() of a name property raises AttributeError).

You can find more information here: 

https://docs.python.org/3/reference/datamodel.html?highlight=__getattr__#object.__getattr__

--
nosy: +uriyyo
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> My use case for these low-level APIs is to write tests for low-level 
> string/encoding handling in my custom use of the PyPreConfig and PyConfig 
> structs. I wanted to verify that exact byte sequences were turned into 
> specific representations inside of Python strings. This includes ensuring 
> that certain byte sequences retain their appropriate "character" width in 
> internal storage.

CPython contains many checks to ensure that a string always use the most 
effecient storage, especially in debug mode. The C API should not allow to 
create a string using an inefficient storage, unless you "abuse" the C API :-D

I'm not sure what do you test.

--

___
Python tracker 

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



[issue14088] sys.executable generating canonical path

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-20443 "__code__. co_filename should always be an absolute path". I 
had a revert a change which affected sys.argv[0]:

commit a1a99b4bb7cbe2dbc55a1d92c3c509b4466d3c3b
Author: Victor Stinner 
Date:   Mon Dec 9 17:34:02 2019 +0100

bpo-20443: No longer make sys.argv[0] absolute for script (GH-17534)

In Python 3.9.0a1, sys.argv[0] was made an asolute path if a filename
was specified on the command line. Revert this change, since most
users expect sys.argv to be unmodified.

--

___
Python tracker 

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



[issue44019] operator.call/operator.__call__

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> `call(f, *args, **kwargs) == f(*args, **kwargs)`

So you can want to reintroduce the Python 2 apply() function which was removed 
in Python 3.

You can reimplement it in 2 lines, no?

def call(func, *args, **kwargs):
  return func(*args, **kwargs)

--

___
Python tracker 

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



[issue45042] Many multiprocessing tests are silently skipped since 3.9

2021-08-31 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> But there is also an issue in the script itself. It fails or produces a 
> mojibake when the filesystem encoding and the stdout encoding do not match.

I don't know Tools/scripts/md5sum.py. Can you show an example which currently 
fails?

--

___
Python tracker 

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



[issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter

2021-08-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Python 3.11 makes it worse: up to 1.5x longer

Sound like you likely want to use the environment variable to deactivate the 
extra information ;)

--

___
Python tracker 

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



[issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter

2021-08-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>In my example, there are 6 frames. The indicators cover the whole line of 3 
>frames: 50%. It's a common case, it's not special.

Special is not uncommon, is just some different behaviour rather than the 
default one. I am not arguing that is a rare scenario, I am arguing that is a 
special case.

--

___
Python tracker 

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



[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

You're right, I'm being inconsistent. :-(  I withdraw my objection.

There are cases where sys.exit() is easier than returning an exit code, e.g. 
when the error is discovered deep inside some other code. But it's probably 
better to raise a dedicated exception in that case and catch it in main(), 
rather than just calling sys.exit() deep inside the other code. It's probably 
too fine a point for a tutorial. Sorry!

--

___
Python tracker 

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



[issue39452] Improve the __main__ module documentation

2021-08-31 Thread Géry

Géry  added the comment:

@jack__d

Thanks for the rewrite! This is a great expansion. Unfortunately I didn’t have 
the time to review it before the merge. If I find something to be improved I 
will let you know.

@gvanrossum

> Your docs seem to promote the second, whereas I've usually preferred the 
> former.

Are you sure? Yet in your 2003 blog post [*Python main() 
functions*](https://www.artima.com/weblogs/viewpost.jsp?thread=4829) you 
promoted the opposite idiom `if __name__ == "__main__": sys.exit(main())` over 
the idiom `if __name__ == "__main__": main()`:

> Now the `sys.exit()` calls are annoying: when `main()` calls `sys.exit()`, 
> your interactive Python interpreter will exit! The remedy is to let 
> `main()`'s return value specify the exit status.

I am interested in the rationale if you changed your mind.

--

___
Python tracker 

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



[issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't follow what you want to change in 3.10.0 final, PEP 657 is for Python 
> 3.11. Can you clarify?

Ah, I thaught that the PEP was implemented in 3.10, I didn't notice that it's a 
new feature of Python 3.11 :-)

> Regarding the issue: I understand what you mean but I don't think we should 
> get into suppressing the indicators in special situations.

In my example, there are 6 frames. The indicators cover the whole line of 3 
frames: 50%. It's a common case, it's not special.

Python tracebacks are already very verbose: a single exception can easily take 
20-30 lines. It's worse for chained exceptions. Python 3.11 makes it worse: up 
to 1.5x longer.

--
priority: release blocker -> 
title: PEP 657 Fine Grained Error Locations: make the traceback less verbose 
when possible -> PEP 657 Fine Grained Error Locations: omit indicators if they 
are one the whole line, to make tracebacks shorter

___
Python tracker 

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



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

2021-08-31 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> It could be a problem with the way _Py_RefTotal is incremented/decremented.

It can be a cache which is kept alive and then clear the following iteration. 
See my previous comment:

test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 
4] references, sum=0

libregrtest/refleak.py does its best to clear *all* caches, type caches, free 
lists, etc. A single cache which is not cleared can confused libregrtest.

--

___
Python tracker 

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



[issue42414] unable to document fields of dataclass

2021-08-31 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Laurie: thanks for linking that, it seems like there isn't that much enthusiasm.

--

___
Python tracker 

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



[issue31299] Add "ignore_modules" option to TracebackException.format()

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 863154c9292e70c5a8a1a3f22ef4ee42e2304281 by Irit Katriel in 
branch 'main':
bpo-31299: make it possible to filter out frames from tracebacks (GH-28067)
https://github.com/python/cpython/commit/863154c9292e70c5a8a1a3f22ef4ee42e2304281


--

___
Python tracker 

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



[issue42791] There is no way to json encode object to str.

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

See also Issue35111.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42791] There is no way to json encode object to str.

2021-08-31 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +ezio.melotti, rhettinger

___
Python tracker 

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



[issue24981] Add a test which uses the ast module to compile the stdlib

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

I think there is something like this here: 

https://github.com/python/cpython/blob/22fe0eb13c3441b71b60aaea0e7fe289a29783da/Lib/test/test_ast.py#L1498

--
nosy: +iritkatriel

___
Python tracker 

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



[issue21736] Add __file__ attribute to frozen modules

2021-08-31 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



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

2021-08-31 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

>> Would it be sufficient to hold a reference to the connection object?
>
> Yes

Good, that simplifies things. I'll wait with this until we've resolved PR 27940 
though.

--

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset 2280bc116301d45efc4d69cea452d272fdcd05b1 by Miss Islington (bot) 
in branch '3.9':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/2280bc116301d45efc4d69cea452d272fdcd05b1


--

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset 0f274cb2d78f71073e9d7295df3b9006e7bf1097 by Miss Islington (bot) 
in branch '3.10':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/0f274cb2d78f71073e9d7295df3b9006e7bf1097


--

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26548
pull_request: https://github.com/python/cpython/pull/28105

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26547
pull_request: https://github.com/python/cpython/pull/28104

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 22fe0eb13c3441b71b60aaea0e7fe289a29783da by Terry Jan Reedy in 
branch 'main':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/22fe0eb13c3441b71b60aaea0e7fe289a29783da


--

___
Python tracker 

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



[issue45055] Fresh build on Windows fails the first time for zlib.c

2021-08-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

I've seen it a few times. I don't do this that often, but since I've discovered 
"git worktree" this has occurred to me a few times (can't recall if it was 
every time, but today wasn't the first). I'm totally happy to be the human in 
the retry loop. :-)

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-31 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 31.08.2021 20:14, Brett Cannon wrote:
> 
> Brett Cannon  added the comment:
> 
>> set __file__ (and __path__) on frozen modules?
> 
> See https://bugs.python.org/issue21736

The patch on that ticket is straight from PyRun, where the
__file__ location is set in a way which signals that the file
does not exist, but instead is baked into the executable:

>>> import os
>>> os.__file__
'/os.py'

Not doing this breaks too many tests in the test suite for no
good reason, which is why I mentioned "practicality beats
purity" in the ticket.

--

___
Python tracker 

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



[issue33426] [doc] Behavior of os.path.join does not match documentation

2021-08-31 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-08-31 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

To be clear, this probably doesn't have any actual consequence, since the right 
number of threads is launched anyway (at least in the example). But it's 
probably worth making the implementation less quirky (also, the semaphore's 
internal counter *might* overflow at some point?).

--
components: +Library (Lib) -asyncio
nosy: +pitrou

___
Python tracker 

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



[issue45055] Fresh build on Windows fails the first time for zlib.c

2021-08-31 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +DiddiLeija

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +DiddiLeija

___
Python tracker 

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



[issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt

2021-08-31 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +DiddiLeija

___
Python tracker 

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



[issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt

2021-08-31 Thread anarcat


anarcat  added the comment:

looking at email.feedparser.FeedParser._parse_gen(), it looks like this is 
going to be really hard to fix, because the parser just happily recurses into 
the sub-part without ever checking the CTE (content-transfer-encoding). that's 
typically only done on "get_payload()", which is obviously not called there 
because we're streaming the email in.

in general, it looks like support for quoted-printable, as a CTE (which is 
https://datatracker.ietf.org/doc/html/rfc2045#section-6.7), seems to be spotty 
at best. multipart/ parts will raise the (undocumented) exception 
InvalidMultipartContentTransferEncodingDefect if they encounter it, for example:

https://github.com/python/cpython/blob/3.9/Lib/email/feedparser.py#L322

so I'm not sure how to handle this. it's not clear to me either how to 
workaround this problem at all... is there a way to keep the parser from 
recursing like this?

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-31 Thread Brett Cannon


Brett Cannon  added the comment:

> set __file__ (and __path__) on frozen modules?

See https://bugs.python.org/issue21736

--

___
Python tracker 

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



[issue44188] ThreadPoolExecutor unbalanced semaphore count

2021-08-31 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue45039] use ADDOP_LOAD_CONST consistently

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset ebbd0ac5d8850a1630090c210b2454b4b26c7daa by Miss Islington (bot) 
in branch '3.10':
bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ADDOP_O(c, 
LOAD_CONST,...) (GH-28015)
https://github.com/python/cpython/commit/ebbd0ac5d8850a1630090c210b2454b4b26c7daa


--

___
Python tracker 

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



[issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt

2021-08-31 Thread anarcat


New submission from anarcat :

If an email message has a message/rfc822 part *and* that part is
quoted-printable encoded, Python freaks out.

Consider this code:

import email.parser
import email.policy

# python 3.9.2 cannot decode this message, it fails with
# "email.errors.StartBoundaryNotFoundDefect"

mail = """Mime-Version: 1.0
Content-Type: multipart/report;
 boundary=aa
Content-Transfer-Encoding: 7bit


--aa
Content-Type: message/rfc822
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary=3D"=3Dbb"


--=3Dbb
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=3Dutf-8

x=
x

--=3Dbb--

--aa--
"""

msg_abuse = email.parser.Parser(policy=email.policy.default + 
email.policy.strict).parsestr(mail)

That crashes with: email.errors.StartBoundaryNotFoundDefect

This should normally work: the sub-message is valid, assuming you
decode the content. But if you do not, you end up in this bizarre
situation, because the multipart boundary is probably considered to be
something like `3D"=3Dbb"`, and of course the above code crashes
with the above exception.

If you remove the quoted-printable part from the equation, the parser actually 
behaves:

import email.parser
import email.policy

# python 3.9.2 cannot decode this message, it fails with
# "email.errors.StartBoundaryNotFoundDefect"

mail = """Mime-Version: 1.0
Content-Type: multipart/report;
 boundary=aa
Content-Transfer-Encoding: 7bit


--aa
Content-Type: message/rfc822
Content-Disposition: inline

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=bb"


--=bb
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

xx

--=bb--

--aa--
"""

msg_abuse = email.parser.Parser(policy=email.policy.default + 
email.policy.strict).parsestr(mail)

The above correctly parses the message.

This problem causes all sorts of weird issues. In one real-world
example, it would just stop parsing headers inside the email because
long lines in headers (typical in Received-by headers) would get
broken up... So it would not actually fail completely. Or, to be more
accurate, by *default* (ie. if you do not use strict), it does not
crash and instead produces invalid data (e.g. a message without a
Message-ID or From).

On most messages that are encoded this way, the strict mode will
actually fail with: email.errors.MissingHeaderBodySeparatorDefect
because it will stumble upon a header line that should be a
continuation but instead is treated like a full header line, so it's
missing a colon (":").

--
components: email
messages: 400764
nosy: anarcat, barry, r.david.murray
priority: normal
severity: normal
status: open
title: email parser fails to decode quoted-printable rfc822 message attachemnt
type: crash
versions: Python 3.9

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset c1db7598790d037e58cd99c06d5c166433d63322 by Miss Islington (bot) 
in branch '3.9':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/c1db7598790d037e58cd99c06d5c166433d63322


--

___
Python tracker 

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



[issue45057] Simplify RegressionTestResult

2021-08-31 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +26546
pull_request: https://github.com/python/cpython/pull/28103

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset 337c8adf31c46b688a5f82bcb64dc6f1ad56703d by Miss Islington (bot) 
in branch '3.10':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/337c8adf31c46b688a5f82bcb64dc6f1ad56703d


--

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +26545
pull_request: https://github.com/python/cpython/pull/28102

___
Python tracker 

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



[issue45039] use ADDOP_LOAD_CONST consistently

2021-08-31 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45057] Simplify RegressionTestResult

2021-08-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2b76a5322fdf71d62b531fd765085f96f981c244 by Serhiy Storchaka in 
branch 'main':
bpo-45057: Simplify RegressionTestResult (GH-28081)
https://github.com/python/cpython/commit/2b76a5322fdf71d62b531fd765085f96f981c244


--

___
Python tracker 

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



[issue45057] Simplify RegressionTestResult

2021-08-31 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45039] use ADDOP_LOAD_CONST consistently

2021-08-31 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +26543
pull_request: https://github.com/python/cpython/pull/28100

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Definitely a typo.  Will apply fix and backport.

The first import of macosx initializes _tk_type to None.  The line in question 
intends to re-initialize it so that the subsequent assert can only pass if 
_init_tk_type changes it to something required.

Many other tests also set _tk_type as needed.  _tk_type should be restored in 
tearDownModule.  I will add that in a separate PR.  (The class cleanup already 
restores platform.)

--

___
Python tracker 

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



[issue45039] use ADDOP_LOAD_CONST consistently

2021-08-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 70ccee418d1f9d34ed15cfe7104221f9cfd27d03 by Irit Katriel in 
branch 'main':
bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ADDOP_O(c, 
LOAD_CONST,...) (GH-28015)
https://github.com/python/cpython/commit/70ccee418d1f9d34ed15cfe7104221f9cfd27d03


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 54f100514b02f6628450043e21ccfe39350d7ac7 by Serhiy Storchaka in 
branch 'main':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/54f100514b02f6628450043e21ccfe39350d7ac7


--
message_count: 1.0 -> 2.0
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26541
pull_request: https://github.com/python/cpython/pull/28098

___
Python tracker 

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



[issue45059] Typo: using "==" instead of "="

2021-08-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26542
pull_request: https://github.com/python/cpython/pull/28099

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

Victor - I am also getting a feeling that this may not be a real leak but 
rather a bug in the refleaks test bookkeeping. 

It could be a problem with the way _Py_RefTotal is incremented/decremented.

--

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset 8711b3d0ac89599fcd16edcb107169bb19a00737 by Miss Islington (bot) 
in branch '3.10':
bpo-44135: [docs] Fix inline markup (GH-28095)
https://github.com/python/cpython/commit/8711b3d0ac89599fcd16edcb107169bb19a00737


--

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-31 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 51999c960e7fc45feebd629421dec6524a5fc803 by Brandt Bucher in 
branch 'main':
bpo-37596: Clean up the set/frozenset marshalling code (GH-28068)
https://github.com/python/cpython/commit/51999c960e7fc45feebd629421dec6524a5fc803


--

___
Python tracker 

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



[issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible

2021-08-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Regarding the issue: I understand what you mean but I don't think we should get 
into suppressing the indicators in special situations. Some people may say that 
in a line that assigns to a call:

x = foo(x)
^^

highlighting foo() is also not very valuable but this case is much harder to 
detect so I don't want to open the window to "special cases".

Also, it will be very confusing to users why some lines are highlighted and why 
some lines aren't.

So, in general, I feel we should not do this, but I am open to more discussion 
about it.

--

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9a7ec2fcdee2da9e080ca459d4c240776df72567 by Ken Jin in branch 
'main':
bpo-44135: [docs] Fix inline markup (GH-28095)
https://github.com/python/cpython/commit/9a7ec2fcdee2da9e080ca459d4c240776df72567


--

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26540
pull_request: https://github.com/python/cpython/pull/28097

___
Python tracker 

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



[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-08-31 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



[issue36560] test_functools leaks randomly 1 memory block

2021-08-31 Thread Ken Jin


Ken Jin  added the comment:

@Victor, with your patch applied, for test_typing (locally, Windows x64):

$ ./python -m test test_typing -R 3:20
Different result on every run (race condition maybe?)

$ ./python -m test test_typing -R 1:20
Same result as yours on every run.

--
nosy: +kj

___
Python tracker 

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



[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4300352000beed22fb525ec45fd331918d206528 by Victor Stinner in 
branch 'main':
bpo-45061: Detect Py_DECREF(Py_True) bug (GH-28089)
https://github.com/python/cpython/commit/4300352000beed22fb525ec45fd331918d206528


--

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5f66ad09ff2c51521e1512888cac84e0cc0907d4 by Łukasz Langa in 
branch '3.9':
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves 
(GH-26193) (GH-28094)
https://github.com/python/cpython/commit/5f66ad09ff2c51521e1512888cac84e0cc0907d4


--

___
Python tracker 

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



[issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible

2021-08-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> In term of release process, can we change the traceback after Python 3.10.0 
> final? Or can we only change it in Python 3.11?

I don't follow what you want to change in 3.10.0 final, PEP 657 is for Python 
3.11. Can you clarify?

--

___
Python tracker 

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



[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-08-31 Thread miss-islington


miss-islington  added the comment:


New changeset c4c57e5c0eb79795d4fd1d9d8292455567c60070 by Miss Islington (bot) 
in branch '3.10':
bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)
https://github.com/python/cpython/commit/c4c57e5c0eb79795d4fd1d9d8292455567c60070


--

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docs lie)

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> If we go in this direction we should add a DeprecationWarning for __str__() 
> returning not direct str.

I saw str subclass being used for translation. Example:

class Message(str):
"""A Message object is a unicode object that can be translated.
Translation of Message is done explicitly using the translate() method.
For all non-translation intents and purposes, a Message is simply unicode,
and can be treated as such.
"""

https://github.com/openstack/oslo.i18n/blob/master/oslo_i18n/_message.py

There is likely other funny use cases.

I don't know if str() is used on Message instances.

--

___
Python tracker 

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



[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 888d4cc06b887e77f281ba4d640e281cb4c61b7b by Victor Stinner in 
branch 'main':
bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090)
https://github.com/python/cpython/commit/888d4cc06b887e77f281ba4d640e281cb4c61b7b


--

___
Python tracker 

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



[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-08-31 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +26539
pull_request: https://github.com/python/cpython/pull/28096

___
Python tracker 

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



[issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

PPC64LE RHEL8 LTO 3.10:
https://buildbot.python.org/all/#/builders/680/builds/279

0:01:14 load avg: 8.67 [236/427/1] test_asyncio failed (env changed) (1 min 5 
sec) -- running: test_gdb (1 min 2 sec), test_tokenize (47.0 sec)
Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py",
 line 321, in __del__
self.close()
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py",
 line 316, in close
self._ssl_protocol._start_shutdown()
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py",
 line 590, in _start_shutdown
self._abort()
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py",
 line 731, in _abort
self._transport.abort()
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/selector_events.py",
 line 680, in abort
self._force_close(None)
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/selector_events.py",
 line 731, in _force_close
self._loop.call_soon(self._call_connection_lost, exc)
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/base_events.py",
 line 745, in call_soon
self._check_closed()
  File 
"/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/base_events.py",
 line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

--

___
Python tracker 

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



[issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__

2021-08-31 Thread STINNER Victor


New submission from STINNER Victor :

s390x RHEL8 Refleaks 3.10:
https://buildbot.python.org/all/#/builders/669/builds/121

Reformatted output:

0:19:31 load avg: 2.74 [316/427/1] test_asyncio failed (env changed) (14 min 36 
sec) -- running: test_statistics (37.6 sec), test_signal (16 min 51 sec), 
test_pydoc (5 min 36 sec), test_xmlrpc (1 min 49 sec), test_subprocess (1 min 
15 sec)
beginning 6 repetitions
123456

Unknown child process pid 1398289, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 1398289 is closed

.

Unknown child process pid 1404140, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 1404140 is closed

.

/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py:320:
 ResourceWarning: unclosed transport 
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py",
 line 321, in __del__
self.close()
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py",
 line 316, in close
self._ssl_protocol._start_shutdown()
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py",
 line 590, in _start_shutdown
self._abort()
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py",
 line 731, in _abort
self._transport.abort()
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py",
 line 680, in abort
self._force_close(None)
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py",
 line 731, in _force_close
self._loop.call_soon(self._call_connection_lost, exc)
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/base_events.py",
 line 745, in call_soon
self._check_closed()
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/base_events.py",
 line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py:704:
 ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=9>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Task was destroyed but it is pending!
task: 
 wait_for=>

Unknown child process pid 1411156, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 1411156 is closed

.

Unknown child process pid 1415148, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 1415148 is closed

..

Unknown child process pid 1426190, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 1426190 is closed

.

--
components: Tests, asyncio
messages: 400744
nosy: asvetlov, erlendaasland, lukasz.langa, pablogsal, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: 
RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__
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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +26538
pull_request: https://github.com/python/cpython/pull/28095

___
Python tracker 

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



[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Mateusz


New submission from Mateusz :

A descriptor that is raising AttributeError in __get__() causes that the 
Python's interpreter continues searching for attributes in __mro__ calling 
__getattr__() function in inherited classes.

Let's take a look for example script with this bug.


class A1:
def __getattr__(self, name):
print("A1 visited")
raise AttributeError(f"{self.__class__.__name__}: {name} not found.")

class A2(A1):
def __getattr__(self, name):
print("A2 visited")
super().__getattr__(name)


class A3(A2):
def __getattr__(self, name):
print("A3 visited")
super().__getattr__(name)


class B:
def __init__(self, f):
self.f = f

def __get__(self, obj, objtype=None):
raise AttributeError("Python bug?")

class C(A3):
@B
def test(self):
return 25

B is a decorator attached to C.test() and it is throwing AttributeError. When 
c.test() is performed it starts for walking through C.__mro__ and calling 
__getattr__() function in objects.

>>> from bug import C
>>> c = C()
>>> c.test()
A3 visited
A2 visited
A1 visited
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/blooser/python-bug/bug.py", line 17, in __getattr__
super().__getattr__(name)
  File "/home/blooser/python-bug/bug.py", line 11, in __getattr__
super().__getattr__(name)
  File "/home/blooser/python-bug/bug.py", line 6, in __getattr__
raise AttributeError(f"{self.__class__.__name__}: {name} not found.")
AttributeError: C: test not found.

Changing error in B.__get__() to NameError:

class B:
def __init__(self, f):
self.f = f

def __get__(self, obj, objtype=None):
raise NameError("Python bug?")

causes it omits C.__mro__.

>>> from bug import C
>>> c = C()
>>> c.test()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/blooser/python-bug/bug.py", line 26, in __get__
raise NameError("Python bug?")
NameError: Python bug?

I'm thinking that it is expected behavior or is this a bug?

--
components: Interpreter Core
files: bug.py
messages: 400743
nosy: blooser
priority: normal
severity: normal
status: open
title: Raising AttributeError in descriptor decorator causing searching 
attribute in __mro__
type: behavior
versions: Python 3.11
Added file: https://bugs.python.org/file50248/bug.py

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26537
pull_request: https://github.com/python/cpython/pull/28094

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

I can see the test_typing issue with this patch:

diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index b94826a5da..49e5f03414 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -124,7 +124,7 @@ def check_rc_deltas(deltas):
 #
 #   [5, 5, 6]
 #   [10, 1, 1]
-return all(delta >= 1 for delta in deltas)
+return any(delta >= 1 for delta in deltas)
 
 def check_fd_deltas(deltas):
 return any(deltas)


Examples:

$ ./python -m test test_typing -R 3:20
(...)
beginning 23 repetitions
12345678901234567890123
...
test_typing leaked [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 
memory blocks, sum=3
test_typing failed (reference leak)


$ ./python -m test test_typing -R 1:20
WARNING: Running tests with --huntrleaks/-R and less than 3 warmup repetitions 
can give false positives!
(...)
beginning 21 repetitions
123456789012345678901
.
test_typing leaked [6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 
references, sum=6
test_typing leaked [4, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 
memory blocks, sum=7
test_typing failed (reference leak)
(...)

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

A variant of this problem: bpo-36560 with a leak 1 memory block per iteration.

--

___
Python tracker 

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



[issue32835] Add documention mentioning that Cygwin isn't fully compatible

2021-08-31 Thread Diana


Diana  added the comment:

Hi, I've created a pull request for pep 11.
https://github.com/python/peps/pull/2065

--
nosy: +DonnaDia

___
Python tracker 

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



  1   2   >