[issue41835] Speed up dict vectorcall creation using keywords

2020-09-22 Thread Inada Naoki


Inada Naoki  added the comment:

I have a Linux desktop machine for benchmarking & profiling in my office. But 
the machine is offline and I am working from home several weeks.
So please wait several weeks until I confirm your branch.

> This change speeds up the code up to a 30%. Tested with:
>
>  python -m timeit -n 2000  --setup "from uuid import uuid4 ; o =
>  {str(uuid4()).replace('-', '') : str(uuid4()).replace('-', '') for i
>  in range(1)}" "dict(**o)"

`dict(**o)` is not common use case. Could you provide some other benchmarks?

--

___
Python tracker 

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



[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2020-09-22 Thread Eryk Sun


Eryk Sun  added the comment:

It seems to me that if `path == name`, then resetperms(path) and possibly a 
recursive call are only needed on the first call. In subsequent calls, if `path 
== name`, then we know that resetperms(path) was already called, so it 
shouldn't handle PermissionError. If resetperms was ineffective (e.g. in 
Windows, a sharing violation or custom discretionary/mandatory permissions), or 
if something else changed the permissions in the mean time, just give up 
instead of risking a RecursionError or stack overflow. For example:


@classmethod
def _rmtree(cls, name, first_call=True):
resetperms_funcs = (_os.unlink, _os.rmdir, _os.scandir, _os.open)

def resetperms(path):
try:
_os.chflags(path, 0)
except AttributeError:
pass
_os.chmod(path, 0o700)

def onerror(func, path, exc_info):
if (issubclass(exc_info[0], PermissionError) and
  func in resetperms_funcs and (first_call or path != name)):
try:
if path != name:
resetperms(_os.path.dirname(path))
resetperms(path)
try:
_os.unlink(path)
# PermissionError is raised on FreeBSD for directories
except (IsADirectoryError, PermissionError):
cls._rmtree(path, first_call=False)
except FileNotFoundError:
pass
elif issubclass(exc_info[0], FileNotFoundError):
pass
else:
raise

_shutil.rmtree(name, onerror=onerror)

--
nosy: +eryksun

___
Python tracker 

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



[issue35767] unittest loader doesn't work with partial test functions

2020-09-22 Thread Jason Fried


Change by Jason Fried :


--
resolution:  -> fixed

___
Python tracker 

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



[issue35767] unittest loader doesn't work with partial test functions

2020-09-22 Thread Jason Fried


Change by Jason Fried :


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



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 64362c2e435eddc5e84cea313d92bc0b96d227f7 by Miss Islington (bot) 
in branch '3.9':
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370)
https://github.com/python/cpython/commit/64362c2e435eddc5e84cea313d92bc0b96d227f7


--

___
Python tracker 

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



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:

Thank you, Reuben!

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



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 5acc1b5f0b62eef3258e4bc31eba3b9c659108c9 by Miss Islington (bot) 
in branch '3.8':
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22369)
https://github.com/python/cpython/commit/5acc1b5f0b62eef3258e4bc31eba3b9c659108c9


--

___
Python tracker 

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



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21410
pull_request: https://github.com/python/cpython/pull/22370

___
Python tracker 

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



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +21409
pull_request: https://github.com/python/cpython/pull/22369

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-22 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue41513] High accuracy math.hypot()

2020-09-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 438e9fc66f664eff0526a16a6d900349bfd1f9d2 by Raymond Hettinger in 
branch 'master':
bpo-41513: Improve order of adding fractional values. Improve variable names. 
(GH-22368)
https://github.com/python/cpython/commit/438e9fc66f664eff0526a16a6d900349bfd1f9d2


--

___
Python tracker 

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



[issue41823] Add more fields to sys.float_info

2020-09-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Given that reliable checks aren't possible, it would still be nice (to have 
flags suchas non_ieee754_detected and double_rounding_detected.  If the flag is 
False it provides no firm guarantees, but it if it is true, it is meaningful.

--

