[issue44356] Abstract enum mixins not allowed

2021-06-08 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44356] Abstract enum mixins not allowed

2021-06-08 Thread Jordan Ephron


New submission from Jordan Ephron :

Prior to 3.8 it was possible to create "abstract" enums (without members) and 
mix them together. To motivate with an example, perhaps we're modeling an API 
and want to be robust in the face of inconsistent casing


class CaseInsensitiveStrEnum(str, Enum):
@classmethod
def _missing_(cls, value):
for member in cls._member_map_.values():
if member._value_.lower() == value.lower():
return member
return super()._missing_(value)


and perhaps we also want to be robust in response to extensibility


class LenientStrEnum(str, Enum):
@classmethod
def _missing_(cls, value):
logger.warning(
f"[{cls.__name__}] encountered an unknown value!\n"
f"Luckily I'm a LenientStrEnum, so I won't crash just yet.\n"
f"You might want to add a new case though.\n"
f"Value was: '{value}'"
)
return UnexpectedStr(value)


but we also want to model some known good set of values, so mixing together the 
abstract enums we'd get something like


class JobStatus(CaseInsensitiveStrEnum, LenientStrEnum):
ACTIVE = "active"
PENDING = "pending"
TERMINATED = "terminated"

However, due to the resolution of https://bugs.python.org/issue39587 this no 
longer works, instead producing:

TypeError: 'JobStatus': too many data types: [, ]


The relevant change is

https://github.com/ethanfurman/cpython/commit/bff01f3a3aac0c15fe8fbe8b2f561f7927d117a1

I believe that if we made `data_types` a set rather than a list then the 
example would become valid once again.

--
messages: 395378
nosy: JEphron
priority: normal
severity: normal
status: open
title: Abstract enum mixins not allowed
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-06-08 Thread Cameron Simpson


Change by Cameron Simpson :


--
nosy: +cameron

___
Python tracker 

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



[issue39345] Py_Initialize Hangs on Windows 10

2021-06-08 Thread Duane Griffin


Duane Griffin  added the comment:

I can reproduce this on Windows 10 with Python 3.9. See attached source. At 
least for us, it is hanging when one thread is doing a read on the file 
descriptor while a second calls Py_Initialize (or just dup directly).

The windows kernel call stack shows the dup call is waiting on a critical 
section, while the thread reading from stdin is waiting in ReadFile. I can get 
a full stack trace from WinDbg if it is helpful, but hopefully the attached 
code should be enough to reproduce the problem at will for anyone interested.

If stdin is receiving input, or is closed, then the read call will complete and 
unblock dup in due course. However if not then it will hang indefinitely.

If we can fix this to work reliably in Python that would be great. Otherwise, 
or in the meantime, we could just add a note to the documentation. We are going 
to try and work-around it by using a different file descriptor instead of 
stdin. Other applications might be able to avoid IO using stdin until after 
python is initialised.

--
nosy: +duaneg
Added file: https://bugs.python.org/file50099/dup-hang.c

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-08 Thread Yury Selivanov


Yury Selivanov  added the comment:

>  MultiLoopChildWatcher must ensures that the event loop is awaken when it 
> receives a signal by using signal.setwakeup(). This is done by 
> _UnixSelectorEventLoop.add_signal_handler(). Maybe MultiLoopChildWatcher 
> could reuse this function, rather than calling directly signal.signal().

I think this is a good idea. MultiLoopChildWatcher could use setwakeupfd with 
some no-op callback just to wakeup the loop.

--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 33a7a24288988134e89200a33802af56a2dee31e by Miss Islington (bot) 
in branch '3.10':
bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618)
https://github.com/python/cpython/commit/33a7a24288988134e89200a33802af56a2dee31e


--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset c8353239eda0d05f7facd1a19acc2b836a057807 by Miss Islington (bot) 
in branch '3.9':
bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618)
https://github.com/python/cpython/commit/c8353239eda0d05f7facd1a19acc2b836a057807


--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25204
pull_request: https://github.com/python/cpython/pull/26620

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25203
pull_request: https://github.com/python/cpython/pull/26619

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5571cabf1b3385087aba2c7c10289bba77494e08 by Terry Jan Reedy in 
branch 'main':
 bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618)
https://github.com/python/cpython/commit/5571cabf1b3385087aba2c7c10289bba77494e08


--

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-06-08 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PR-26618 wraps the extension functions in a new class, ExtPage, and then moves 
the new class after GenPage.

I verified that replacing the indent slider with a spinbox results in the 
dialog being shorter by the full height of the helplist frame.  I will do that 
(or use a plain entry box) when I move it Window Preferences, after splitting 
GenPage.

--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +25202
pull_request: https://github.com/python/cpython/pull/26618

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-06-08 Thread Steven D'Aprano


New submission from Steven D'Aprano :

Format strings should allow spaces around keys and indices. This might be as 
simple as running str.strip() on the contents of curly braces?

Aside from indentation and newlines, in most other contexts whitespace is 
insignificant. E.g. in subscripting `seq[ index ]`. But format strings treat 
spaces as part of the index or key, which is surprising.

f-strings, on the other hand, already allow spaces around expressions and keys:

>>> name = 'Brian'
>>> f'{ name.upper() }'
'BRIAN'


Examples:

'{ }'.format(30)
Expect to get '30'
but get KeyError: ' '


'{ 0 }'.format(30)
Expect to get '30'
but get KeyError: ' 0 '

'{ x }'.format(x=30)
Expect to get '30'
but get KeyError: ' x '


See discussion here:

https://discuss.python.org/t/please-help-key-error/9168/1

--
messages: 395371
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Allow spaces in format strings
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue35800] remove smtpd.MailmanProxy

2021-06-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 4.0 -> 5.0
pull_requests: +25201
pull_request: https://github.com/python/cpython/pull/26617

___
Python tracker 

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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c0496093e54edb78d2bd09b083b73e1e5b9e7242 by Miss Islington (bot) 
in branch '3.10':
bpo-44349: Fix edge case when displaying text from files with encoding in 
syntax errors (GH-26611) (GH-26616)
https://github.com/python/cpython/commit/c0496093e54edb78d2bd09b083b73e1e5b9e7242


--

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9fd21f649d66dcb10108ee395fd68ed32c8239cd by Pablo Galindo in 
branch 'main':
bpo-44349: Fix edge case when displaying text from files with encoding in 
syntax errors (GH-26611)
https://github.com/python/cpython/commit/9fd21f649d66dcb10108ee395fd68ed32c8239cd


--

___
Python tracker 

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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-08 Thread Akira Nonaka


Change by Akira Nonaka :


--
pull_requests: +25199
pull_request: https://github.com/python/cpython/pull/26615

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset eeefa7f6c0cc64bc74c3b96a0ebbff1a2b9d3199 by Miss Islington (bot) 
in branch '3.10':
bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)
https://github.com/python/cpython/commit/eeefa7f6c0cc64bc74c3b96a0ebbff1a2b9d3199


--

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25198
pull_request: https://github.com/python/cpython/pull/26614

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 2ea6d890281c415e0a2f00e63526e592da8ce3d9 by Serhiy Storchaka in 
branch 'main':
bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)
https://github.com/python/cpython/commit/2ea6d890281c415e0a2f00e63526e592da8ce3d9


--
nosy: +miss-islington

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-06-08 Thread Ned Deily


Change by Ned Deily :


--
components: +Build -Interpreter Core
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44354] ssl deprecation warnings erganomics

2021-06-08 Thread Thomas Grainger


Thomas Grainger  added the comment:

the "ssl module:" part of the warning message, I think, is redundant as it 
should be defined in the 
https://docs.python.org/3/library/warnings.html#warnings.warn_explicit module 
kwarg

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 3e1c7167d86a2a928cdcb659094aa10bb5550c4c by Eric Snow in branch 
'main':
 bpo-43693: Un-revert commit f3fa63e. (#26609)
https://github.com/python/cpython/commit/3e1c7167d86a2a928cdcb659094aa10bb5550c4c


--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset c03f0ab259dc6d1447d47e845c6465b59f9a032c by Miss Islington (bot) 
in branch '3.9':
bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593)
https://github.com/python/cpython/commit/c03f0ab259dc6d1447d47e845c6465b59f9a032c


--

___
Python tracker 

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



[issue44350] IDLE: support Command-click on window title on macOS