___
Python tracker 

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



[issue41837] Upgrade installers to OpenSSL 1.1.1h

2020-09-22 Thread Ned Deily


New submission from Ned Deily :

"22-Sep-2020  OpenSSL 1.1.1h is now available, including bug fixes"

Christian, any changes need in _ssl or any other reasons we should not upgrade?

Changes between 1.1.1g and 1.1.1h [22 Sep 2020]

  *) Certificates with explicit curve parameters are now disallowed in
 verification chains if the X509_V_FLAG_X509_STRICT flag is used.
 [Tomas Mraz]

  *) The 'MinProtocol' and 'MaxProtocol' configuration commands now silently
 ignore TLS protocol version bounds when configuring DTLS-based contexts, 
and
 conversely, silently ignore DTLS protocol version bounds when configuring
 TLS-based contexts.  The commands can be repeated to set bounds of both
 types.  The same applies with the corresponding "min_protocol" and
 "max_protocol" command-line switches, in case some application uses both 
TLS
 and DTLS.
  
 SSL_CTX instances that are created for a fixed protocol version (e.g.
 TLSv1_server_method()) also silently ignore version bounds.  Previously
 attempts to apply bounds to these protocol versions would result in an
 error.  Now only the "version-flexible" SSL_CTX instances are subject to
 limits in configuration files in command-line options.
 [Viktor Dukhovni]

  *) Handshake now fails if Extended Master Secret extension is dropped
 on renegotiation.
 [Tomas Mraz]

--
components: Build, Windows, macOS
messages: 377352
nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: high
severity: normal
status: open
title: Upgrade installers to OpenSSL 1.1.1h
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue41513] High accuracy math.hypot()

2020-09-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +21407
pull_request: https://github.com/python/cpython/pull/22368

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Steve Dower


Steve Dower  added the comment:

> IMO, the most direct way to resolve the problem is by enabling "loader snaps" 
> for python.exe via gflags and attaching a native debugger to the process ...

This is indeed the best way to go about solving it, so you can see why we don't 
put it in an error message or take responsibility for documenting the process. 
It's not for the faint-hearted :)

Also, the recommended releases of WinDBG (from the Microsoft Store) no longer 
include gflags, though I believe once you're in the debugger it will just break 
at the point where the DLL can't be loaded and it's "simple" to get its 
expected name.

I wouldn't refuse a docs PR to add a short section pointing to this page and 
explaining its relevance: 
https://docs.microsoft.com/cpp/build/reference/dependents

I *would* stop short of writing a whole tutorial on how to do it. That's a 
great topic for someone's blog, and will likely get better SEO and social 
attention from not being in the docs.

--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-09-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

The Adobe form itself also still lists the broken URL. Only Ewa or Betsy can 
fix this, I suppose. I'll write them an email.