2021-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Documented as macOS specific at https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm.  
But I would not know about C-click from "Specifies the path of the file 
referenced as the window proxy icon (which can be dragged and dropped in lieu 
of the file's finder icon). "

IDLE document windows already have the absolute path in the title.  There is 
only an issue if it is too long for the space, such as when editing installed 
idlelib test files.  I don't know what will happen if/when you use tabbed 
windows.

In the meanwhile, it would be easy to add
if long and sys.platform == 'darwin':
# Only valid as long as 'long' is absolute path.
self.top.wm_attributes("-titlepath", long)
to the end of editor.EditorWindow.saved_change_hook.

Ned or Ronald, is this worth it?  Is there any downside to this?

--

___
Python tracker 

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



[issue44350] IDLE: support Command-click on window title on macOS

2021-06-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren
title: Make IDLE support Command-click on window title on macOS -> IDLE: 
support Command-click on window title on macOS
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



[issue44354] ssl deprecation warnings erganomics

2021-06-08 Thread Thomas Grainger


New submission from Thomas Grainger :

The ssl module OP_NO_* deprecation warning message is slightly wrong: The error 
message prints out "is deprecated is deprecated" because of an earlier format 
template

There's a colon in the warning message `ssl module:` and that makes it 
difficult to use in simplefilter

The NPN deprecation warnning raises a UserWarning instead of DeprecationWarning

see also UserWarning: ssl module: NPN is deprecated, use ALPN instead

--
messages: 395362
nosy: alex, christian.heimes, dstufft, graingert, janssen
priority: normal
pull_requests: 25197
severity: normal
status: open
title: ssl deprecation warnings erganomics
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-08 Thread Anthony Sottile


Anthony Sottile  added the comment:

they are directly coupled which is why I commented here

the api redesign forces O(N) lookups and O(N) constructions which directly 
impact performance causing the regression

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

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-08 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

As mentioned in msg394775, I'd like to decouple the performance concerns from 
the original incompatibility. I recognize that performance regressions are in 
their own way a form of incompatibility, but there have been a lot of changes 
to entry points with respect to performance, both prior to beta 1 and in beta 
2, including changes that intentionally traded performance for correctness 
(https://github.com/python/importlib_metadata/pull/281).

To that end, I've filed https://github.com/python/importlib_metadata/issues/324 
to track the concerns.

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

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-06-08 Thread Joseph Perez


New submission from Joseph Perez :

`typing.NewType` doesn't support PEP 604.

```
>>> import typing
>>> A = typing.NewType("A", int)
>>> B = typing.NewType("B", str)
>>> A | B
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for |: 'function' and 'function'
```

--
messages: 395359
nosy: joperez
priority: normal
severity: normal
status: open
title: PEP 604 NewType
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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 2cfe0e7061e9a2113e56e44a3e0c3f824cbc65db by Miss Islington (bot) 
in branch '3.10':
bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593)
https://github.com/python/cpython/commit/2cfe0e7061e9a2113e56e44a3e0c3f824cbc65db


--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25196
pull_request: https://github.com/python/cpython/pull/26613

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset ab36b9f83424a020fbd672f218612e6f19257a32 by Terry Jan Reedy in 
branch 'main':
bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593)
https://github.com/python/cpython/commit/ab36b9f83424a020fbd672f218612e6f19257a32


--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25195
pull_request: https://github.com/python/cpython/pull/26612

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 2a8d7122e0ceeb56b716cff7f8f31f13c26ad691 by Miss Islington (bot) 
in branch '3.10':
bpo-44335: Ensure the tokenizer doesn't go into Python with the error set 
(GH-26608)
https://github.com/python/cpython/commit/2a8d7122e0ceeb56b716cff7f8f31f13c26ad691


--

___
Python tracker 

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



[issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow

2021-06-08 Thread Mike Kaganski


New submission from Mike Kaganski :

On a Windows 10 system, which TZ is set to Moscow (UTC+3), I use a native 
Windows Python build (as opposed to e.g. one from Cygwin). Specifically, I 
tested both custom Python build created by LibreOffice project, as well as the 
Python by Python Software Foundation available from MS Store [1].

1. Open command prompt on Windows (cmd.exe).
2. Execute 'set TZ=Europe/Moscow'
3. Execute 'python'
4. In the Python prompt, execute 'import datetime'
5. Execute 'datetime.datetime.now()'

The result of this is a time that is two hours off, e.g.

> datetime.datetime(2021, 6, 8, 19, 59, 21, 925240)

instead of proper

> datetime.datetime(2021, 6, 8, 21, 59, 21, 925240)

which appears when step #2 is skipped.
Possibly Python takes both system time zone information *and* the environment 
variable into account when calculating the time. I suppose it should only 
consider one or the other, not both.

Note that the problem does not happen with Cygwin's Python, which works fine 
with the same TZ environment variable value.

For a real-life problem that results from this, see case at [2], where unit 
test is failing only from 00:00 till 02:00 on my local system, obviously 
telling me that I should sleep at that time, not try to run unit tests :-)

[1] https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l
[2] 
https://gerrit.libreoffice.org/c/core/+/92217/2#message-f55091795e7cde9d75adc00ddb69451121b644f6

--
components: Windows
messages: 395355
nosy: mikekaganski, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Native Windows Python builds running on Europe/Moscow TZ report wrong 
time from datetime.datetime.now when there is TZ environment variable also set 
to Europe/Moscow
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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think the simplest solution is PR 26611. 

Ammar, can you check if that works for you?

--

___
Python tracker 

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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25193
pull_request: https://github.com/python/cpython/pull/26610

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset bafe0aade5741ab0d13143ee261711fdd65e8a1f by Pablo Galindo in 
branch 'main':
bpo-44335: Ensure the tokenizer doesn't go into Python with the error set 
(GH-26608)
https://github.com/python/cpython/commit/bafe0aade5741ab0d13143ee261711fdd65e8a1f


--

___
Python tracker 

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



[issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10

2021-06-08 Thread Miro Hrončok

New submission from Miro Hrončok :

Hello. I think https://github.com/python/cpython/pull/23142 changed the 
behavior of distutils.sysconfig.parse_makefile().

A downstream Fedora report with an affected petsc package: 
https://bugzilla.redhat.com/show_bug.cgi?id=1959088


Reproducers (DeprecationWarnings removed for readability):


$ cat makefile
ALL: lib

DIRS = ssls asls # isls rscs
LOCDIR = src/tao/complementarity/impls/

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
include ${PETSC_DIR}/lib/petsc/conf/test


$ python3.9
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['ssls', 'asls']

$ python3.10
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['ssls', 'asls', '#', 'isls', 'rscs']



And:

$ cat makefile
-include ../../../../petscdir.mk
ALL: lib

LIBBASE  = libpetscksp
DIRS = cr bcgs bcgsl cg cgs gmres cheby rich lsqr preonly tcqmr tfqmr \
   qcg bicg minres symmlq lcd ibcgs python gcr fcg tsirm fetidp hpddm
LOCDIR   = src/ksp/ksp/impls/

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
include ${PETSC_DIR}/lib/petsc/conf/test

$ python3.9
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 
'preonly', 'tcqmr', 'tfqmr', 'qcg', 'bicg', 'minres', 'symmlq', 'lcd', 'ibcgs', 
'python', 'gcr', 'fcg', 'tsirm', 'fetidp', 'hpddm']

$ python3.10
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 
'preonly', 'tcqmr', 'tfqmr', '\\']


And:

$ cat makefile
-include ../../../../petscdir.mk
ALL: lib

LIBBASE  = libpetscksp
DIRS = jacobi none sor shell bjacobi mg eisens asm ksp composite redundant 
spai is pbjacobi vpbjacobi ml\
   mat hypre tfs fieldsplit factor galerkin cp wb python \
   chowiluviennacl chowiluviennaclcuda rowscalingviennacl 
rowscalingviennaclcuda saviennacl saviennaclcuda\
   lsc redistribute gasm svd gamg parms bddc kaczmarz telescope patch 
lmvm hmg deflation hpddm hara
LOCDIR   = src/ksp/pc/impls/

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
include ${PETSC_DIR}/lib/petsc/conf/test

$ python3.9
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 
'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml', 'mat', 
'hypre', 'tfs', 'fieldsplit', 'factor', 'galerkin', 'cp', 'wb', 'python', 
'chowiluviennacl', 'chowiluviennaclcuda', 'rowscalingviennacl', 
'rowscalingviennaclcuda', 'saviennacl', 'saviennaclcuda', 'lsc', 
'redistribute', 'gasm', 'svd', 'gamg', 'parms', 'bddc', 'kaczmarz', 
'telescope', 'patch', 'lmvm', 'hmg', 'deflation', 'hpddm', 'hara']

$ python3.10
>>> from distutils.sysconfig import parse_makefile
>>> makevars = parse_makefile('makefile')
>>> makevars.get('DIRS','').split()
['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 
'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml\\']

--
components: Library (Lib)
messages: 395352
nosy: frenzy, hroncok, petr.viktorin
priority: normal
severity: normal
status: open
title: distutils.sysconfig.parse_makefile() regression in Python 3.10
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25192
pull_request: https://github.com/python/cpython/pull/26609

___
Python tracker 

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



[issue44349] Edge case in compiler when error displaying with non-utf8 lines

2021-06-08 Thread Ammar Askar


Change by Ammar Askar :


--
title: Edge case in when error displaying with non-utf8 lines -> Edge case in 
compiler when error displaying with non-utf8 lines

___
Python tracker 

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



[issue44349] Edge case in when error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This affects also older versions:

python3.8 lel.py
  File "lel.py", line 3

  ^
SyntaxError: Generator expression must be parenthesized