--

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-09-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Fixed https://www.python.org/psf/contrib/ to point to 
https://spdx.org/licenses/AFL-2.1.html instead. The contrib-form page 
(https://www.python.org/psf/contrib/contrib-form/) already had this change, but 
the PDF you can download from there still lists the old link.

--
nosy: +lemburg

___
Python tracker 

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



[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-22 Thread Ethan Furman


Change by Ethan Furman :


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



[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:

Thank you for your help, Serhiy!

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



[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset d986d1657e1e7b50807d0633cb31d96a2d866d42 by Ethan Furman in 
branch 'master':
bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362)
https://github.com/python/cpython/commit/d986d1657e1e7b50807d0633cb31d96a2d866d42


--

___
Python tracker 

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



[issue41827] 2D array issue

2020-09-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Serhiy. That's a better section than I found.

I'm going to close this. @jeetshahj12375: If you can show that this is a bug in 
python, please re-open this issue.

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



[issue35764] IDLE: revise calltip doc

2020-09-22 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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2466a7ae6bb1e4049c3d045a30a0503dda7654c5 by Miss Islington (bot) 
in branch '3.8':
bpo-35764: Rewrite the IDLE Calltips doc section  (GH-22363)
https://github.com/python/cpython/commit/2466a7ae6bb1e4049c3d045a30a0503dda7654c5


--

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset f27a1577d32f88c959e1ef6d0b12f25b2a54cdca by Miss Islington (bot) 
in branch '3.9':
bpo-35764: Rewrite the IDLE Calltips doc section  (GH-22363)
https://github.com/python/cpython/commit/f27a1577d32f88c959e1ef6d0b12f25b2a54cdca


--

___
Python tracker 

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



[issue41827] 2D array issue

2020-09-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See 
https://docs.python.org/3/faq/programming.html#how-do-i-create-a-multidimensional-list.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



[issue41827] 2D array issue

2020-09-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21406
pull_request: https://github.com/python/cpython/pull/22367

___
Python tracker 

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



[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 947adcaa13080790167757664912c3a6c2d4c201 by Terry Jan Reedy in 
branch 'master':
bpo-35764: Rewrite the IDLE Calltips doc section  (GH-22363)
https://github.com/python/cpython/commit/947adcaa13080790167757664912c3a6c2d4c201


--

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +21403
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/22364

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21404
pull_request: https://github.com/python/cpython/pull/22365

___
Python tracker 

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



[issue41823] Add more fields to sys.float_info

2020-09-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

Double rounding is a property of how operations on floats are carried out, 
rather than being a property of the float format itself; I'm not sure that it 
belongs in float_info. It's also potentially ill-defined. Right now, as far as 
I *know*, it seems to be the case that our builds of CPython on x86 or x64 
either consistently use x87+extended precision for all floating-point 
operations, or they consistently use SSE2 for all floating-point operations, 
but there's no reason that a build couldn't use SSE2 in some cases and 
x87+extended precision in others. (There are also subtle differences between 
x87+53-bit precision setting and IEEE 754-following SSE2.)

We also don't have any _reliable_ way to tell whether floats use IEEE 754, 
though we do have some ad-hoc ways that seem to work in practice (at least for 
now).

--

___
Python tracker 

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



[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-22 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 0d0e9fe2ffc1683758a1985ef6dedeef5ecafdbc by Bas van Beek in 
branch 'master':
bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & 
`.NotImplementedType` (GH-22336)
https://github.com/python/cpython/commit/0d0e9fe2ffc1683758a1985ef6dedeef5ecafdbc


--

___
Python tracker 

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



[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-22 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-22 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset a68a2ad19c891faa891904b3da537911cc77df21 by Thomas Grainger in 
branch 'master':
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module 
(#21956)
https://github.com/python/cpython/commit/a68a2ad19c891faa891904b3da537911cc77df21


--

___
Python tracker 

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



[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue41828] No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py

2020-09-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

No problem. Good luck!

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



[issue41828] No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py

2020-09-22 Thread Drew Scholz


Drew Scholz  added the comment:

I think you are right. I'll move this to the Django bug tracker. 

Thank you.

--

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

xref addition and 'extension' deletion are done already.  Added /* sentence and 
generally edited entry.  A few details have changed.

--
stage: patch review -> commit review
type: enhancement -> behavior
versions: +Python 3.10, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue35764] IDLE: revise calltip doc

2020-09-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Eryk Sun


Eryk Sun  added the comment:

> " OSError: [WinError 126] The specified module could not be found" is 
> raised when calling ctypes.CDLL(dll_path) even when this "dll_path" 
> exists... because the error comes from another DLL.

That's the old error. bpo-36085 changed it to FileNotFoundError, with the 
message "Could not find module '%.500S'. Try using the full path with 
constructor syntax." bpo-39393 modified the message to "Could not find module 
'%.500S' (or one of its dependencies). Try using the full path with constructor 
syntax."

IMO, the most direct way to resolve the problem is by enabling "loader snaps" 
for python.exe via gflags and attaching a native debugger to the process. The 
loader outputs debug strings that show the computed DLL search path (from 
LdrpComputeLazyDllPath), each attempt to resolve the dependent DLL to a 
directory in the search path (via LdrpResolveDllName), and the final result 
from loader's work queue (from LdrpProcessWork), which includes the dependent 
DLL that caused loading to fail and the parent module (DLL or EXE) that depends 
on it.

--
nosy: +eryksun

___
Python tracker 

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



[issue41817] Incorrect types in tkinter.EventType Enum

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset ea0711a9f9f207d6d4ca037d90de6ec60db131b0 by Ethan Furman in 
branch 'master':
bpo-41817: use new StrEnum to ensure all members are strings (GH-22348)
https://github.com/python/cpython/commit/ea0711a9f9f207d6d4ca037d90de6ec60db131b0


--

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread Ammar Askar


Ammar Askar  added the comment:

Having the target in the thread name definitely seems like a good idea and 
would help ease debugging, not just for our tests but when printing thread 
objects in general. 

I would agree with the suggestion of placing the counter in there for when 
multiple threads get spawned with the same target or maybe even using names 
like:

  Thread-1 (doit)
  Thread-2
  Thread-3 (print)

might be better just for people who are familiar with them.

--
nosy: +ammar2

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-09-22 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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-09-22 Thread hai shi


Change by hai shi :


--
pull_requests: +21401
pull_request: https://github.com/python/cpython/pull/22360

___
Python tracker 

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



[issue15500] Python should support exporting thread names to the OS

2020-09-22 Thread STINNER Victor


Change by STINNER Victor :


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



[issue15500] Python should support exporting thread names to the OS

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-18006 "Set thread name in linux kernel" was marked as a duplicate of this 
issue:

"""
In linux (Since 2.6.9) we can use syscall

prctl(PR_SET_NAME, "Some thread name")

to set thread name to the kernel.
(...)
"""

--
nosy: +vstinner

___
Python tracker 

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



[issue36666] threading.Thread should have way to catch an exception thrown within

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

I consider that this issue as a duplicate of bpo-1230540. Python 3.8 has a new 
threading.excepthook hook which can be used in various ways to decide how to 
handle uncatched thread exceptions.

https://docs.python.org/dev/library/threading.html#threading.excepthook

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add threading.excepthook() to handle uncaught exceptions raised 
by Thread.run()

___
Python tracker 

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



[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +21400
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22362

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-15500 "Python should support exporting thread names to the OS".

--

___
Python tracker 

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



[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2020-09-22 Thread Vidar Fauske


Vidar Fauske  added the comment:

A somewhat easy repro:

Create the temporary directory, add a subdir (not sure if subdir truly 
necessary at this point), use `os.chdir()` to set the cwd to that subdir. Clean 
up the temp dir. The cwd should prevent the deletion because it will be "in 
use".

--

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

> And what if run different threads with the same target or with different 
> targets with the same name?

If multiple Thread objects using the same target (or different targets with the 
same name), they all get the same name using my PR 22357.

> Would not "Thread-3" be more useful in this case?

Well, that's an open question. In my experience, "Thread" name is pretty 
useless.

What if I modify my PR to add "-{counter}" (ex: "func-3" for 
target.__name__="func") to the default name? Reuse _counter().

Pseudo-code:

self._name = str(name)
try:
base_name = target.__name__
except AttributeError:
base_name = "Thread"
if not self._name:
self._name = "{base_name)-{_counter()}"

--

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Philippe Ombredanne


Philippe Ombredanne  added the comment:

Eric Smith, you wrote:

> My understanding is that Windows doesn't tell you which DLL is missing. I 
> think the best we could do is append something to the error message saying 
> "or one its dependencies".

If we have such an error message, this means the main DLL exists: the original 
path passed to ctypes exists and is a valid DLL otherwise the message would be 
different. 

So I think that this is always a direct or indirect dependency of that primary 
DLL that would be missing and we could be explicit in the error message.

We could also provide some hints in the error message on how to research the 
issue may be?

--
nosy:  -altendky

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Kyle Altendorf


Change by Kyle Altendorf :


--
nosy: +altendky

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Philippe Ombredanne


Philippe Ombredanne  added the comment:

>From https://bugs.python.org/issue41836 closed as a dupe of this:

When the dependency of a DLL is missing (at least on Windows) the error " 
OSError: [WinError 126] The specified module could not be found" is raised when 
calling ctypes.CDLL(dll_path) even when this "dll_path" exists... because the 
error comes from another DLL.

These errors are really hard to diagnose because the path of the missing DLL is 
not returned in the exception message. Returning it would help fixing these 
kind of errors quickly.

Researching errors such as this one 
https://github.com/nexB/scancode-toolkit/issues/2236 wastes quite a bit of time 
and would be made a non issue if we had the path in the error message.


and this reply from Eric Smith: https://bugs.python.org/msg377324

> Author: Eric V. Smith (eric.smith) * (Python committer)   Date: 
> 2020-09-22 14:13

> My understanding is that Windows doesn't tell you which DLL is missing. I 
> think the best we could do is append something to the error message saying 
> "or one its dependencies".

--
nosy: +pombredanne

___
Python tracker 

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



[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Philippe Ombredanne


Philippe Ombredanne  added the comment:

Eric, Thanks!
This is IMHO a dupe of https://bugs.python.org/issue25655 in earnest. So I am 
closing this in favor of that and will carry over comments there

--
components:  -Windows
resolution:  -> duplicate
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



[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

My understanding is that Windows doesn't tell you which DLL is missing. I think 
the best we could do is append something to the error message saying "or one 
its dependencies".

--
components: +Windows
nosy: +eric.smith, 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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I've also created this alternative to option 2:

- https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-mixin

This alternative approach uses a mix-in rather than subclasses, creating a new 
class on-demand. I was hoping this approach would enable just augmenting the 
instance rather than affecting `source.__class__`, but when I got to the 
implementation, I found that `source.__class__` had to be mutated regardless.

This approach does have an advantage over option 2 in that it would support 
other ZipFile subclasses for source. It has the disadvantage in that it creates 
a new subclass for every instance created.

I've thought about it a lot and while I'm not particularly happy with any of 
the approaches, I'm leaning toward option 2.

--

___
Python tracker 

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



[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Kyle Altendorf


Change by Kyle Altendorf :


--
nosy: +altendky

___
Python tracker 

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



[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Philippe Ombredanne


New submission from Philippe Ombredanne :

When the dependency of a DLL is missing (at least on Windows) the error " 
OSError: [WinError 126] The specified module could not be found" is raised when 
calling ctypes.CDLL(dll_path) even when this "dll_path" exists... because the 
error comes from another DLL.

These errors are really hard to diagnose because the path of the missing DLL is 
not returned in the exception message. Returning it would help fixing these 
kind of errors quickly.

Researching errors such as this one 
https://github.com/nexB/scancode-toolkit/issues/2236 wastes quite a bit of time 
and would be made a non issue if we had the path in the error message.

--
components: ctypes
messages: 377322
nosy: pombredanne
priority: normal
severity: normal
status: open
title: Improve ctypes error reporting with missing DLL path
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:

>From Serhiy Storchaka:
-
The only exception is StrEnum -- overriding __str__ of str
subclass may be not safe. Some code will call str() implicitly, other
will read the string content of the object directly, and they will be
different.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And what if run different threads with the same target or with different 
targets with the same name? Would not "Thread-3" be more useful in this case?

for i in range(10):
Thread(target=print, args=(i,)).start()

for i in range(10):
def doit(i=i):
print(i)
Thread(target=doit).start()

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32682] test_zlib improve version parsing

2020-09-22 Thread pmp-p


Change by pmp-p :


--
pull_requests: +21399
pull_request: https://github.com/python/cpython/pull/22361

___
Python tracker 

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



[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 557b9a52edc4445cec293f2cc2c268c4f564adcf by Serhiy Storchaka in 
branch 'master':
bpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358)
https://github.com/python/cpython/commit/557b9a52edc4445cec293f2cc2c268c4f564adcf


--

___
Python tracker 

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



[issue41835] Speed up dict vectorcall creation using keywords

2020-09-22 Thread Marco Sulla


New submission from Marco Sulla :

I've done a PR that speeds up the vectorcall creation of a dict using keyword 
arguments. The PR in practice creates a insertdict_init(), a specialized 
version of insertdict. I quote the comment to the function:

Same to insertdict but specialized for inserting without resizing and for dict 
that are populated in a loop and was empty before (see the empty arg).
Note that resizing must be done before calling this function. If not 
possible, use insertdict(). Furthermore, ma_version_tag is left unchanged, you 
have to change it after calling this function (probably at the end of a loop).

This change speeds up the code up to a 30%. Tested with:

python -m timeit -n 2000  --setup "from uuid import uuid4 ; o =
{str(uuid4()).replace('-', '') : str(uuid4()).replace('-', '') for i
in range(1)}" "dict(**o)"

--
components: Interpreter Core
messages: 377318
nosy: Marco Sulla, inada.naoki
priority: normal
pull_requests: 21398
severity: normal
status: open
title: Speed up dict vectorcall creation using keywords
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



[issue41834] Remove _Py_CheckRecursionLimit variable

2020-09-22 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41834] Remove _Py_CheckRecursionLimit variable

2020-09-22 Thread STINNER Victor


New submission from STINNER Victor :

_Py_CheckRecursionLimit variable is no longer needed and can be removed.

In Python 3.9, I added a recursion limit per interpreter.

In Python 3.8 and older, it was used by _Py_MakeRecCheck() macro to check for 
recursion error. 

Previously, the _Py_CheckRecursionLimit variable was kept for backward 
compatibility with the stable ABI, but in Python 3.8 and older, 
Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() could not be used with the 
limited C API since these macros accessed PyThreadState structure member, 
whereas the structure is opaque in the limited C API.

Attached PR removed the variable.

---

(3) bpo-40513: Limit made per interpreter.

commit 4e30ed3af06ae655f4cb8aad8cba21f341384250
Author: Victor Stinner 
Date:   Tue May 5 16:52:52 2020 +0200

bpo-40513: Per-interpreter recursion_limit (GH-19929)

Move recursion_limit member from _PyRuntimeState.ceval to
PyInterpreterState.ceval.

* Py_SetRecursionLimit() now only sets _Py_CheckRecursionLimit
  of ceval.c if the current Python thread is part of the main
  interpreter.
* Inline _Py_MakeEndRecCheck() into _Py_LeaveRecursiveCall().
* Convert _Py_RecursionLimitLowerWaterMark() macro into a static
  inline function.

---

(2) bpo-38644: The _Py_CheckRecursionLimit variable was used by 
Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros. I converted these 
macros into function calls in Python 3.9:

commit f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613
Author: Victor Stinner 
Date:   Mon Nov 4 19:48:34 2019 +0100

bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)

Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as
regular functions for the limited API. Previously, there were defined
as macros, but these macros didn't work with the limited API which
cannot access PyThreadState.recursion_depth field.

Remove _Py_CheckRecursionLimit from the stable ABI.

Add Include/cpython/ceval.h header file.

In pycore_ceval.h, the function is overriden by a macro which points to an 
inline function which uses:

* tstate->recursion_depth
* tstate->interp->ceval.recursion_limit
* tstate->stackcheck_counter (if USE_STACKCHECK macro is defined)

---

(1) bpo-31857: Original change adding the FIXME.

commit 1896793520a49a6f97ae360c0b288967e56b005e
Author: pdox 
Date:   Wed Oct 25 23:03:01 2017 -0700

bpo-31857: Make the behavior of USE_STACKCHECK deterministic (#4098)

This change added the FIXME comment:

/* Due to the macros in which it's used, _Py_CheckRecursionLimit is in
   the stable ABI.  It should be removed therefrom when possible.
*/

--
components: C API
messages: 377317
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove _Py_CheckRecursionLimit variable
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



[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2020-09-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Vidar! I wasn't sure about Windows, but was not able to reproduce 
possible failures. Your report gives a clue.

--

___
Python tracker 

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



[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21396
pull_request: https://github.com/python/cpython/pull/22358

___
Python tracker 

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



[issue41739] test_logging: threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-41833 "threading.Thread: use target name if the name parameter is 
omitted" to help me to debug this issue.

--

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-09-22 Thread STINNER Victor


New submission from STINNER Victor :

When debugging race conditions in a multithreaded application with many 
threads, it's hard to debug when threads have generic names like "Thread-3".

I propose to use the target name in threading.Thread constructor if the name 
parameter is omitted.


See for example bpo-41739 with "Dangling thread: ": the "Thread-3" name is not helpful. I suspect that the 
bug comes from threading.Thread(target=remove_loop, args=(fn, del_count)): with 
my proposed change, the thread would be called "target=remove_loop", which is 
more helpful than "Thread".

Fall back on _newname() as usual if target.__name__ attribute does not exist.

Attached PR implements this idea.

--
components: Library (Lib)
messages: 377314
nosy: vstinner
priority: normal
severity: normal
status: open
title: threading.Thread: use target name if the name parameter is omitted
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



[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2020-09-22 Thread Stefan Behnel


Stefan Behnel  added the comment:

FYI, https://github.com/cython/cython/pull/3427 has been merged into Cython. In 
Cython 3.0, compiled coroutines will disguise as non-compiled coroutines, from 
the PoV of asyncio.

Restricting this ticket to Py3.10 since we're rather discussing a new feature 
now.

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



[issue41739] test_logging: threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

Previous issues:

* bpo-30131: "test_logging now joins queue threads"
* bpo-30830: test_logging uses threading_setup/cleanup, logging.config.listen() 
calls server_close(), socketserver.ThreadingMixIn.server_close()
* bpo-31235: Fix ResourceWarning in test_logging

--

___
Python tracker 

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



[issue41739] test_logging: threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)

2020-09-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also https://pythondev.readthedocs.io/unstable_tests.html

--

___
Python tracker 

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



[issue41828] No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py

2020-09-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

This seems like a Django specific error, in which case this isn't the correct 
bug tracker to report the problem.

Can you reproduce a problem with just straight Python, without using Django?

--
nosy: +eric.smith

___
Python tracker 

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



[issue40670] supplying an empty string to timeit causes an IndentationError

2020-09-22 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type:  -> behavior

___
Python tracker 

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



[issue35144] TemporaryDirectory clean-up fails with unsearchable directories

2020-09-22 Thread Vidar Fauske


Vidar Fauske  added the comment:

On Python 3.8.5 on Windows using the code from the above patch I recently got a 
stack overflow:

Thread 0x2054 (most recent call first):
  File "...\lib\concurrent\futures\thread.py", line 78 in _worker
  File "...\lib\threading.py", line 870 in run
  File "...\lib\threading.py", line 932 in _bootstrap_inner
  File "...\lib\threading.py", line 890 in _bootstrap

Thread 0x0de4 (most recent call first):
  File "...\lib\concurrent\futures\thread.py", line 78 in _worker
  File "...\lib\threading.py", line 870 in run
  File "...\lib\threading.py", line 932 in _bootstrap_inner
  File "...\lib\threading.py", line 890 in _bootstrap

Current thread 0x4700 (most recent call first):
  File "...\lib\tempfile.py", line 803 in onerror
  File "...\lib\shutil.py", line 619 in _rmtree_unsafe
  File "...\lib\shutil.py", line 737 in rmtree
  File "...\lib\tempfile.py", line 814 in _rmtree
  File "...\lib\tempfile.py", line 806 in onerror
  File "...\lib\shutil.py", line 619 in _rmtree_unsafe
  File "...\lib\shutil.py", line 737 in rmtree
  ... repeating

---


In my case, the outer `exc_info` from rmtree is:

PermissionError(13, 'The process cannot access the file because it is being 
used by another process')


And the inner exception from `_os.unlink(path)` is:

PermissionError(13, 'Access is denied')



I would say that expected behavior in this case would be to let the 'file is in 
use' error raise, instead of killing the process with an SO.

--
nosy: +vidartf

___
Python tracker 

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



[issue41825] os.waitid() documentation needs TLC

2020-09-22 Thread Georg Brandl


Change by Georg Brandl :


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

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-09-22 Thread STINNER Victor


New submission from STINNER Victor :

When a Python type is defined in a C extension module as a static type, its 
documentation can be a NULL string (NULL pointer). But PyType_FromSpec() does 
crash if tp_doc is NULL, since this change:

commit 032400b2d83ba1c2e4ee1cd33f51e9a598b2cf6c
Author: Georg Brandl 
Date:   Sat Feb 19 21:47:02 2011 +

#11249: in PyType_FromSpec, copy tp_doc slot since it usually will point to 
a static string literal which should not be deallocated together with the type.

(...)
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index e9c7591b81..b1fe44ebe4 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2347,6 +2347,17 @@ PyObject* PyType_FromSpec(PyType_Spec *spec)
goto fail;
}
*(void**)(res_start + slotoffsets[slot->slot]) = slot->pfunc;
+
+/* need to make a copy of the docstring slot, which usually
+   points to a static string literal */
+if (slot->slot == Py_tp_doc) {
+ssize_t len = strlen(slot->pfunc)+1;
+char *tp_doc = PyObject_MALLOC(len);
+if (tp_doc == NULL)
+   goto fail;
+memcpy(tp_doc, slot->pfunc, len);
+res->ht_type.tp_doc = tp_doc;
+}
 }
 
 return (PyObject*)res;


I propose to accept tp_doc=NULL in PyType_FromSpec(), as we do in static types.

I noticed this difference while reviewing PR 0 which convert _lsprof 
extension static types to heap types.

--
components: Interpreter Core
messages: 377308
nosy: vstinner
priority: normal
severity: normal
status: open
title: PyType_FromSpec() should accept tp_doc=NULL
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



[issue41830] "NameError: name 'AttributeError' is not defined"

2020-09-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It can happen when some objects with __del__ are kept alive at the interpreter 
shutdown stage and outlive the builtins module. I have not seen such errors for 
a long time. Could you reproduce it on newer Python versions? Could you 
reproduce it with simpler script?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41831] Restore default __str__ of tkinter.EventType

2020-09-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21393
pull_request: https://github.com/python/cpython/pull/22355

___
Python tracker 

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



[issue41831] Restore default __str__ of tkinter.EventType

2020-09-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41831] Restore default __str__ of tkinter.EventType

2020-09-22 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The tkinter.EventType enum was introduced in issue27294. It implements __str__ 
as returning the name for the sole purpose of using in Event.__repr__(). But 
overriding __str__ in the str subclass may be not good idea, because different 
code will get different string representation, depending on whether it calls 
str() explicitly or implicitly (Python code) or read the content of the str 
object directly using C API (C code).

The following code sets EventType.__str__ = str.__str__, so both method will 
get the same value. Instead Event.__repr__() was changed to use the name of the 
enum member directly.

--
components: Tkinter
messages: 377306
nosy: ethan.furman, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: Restore default __str__ of tkinter.EventType
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue41830] "NameError: name 'AttributeError' is not defined"

2020-09-22 Thread sanka sowmya


New submission from sanka sowmya :

I am using 3.6.8 version of python.
I am seeing an error as NameError: name 'AttributeError' is not defined

URL where logs can be seen:https://bpa.st/DDTQ

--
messages: 377305
nosy: sasowmy1
priority: normal
severity: normal
status: open
title: "NameError: name 'AttributeError' is not defined"
type: behavior
versions: Python 3.6

___
Python tracker 

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