--
title: Edge case in pegen's error displaying with non-utf8 lines -> Edge case 
in when error displaying with non-utf8 lines

___
Python tracker 

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



[issue44349] Edge case in pegen's error displaying with non-utf8 lines

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Lysandros, could you take a look?

--

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25191
pull_request: https://github.com/python/cpython/pull/26608

___
Python tracker 

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



[issue44350] Make IDLE support Command-click on window title on macOS

2021-06-08 Thread Aivar Annamaa


Change by Aivar Annamaa :


--
title: Support Command-click on window title on macOS -> Make IDLE support 
Command-click on window title on macOS

___
Python tracker 

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



[issue44350] Support Command-click on window title on macOS

2021-06-08 Thread Aivar Annamaa


Aivar Annamaa  added the comment:

In short:

window.wm_attributes("-titlepath", stringContainingTheAbsolutePathOfTheDocument)


Passing empty string as the second argument turned the feature off.

--

___
Python tracker 

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



[issue44350] Support Command-click on window title on macOS

2021-06-08 Thread Aivar Annamaa


New submission from Aivar Annamaa :

Many macOS apps show location info about current document on command-clicking 
on window title.

I just found out how to do it in Tkinter, so I wanted to share it in case 
someone wants to add it for IDLE: 
https://sourceforge.net/p/tcl/mailman/tcl-mac/thread/CAEbkakfc%2B5hUGMyWpjGF2DO7dWOX-3AyR8UOjGfbP8djWWtG-A%40mail.gmail.com/#msg37298382

--
assignee:  -> terry.reedy
components: +IDLE
nosy: +terry.reedy
title: Support -> Support Command-click on window title on macOS

___
Python tracker 

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



[issue44350] Support

2021-06-08 Thread Aivar Annamaa


Change by Aivar Annamaa :


--
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: Support

___
Python tracker 

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



[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Mark would you mind sharing your opinions on this: 
https://bugs.python.org/issue44313 (should we still keep generating 
LOAD_METHOD/CALL_METHOD for potential objects imported through `from x import 
y`, or they also generate LOAD_ATTR/CALL_FUNCTION).

--
nosy: +BTaskaya

___
Python tracker 

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



[issue44349] Edge case in pegen's error displaying with non-utf8 lines

2021-06-08 Thread Ammar Askar

New submission from Ammar Askar :

The AST currently stores column offsets for characters as byte-offsets. 
However, when displaying errors, these byte-offsets must be turned into 
character-offsets so that the characters line up properly with the characters 
on the line when printed. This is done with the function 
`byte_offset_to_character_offset` 
(https://github.com/python/cpython/blob/fdc7e52f5f1853e350407c472ae031339ac7f60c/Parser/pegen.c#L142-L161)
 which assumes that the line is UTF8 encoded.

However, consider a file like this:

  '¢¢¢¢¢¢' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError

This prints

  File "test-normal.py", line 1
'¢¢¢¢¢¢' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError
  ^^
  SyntaxError: Generator expression must be parenthesized

as expected.


However if we use a custom source encoding line:

  # -*- coding: cp437 -*-
  '¢¢¢¢¢¢' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError

it ends up printing out

  File "C:\Users\ammar\junk\test-utf16.py", line 2
'¢¢' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError
  ^^
  SyntaxError: Generator expression must be parenthesized

where the carets/offsets are misaligned with the actual characters. This is 
because the string "¢" has the display width of 2 characters and encodes to 2 
bytes in cp437 but when interpreted as utf-8 is the single character "¢" with a 
display width of 1.

Note that this edge case is relatively hard to trigger because ordinarily what 
will happen here is that the call to PyErr_ProgramTextObject will fail because 
it tries to decode the line as utf-8: 
https://github.com/python/cpython/blob/ae3c66acb89a6104fcd0eea760f80a0287327cc4/Python/errors.c#L1693-L1696
 after which the error handling logic uses the tokenizer's internal buffer 
which has a proper utf-8 string.
So this bug requires the input to be valid as both utf-8 and the source 
encoding.

(Discovered while implementing PEP 657 
https://github.com/colnotab/cpython/issues/10)

--
components: Parser
messages: 395347
nosy: ammar2, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Edge case in pegen's error displaying with non-utf8 lines
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

The issue has been solved, all buildbots should now pass. Will continue to 
monitor the situation. Thanks for the report @kj!

--
priority: release blocker -> 
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 87f502231c6d5b04a4d8aa23fba24fcf5303aebb by Batuhan Taskaya in 
branch '3.9':
[3.9] bpo-11105: reduce the recursion limit for tests. (GH-26605)
https://github.com/python/cpython/commit/87f502231c6d5b04a4d8aa23fba24fcf5303aebb


--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset bd6f0d3eadfe5623657db6aeb69b94d21f86f4a0 by Batuhan Taskaya in 
branch '3.10':
[3.10] bpo-11105: reduce the recursion limit for tests. (GH-26607)
https://github.com/python/cpython/commit/bd6f0d3eadfe5623657db6aeb69b94d21f86f4a0


--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 8004c4570b1d1277ea8754e22b5eb60e63f5026c by Batuhan Taskaya in 
branch 'main':
bpo-11105: document the new test.support.infinite_recursion context manager 
(GH-26604)
https://github.com/python/cpython/commit/8004c4570b1d1277ea8754e22b5eb60e63f5026c


--

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-08 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25190
pull_request: https://github.com/python/cpython/pull/26607

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25188
pull_request: https://github.com/python/cpython/pull/26605

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-08 Thread Steve Dower


Steve Dower  added the comment:

> Decrease the global recursion limit only for windows debug.

This is already what we do, so if someone has increased stack usage, they 
should also decrease the value here.

Hopefully the non-debug value doesn't have to be reduced. In that case, it's 
worth looking at the stack allocations to reduce it (e.g. I once fixed this by 
moving a rarely used buffer into a dynamic allocation rather than a local, 
which saved about 1KB/frame).

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25187
pull_request: https://github.com/python/cpython/pull/26604

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset e58d762c1fb4ad5e021d016c80c2bc4513632d2f by Batuhan Taskaya in 
branch 'main':
bpo-11105: reduce the recursion limit for tests (GH-26550)
https://github.com/python/cpython/commit/e58d762c1fb4ad5e021d016c80c2bc4513632d2f


--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-08 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth
nosy_count: 11.0 -> 12.0
pull_requests: +25186
pull_request: https://github.com/python/cpython/pull/26578

___
Python tracker 

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



[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-06-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Dennis]

> I think the relevant property is that the exponent is not an integer

Yep: the delegation to complex pow kicks in after handling infinities and nans, 
and only for strictly negative base (-0.0 doesn't count as negative for this 
purpose) and non-integral exponent.

Here's the relevant code: 
https://github.com/python/cpython/blob/257e400a19b34c7da6e2aa500d80b54e4c4dbf6f/Objects/floatobject.c#L773-L782

To avoid confusion, we should probably not mention fractions like `1/3` and 
`4/3` as example exponents in the documentation, since those hit the 
What-You-See-Is-Not-What-You-Get nature of binary floating-point. 
Mathematically, `z^(1/3)` is a very different thing from 
`z^(6004799503160661/18014398509481984)` for a negative real number `z`, and 
the latter is what's _actually_ being computed with `z**(1/3)`. The advantage 
of the principal branch approach is that it's continuous in the exponent, so 
that `z^(1/3)` and `z^(6004799503160661/18014398509481984)` only differ by a 
tiny amount.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Pablo!

--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-06-08 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 75185561a9a3b6dede3ad87bd83bab66847bd425 by Miss Islington (bot) 
in branch '3.10':
bpo-43795: Note Stable ABI PEP in What's New (GH-26479) (GH-26603)
https://github.com/python/cpython/commit/75185561a9a3b6dede3ad87bd83bab66847bd425


--

___
Python tracker 

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



[issue44329] [sqlite3] refactor pysqlite_statement_create

2021-06-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue44310] Document that lru_cache uses hard references

2021-06-08 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

Reading this bug thread last week made me realize we had made the following 
error in our code:


class SomethingView():
@functools.lru_cache()
def get_object(self):
return self._object


Now, as this class was instantiated for every (particular kind of) request to a 
webserver and this method called (a few times), the lru_cache just kept filling 
up and up. We had been having a memory leak we couldn't track down, and this 
was it.

I think this is an easy mistake to make and it was rooted, not so much in hard 
references though (without that though, it would have not leaked memory) but 
because of the fact the cache lives on the class and not the object.

--
nosy: +cryvate

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-06-08 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 257e400a19b34c7da6e2aa500d80b54e4c4dbf6f by Petr Viktorin in 
branch 'main':
bpo-43795: Note Stable ABI PEP in What's New (GH-26479)
https://github.com/python/cpython/commit/257e400a19b34c7da6e2aa500d80b54e4c4dbf6f


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25185
pull_request: https://github.com/python/cpython/pull/26603

___
Python tracker 

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



[issue44329] [sqlite3] refactor pysqlite_statement_create

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 1c02655fb08043b3027748ca1179c416c21a4277 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44329: Refactor sqlite3 statement creation (GH-26566)
https://github.com/python/cpython/commit/1c02655fb08043b3027748ca1179c416c21a4277


--

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-08 Thread Anthony Sottile


Anthony Sottile  added the comment:

here's the performance regressions, they affect any callers of 
`distributions()` and are even worse on callers of the new apis.

a call to distributions() is about 3x slower than in 3.9

here is the setup I am using:

virtualenv venv39 -ppython3.9
venv39/bin/pip install flake8 pytest twine pre-commit
virtualenv venv310 -ppython3.10
venv310/bin/pip install flake8 pytest twine pre-commit

to test just the `distributions()` call I'm using the following:

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'entry_points()'
20 loops, best of 20: 12.5 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'entry_points()'
20 loops, best of 20: 36.7 msec per loop
```

this is a less-extreme example, many applications have more dependencies 
installed -- but even in this case this is adding ~24ms startup to any 
application using `entry_points()` -- and it gets worse

the return value of `entry_points()` alone isn't all that useful, next an 
application needs to retrieve its entry points.  let's start for the somewhat 
normal case of retrieving a single category of entry points:

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'entry_points()["flake8.extension"]'
20 loops, best of 20: 12.7 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'entry_points(name="flake8.extension")'
20 loops, best of 20: 37.1 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'entry_points().select(group="flake8.extension")'
20 loops, best of 20: 37.1 msec per loop
```

again, 3x slower and very real time to the end user (~24-25ms)

now let's show an example usage that something like flake8 uses where multiple 
groups are requested (this is common for apps and plugin systems which provide 
multiple distinct functionalities)

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'eps = entry_points(); eps["flake8.extension"]; 
eps["flake8.report"]'
 
20 loops, best of 20: 12.6 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import 
entry_points' 'eps = entry_points(); eps.select(group="flake8.extension"); 
eps.select(group="flake8.report")'
20 loops, best of 20: 38.2 msec per loop
```

also slower, but an additional ms per call to `.select(...)`


and it only gets worse with more and more packages installed

here's the versions I'm using to ensure they are up to date:

```console
$ venv39/bin/python --version --version
Python 3.9.5 (default, May 19 2021, 11:32:47) 
[GCC 9.3.0]
$ venv310/bin/python --version --version
Python 3.10.0b2 (default, Jun  2 2021, 00:22:18) [GCC 9.3.0]
```

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

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Are there a bpo issue for the buildbot failures on Windows?

Yes, this one: https://bugs.python.org/issue44348

But just to clarify, the ones affecting this issue are the ones in ASAN, for 
example:

https://buildbot.python.org/all/#/builders/582/builds/227/steps/5/logs/stdio

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg395330

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Long term, I expect to fix it by decoupling the C and Python stacks.

That won't fix half of the Windows failures because the stack overflow you are 
seeing are for C to C calls if I am not mistaken. This happens on very deep 
calls when converting Python objects to C objects. There are no Python frames 
involved in that case IIRC.

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yes, this one: https://bugs.python.org/issue44348

> s there a bpo issue for the buildbot failures on Windows?
The failures I've been seeing are C stack overflows.

But the ones affecting this issue are the ones in ASAN:

https://buildbot.python.org/all/#/builders/581/builds/58

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Mark Shannon


Mark Shannon  added the comment:

Pablo,

Is there a bpo issue for the buildbot failures on Windows?
The failures I've been seeing are C stack overflows.

Long term, I expect to fix it by decoupling the C and Python stacks.
In the short term I have a couple of changes that might get it working again

--

___
Python tracker 

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



[issue14547] Python symlink to script behaves unexpectedly

2021-06-08 Thread ِAbdulrahman ِShawa

ِAbdulrahman ِShawa  added the comment:

hello guys 
I am facing problem with my sqlite3 database when i make changes it saves the 
changes for almost 13 hours and then retakes back all the changes that i made, 
i am using two threads in my code and i am not committing the data but i set 
the isolation mode to None,
i was using the same queries with mysql database with setting autocommit to on 
and it was working fine what could be the problem in your opinion?
we searched and ask a lot about this issue but nothing was helpful.

--
nosy: +free.abdo.sh
type: enhancement -> behavior
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 
3.5
Added file: https://bugs.python.org/file50098/main.py

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-08 Thread Akira Nonaka


Akira Nonaka  added the comment:

I have just signed the contributor agreement.

--

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-08 Thread Akira Nonaka


Change by Akira Nonaka :


--
pull_requests: +25184
pull_request: https://github.com/python/cpython/pull/26602

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3fe921cd49959181163671364c8b84faa88f7895 by Pablo Galindo in 
branch 'main':
Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. 
(gh-26396)" (GH-26597)
https://github.com/python/cpython/commit/3fe921cd49959181163671364c8b84faa88f7895


--

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 933b5b63598968c1ab4976f92570696a33c72cc4 by Miss Islington (bot) 
in branch '3.10':
bpo-44335: Fix a regression when identifying invalid characters in syntax 
errors (GH-26589)
https://github.com/python/cpython/commit/933b5b63598968c1ab4976f92570696a33c72cc4


--

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d334c73b56756e90c33ce06e3a6ec23271aa099d by Pablo Galindo in 
branch 'main':
bpo-44335: Fix a regression when identifying invalid characters in syntax 
errors (GH-26589)
https://github.com/python/cpython/commit/d334c73b56756e90c33ce06e3a6ec23271aa099d


--

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6d518bb3a11f9b16098f45b21a13ebe8f537f045 by Pablo Galindo in 
branch 'main':
bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function 
(GH-26493)" (GH-26596)
https://github.com/python/cpython/commit/6d518bb3a11f9b16098f45b21a13ebe8f537f045


--

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6d518bb3a11f9b16098f45b21a13ebe8f537f045 by Pablo Galindo in 
branch 'main':
bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function 
(GH-26493)" (GH-26596)
https://github.com/python/cpython/commit/6d518bb3a11f9b16098f45b21a13ebe8f537f045


--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The problem seems to be that The problem is that PyFrame_LocalsToFast(frame, 
1); calls into PyFrame_LocalsToFast where co->co_nlocals has a value of 3, and 
this causes co->co_cell2arg[i - co->co_nlocals]; to access outside the bounds 
of the array.

As this change is affecting all tests (there are many tests in the test suite 
that fail with a buffer overflow in the ASAN builds) I opened PR 26597 to 
revert commit commit631f9938b1604d4f893417ec339b9e0fa9196fb1. As always, 
please, recommit commit631f9938b1604d4f893417ec339b9e0fa9196fb1 once this 
issues are fixed.

To reproduce these failures locally you can:

$ export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0
$ ./configure --with-address-sanitizer --without-pymalloc
$ make -j -s
$ ./python -m test test_sys_settrac

--

___
Python tracker 

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



[issue37224] [subinterpreters] test__xxsubinterpreters fails randomly

2021-06-08 Thread hai shi


Change by hai shi :


--
pull_requests: +25182
pull_request: https://github.com/python/cpython/pull/26598

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25181
pull_request: https://github.com/python/cpython/pull/26597

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2021-06-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 13.0 -> 14.0
pull_requests: +25180
pull_request: https://github.com/python/cpython/pull/26596

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There are many buildbot failures today and this is getting a bit out of hand so 
I'm starting with a revert of f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 until we 
have a better plan.

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Eric, I saw thay you ran the buildbots on your PR (thanks a lot), but something 
has gone wrong in some of them and they didn't run correctly. For example:

https://buildbot.python.org/all/#/builders/581/builds/58

I'm investigating why that this. Meanwhile, could you take a look? We have 
already some problems on windows and we don't want more stuff to pile up.

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Here is the top trace:

test_jump_in_nested_finally_3 (test.test_sys_settrace.JumpTestCase) ... ok
test_jump_into_finally_block (test.test_sys_settrace.JumpTestCase) ... ok
test_jump_into_finally_block_from_try_block 
(test.test_sys_settrace.JumpTestCase) ... ok
=
==28726==ERROR: AddressSanitizer: heap-buffer-overflow on address 
0x604db2c8 at pc 0x55fb8bd662d1 bp 0x7ffef9e25cf0 sp 0x7ffef9e25ce0
READ of size 4 at 0x604db2c8 thread T0
#0 0x55fb8bd662d0 in PyFrame_FastToLocalsWithError Objects/frameobject.c:985
#1 0x55fb8bbad5a3 in call_trampoline Python/sysmodule.c:953
#2 0x55fb8bbb0eb5 in trace_trampoline Python/sysmodule.c:1008
#3 0x55fb8bac9a03 in call_trace Python/ceval.c:5618
#4 0x55fb8bacd3c6 in call_trace_protected Python/ceval.c:5576
#5 0x55fb8bad8a57 in _PyEval_EvalFrameDefault Python/ceval.c:1631
#6 0x55fb8bafc2ff in

--

___
Python tracker 

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



  1   2   >