[issue12445] dict view values objects are missing tp_richcmp and tp_as_number

2022-04-05 Thread Peter Lovett


Change by Peter Lovett :


--
nosy: +PeterL777

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-04-05 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +30388
pull_request: https://github.com/python/cpython/pull/32329

___
Python tracker 

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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
status: open -> pending

___
Python tracker 

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



[issue47139] pthread_sigmask needs SIG_BLOCK behaviour explaination

2022-04-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The irony... Documenting the caveat at least seems useful. Your workaround 
sounds reasonable.

I don't love the idea of implementing our own mask blocked/unblocked state 
check, though it probably wouldn't be very complicated. Might be interesting.

Another trick that'd "work" so long as people don't have multiple SIG_BLOCK 
calls (not something to depend on) is to force a check of our interpreter 
signal flags right before signal.pthread_sigmask returns to the Python caller.

--
nosy: +gregory.p.smith
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.11

___
Python tracker 

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



[issue47153] __doc__ should generally be writable

2022-04-05 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue47203] ImportError: DLL load failed while importing binascii: %1 is not a valid Win32 application.

2022-04-05 Thread Eryk Sun


Eryk Sun  added the comment:

There is something fundamentally wrong with the way modules built into the 
interpreter DLL (python3x.dll) are loaded if anything in sys.path or the system 
PATH can cause an import to fail.

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-04-05 Thread Julien Palard


Julien Palard  added the comment:


New changeset d0e696e05d4aaca1f1cde72a5c3326ca3d0f5c24 by Julien Palard in 
branch 'main':
bpo-42238: [doc]: A make sucpicious false positive. (GH-32329)
https://github.com/python/cpython/commit/d0e696e05d4aaca1f1cde72a5c3326ca3d0f5c24


--

___
Python tracker 

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



[issue47207] Switch datetime docstrings / documentation to using "Returns" rather than "Return"?

2022-04-05 Thread Stanley


Stanley  added the comment:

Is there a bpo page or some sort that discusses why the imperative mood is used 
over the indicative mood other than convention of PEP 257? I found this 
(https://mail.python.org/pipermail/tutor/2012-May/089584.html) question and 
answer that seems to make sense, but it's not quite an official source.

If the reason for using imperative mood in docstrings doesn't apply to 
documentation, then I think there wouldn't be any problems in changing it. One 
thing raised in the mail thread was that 'Returns ...' isn't strictly 
grammatical, so perhaps that's something to consider.

--

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-04-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue47211 for removing re.TEMPLATE.

--

___
Python tracker 

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



[issue28951] re.flags not documented in Module Contents as promised.

2022-04-05 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue21956] Doc files deleted from repo are not deleted from docs.python.org.

2022-04-05 Thread Julien Palard


Julien Palard  added the comment:

This is resolved since https://github.com/python/docsbuild-scripts/pull/28.

It could still happen in very specific conditions, but not for a long time, see:

https://github.com/python/docs-community/issues/41#issuecomment-1088462199=

--
nosy: +mdk
resolution:  -> fixed
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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 96e09837fb8031aebe8d823dd19ef664a34bcfad by Christian Heimes in 
branch 'main':
bpo-40280: Add limited Emscripten REPL (GH-32284)
https://github.com/python/cpython/commit/96e09837fb8031aebe8d823dd19ef664a34bcfad


--

___
Python tracker 

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



[issue44158] Clarify documentation for redirected stdout/stderr when using subprocess in Linux

2022-04-05 Thread Stanley


Stanley  added the comment:

Hmm, I'm not quite following - when you say that the subproccess-ed command 
should also inherit the redirection, which subprocess command are you referring 
to, and nested or unnested? I gave it a ran and everything seems to run how I'd 
expected it, so maybe put another way, what's the expected output from the 
files and stdout/stderr?

--
nosy: +slateny

___
Python tracker 

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



[issue46168] Incorrect format specified for the "style" key in the configuration file format formatter example

2022-04-05 Thread Stanley


Stanley  added the comment:

Samriddhi, are you still working on this?

--
nosy: +slateny

___
Python tracker 

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



[issue47009] Streamline list.append for the common case

2022-04-05 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 6c6e0408a663c1f53dad403f54a18d444da39cb7 by Dennis Sweeney in 
branch 'main':
bpo-47009: Let PRECALL_NO_KW_LIST_APPEND do its own POP_TOP (GH-32239)
https://github.com/python/cpython/commit/6c6e0408a663c1f53dad403f54a18d444da39cb7


--

___
Python tracker 

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



[issue36207] robotsparser deny all with some rules

2022-04-05 Thread adiboo adib


adiboo adib  added the comment:

I can't find a documentation about it, but all of the robots.txt checkers I 
find behave like this. You can test on this site: 
https://www.st-info.fr/robots.txt, I believe that this is how it's implemented 
now in most parsers ?

--
nosy: +adiboo67

___
Python tracker 

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



[issue47210] './configure --help' causes infinite loop

2022-04-05 Thread ripspin


ripspin  added the comment:

Bug closed because I get the same loop with python-3.10.4

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



[issue47136] The variable __module__ in the class body getting an undesirable value from __prepare__ of the metaclass

2022-04-05 Thread Takuo Matsuoka


Takuo Matsuoka  added the comment:

Thank you Ethan for reopening this issue and closing the other one.

Here is a description of a more specific issue, containing a more
reasonable example.  I've changed the title of the issue to a more
appropriate one accordingly.

Context
---
Some classes have the variable __name__ in their namespace __dict__ ,
and one may wish to create more such classes with varied values of
__name__ .  Some of those could be created with a metaclass whose
__prepare__ returns a mapping having key "__name__", for which the
value is created depending on the arguments of __prepare__ and can be
updated or deleted in the body of the class to be created.  (See C
below for a very silly example of such a metaclass.)


Problem
---
The value of __name__ given by __prepare__ becomes not just that in
the class body, but automatically also the value of __module__
there.  As far as I could see, this is not documented, and the
programmer might not notice __module__ was messed up.  I think this
behaviour is unexpected and problematic at least unless a warning is
given on it in the document.

Also, the problem means we can't safely enjoy the ability of
__prepare__ of a metaclass to give a candidate for the value of
__name__ in __dict__ of the class without the trouble of fixing the
variable __module__ later at the top of the class body for every
instance of the metaclass (very annoying) somehow (or in __new__ or
__init__ of the metaclass if __module__ is not to be read in the class
body).


Example
---
Here's a code which produces a problem.

```
# In this example, the metaclass C is intended to be a class of
# subclasses of:
B = type

class C(type(B)):
@classmethod
def __prepare__(cls, /, *args, **kwargs):
return dict(__name__ = cls._name(*args, **kwargs))
@classmethod
def _name(cls, /, *args, **kwargs):
# The actual value of __name__ doesn't matter much to the
# issue, so I make this function always return the same silly
# thing in this example.
return type.__dict__["__name__"]

class O(B, metaclass=C):
print(__module__ == __name__) # True
# Could update or delete __name__ here.
```

Consequently,

>>> O.__module__



Thanks.

P.S.
The argument mentioning "the scope outside" in my earlier post here
didn't make sense without specifying which scope.  I still hope the
problem can be fixed.

--
title: Wrong value assigned automatically to the variable __module__ in the 
class body. -> The variable __module__ in the class body getting an undesirable 
value from __prepare__ of the metaclass

___
Python tracker 

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



[issue47186] split JUMP_IF_NOT_EXC/EG_MATCH into CHECK_EXC/EG_MATCH + jump

2022-04-05 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 32091df41ce6e3a71df2cf37dc74b728c0d885f2 by Irit Katriel in 
branch 'main':
bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)
https://github.com/python/cpython/commit/32091df41ce6e3a71df2cf37dc74b728c0d885f2


--

___
Python tracker 

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



[issue47186] split JUMP_IF_NOT_EXC/EG_MATCH into CHECK_EXC/EG_MATCH + jump

2022-04-05 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-04-05 Thread Alex Waygood


Alex Waygood  added the comment:

(My solution for now has been to install python on my other laptop. Thanks for 
the help Steve!)

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



[issue47120] Make all jump opcodes relative

2022-04-05 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 0aa8d5cbd89cf3b61d7e8626f3a7b9c4881dfd70 by Irit Katriel in 
branch 'main':
bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)
https://github.com/python/cpython/commit/0aa8d5cbd89cf3b61d7e8626f3a7b9c4881dfd70


--

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-04-05 Thread Géry

Géry  added the comment:

> Anthony Sottile provided this search to showing that at least a few popular 
> projects are using the one argument form of super():

Thanks for the link. But it gives lots of false positives. Only two popular 
projects (> 1k stars) use autosuper (urwid and evennia):

https://sourcegraph.com/search?q=context:global+setattr%5C%28.*super%5C%28.*%5C%29%5C%29+file:%5C.py%24+-file:test.*%5C.py%24&patternType=regexp&case=yes

The remaining projects use one-argument super incorrectly, as 
`super(cls).method()`, which looks up the method directly on class `super`:

https://sourcegraph.com/search?q=context:global+content:%5B%5E_%5Dsuper%5C%28%5Cw%2B%5C%29%5B%5E:%5D+file:%5C.py%24+-file:test.*%5C.py%24&patternType=regexp&case=yes

It is either a loud bug, which raises an `AttributeError`:

```
>>> class A:
... def f(self): pass
... 
>>> class B(A):
... def f(self): super(B).f()
... 
>>> B().f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
AttributeError: 'super' object has no attribute 'f'
```

Or worse with `super(cls).__init__()` (99% of the cases), it is a SILENT bug, 
which call the constructor of class `super` instead of the parent constructor, 
leaving the object in an incompletely initialized state:

```
>>> class A:
... def __init__(self): print('hello')
... 
>>> class B(A):
... def __init__(self): super(B).__init__()
... 
>>> A()
hello
<__main__.A object at 0x10926e460>
>>> B()
<__main__.B object at 0x10926e520>
```

--

___
Python tracker 

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



[issue47009] Streamline list.append for the common case

2022-04-05 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 3.0 -> 4.0
pull_requests: +30389
pull_request: https://github.com/python/cpython/pull/32332

___
Python tracker 

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



[issue47227] Suppress expression chaining for RE parsing errors

2022-04-05 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The EAFP principle is widely used in the regular expressions parsing code. 
Exceptions like KeyError, IndexError, ValueError or OverflowError raised during 
parsing are converted into a helpful re.error. Expression chaining is usually 
suppressed in such cases to hide unrelated implementation details, but not in 
all cases. The following PR adds more "from None" in "raise" statements inside 
"except" blocks.

--
components: Library (Lib), Regular Expressions
messages: 416774
nosy: ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Suppress expression chaining for RE parsing errors
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



[issue47227] Suppress expression chaining for RE parsing errors

2022-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45774] Detect SQLite in configure.ac

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f1606a5ba50bdc4e7d335d62297b4b4043a25e6e by Erlend Egeberg 
Aasland in branch 'main':
bpo-45774: Harden SQLite detection (GH-30016)
https://github.com/python/cpython/commit/f1606a5ba50bdc4e7d335d62297b4b4043a25e6e


--

___
Python tracker 

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



[issue41395] pickle and pickletools cli interface doesn't close input and output file.

2022-04-05 Thread Adam


Adam  added the comment:

Hi,

First-time contributor here, I've made a patch in follow-up to the discussions 
that happened in Amir's patch in regards to this. I'd appreciate it if someone 
would be able to take a look and review it! 

https://github.com/python/cpython/pull/32257

--

___
Python tracker 

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



[issue47212] Minor issues in reported Syntax errors

2022-04-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset aa0f056a00c4bcaef83d729e042359ddae903382 by Matthieu Dartiailh in 
branch 'main':
bpo-47212: Improve error messages for un-parenthesized generator expressions 
(GH-32302)
https://github.com/python/cpython/commit/aa0f056a00c4bcaef83d729e042359ddae903382


--

___
Python tracker 

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



[issue45774] Detect SQLite in configure.ac

2022-04-05 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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
assignee:  -> terry.reedy
components: +IDLE
nosy: +terry.reedy
status: pending -> open
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



[issue47228] Document that naïve datetime objects represent local time

2022-04-05 Thread Paul Ganssle

New submission from Paul Ganssle :

Currently, the `datetime` documentation has this to say about naïve datetimes:

> A naive object does not contain enough information to unambiguously locate 
> itself relative to other date/time objects. Whether a naive object represents 
> Coordinated Universal Time (UTC), local time, or time in some other timezone 
> is purely up to the program, just like it is up to the program whether a 
> particular number represents metres, miles, or mass. Naive objects are easy 
> to understand and to work with, at the cost of ignoring some aspects of 
> reality.

This was accurate in Python 2.7, but as of Python 3, the picture is a bit more 
nuanced. `.astimezone()` and `.timestamp()` work for naïve datetimes, but they 
are treated as *system local times*. It is no longer really appropriate to use 
a naïve datetime to a datetime in any specific concrete time zone — instead, 
they should be considered either abstract datetimes for the purposes of 
calendar calculations, or they should be considered as representing the 
realization of that abstract datetime *in the current system locale*. This new 
behavior is referenced in, for example, the warning in `.utcnow()`: 
https://docs.python.org/3.10/library/datetime.html#datetime.datetime.utcnow

We make reference to this in the documentation for `.timestamp()`: 
https://docs.python.org/3.10/library/datetime.html#datetime.datetime.timestamp 
and in `.astimezone()`: 
https://docs.python.org/3.10/library/datetime.html#datetime.datetime.astimezone,
 but the top level explanation makes no reference to it.

I have written a blog post about *why* this is the case: 
https://blog.ganssle.io/articles/2022/04/naive-local-datetimes.html and made 
reference to this behavior in an earlier blog post about `utcnow`: 
https://blog.ganssle.io/articles/2019/11/utcnow.html, but I think it would be a 
good idea to revamp the official documentation to reflect this change in status 
(12 years or so after the change…)

--
assignee: p-ganssle
components: Documentation
messages: 416778
nosy: belopolsky, p-ganssle
priority: normal
severity: normal
stage: needs patch
status: open
title: Document that naïve datetime objects represent local time
type: enhancement
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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error called unexpected indent

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
title: if we write a line of code like i wrote keys = pygame.key.get_pressed() 
is showing error -> if we write a line of code like i wrote keys = 
pygame.key.get_pressed() is showing error called unexpected indent

___
Python tracker 

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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error called unexpected indent

2022-04-05 Thread Kaushal Sai v


Kaushal Sai v  added the comment:

the error mesessage is tha unexpected incident

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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error called unexpected indent

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
status: open -> pending

___
Python tracker 

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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2022-04-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset a7551247e7cb7010fb4735281f1afa4abeb8a9cc by Erlend Egeberg 
Aasland in branch 'main':
bpo-41930: Add support for SQLite serialise/deserialise API (GH-26728)
https://github.com/python/cpython/commit/a7551247e7cb7010fb4735281f1afa4abeb8a9cc


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2022-04-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks, this will be in Python 3.11.

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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error called unexpected indent

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
status: pending -> open
Added file: https://bugs.python.org/file50719/python problem.PNG

___
Python tracker 

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



[issue47088] Implement PEP 675 (LiteralString)

2022-04-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset cfb849a326e52a4edc577112ebf60e1d9d0d7fdb by Jelle Zijlstra in 
branch 'main':
bpo-47088: Add typing.LiteralString (PEP 675) (GH-32064)
https://github.com/python/cpython/commit/cfb849a326e52a4edc577112ebf60e1d9d0d7fdb


--

___
Python tracker 

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



[issue47088] Implement PEP 675 (LiteralString)

2022-04-05 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error called unexpected indent

2022-04-05 Thread Kaushal Sai v


Change by Kaushal Sai v :


--
components: +IDLE

___
Python tracker 

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



[issue47226] Unexpected indent message

2022-04-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

" keys = pygame.key.get_pressed() is showing error called unexpected indent"

The problem is that the keys line in indented one less space than the line 
above.  A shorter example below.

if True:
a = 1
   b = 2

SyntaxError: unindent does not match any outer indentation level


This issue tracker is not a help forum.  Next time, please post instead to 
something like python-list.  Give a minimal snippet of code, like my example 
above, showing the problem and the complete error message. Also, copy and paste 
the error message instead of an image.

Please read https://stackoverflow.com/help/minimal-reproducible-example
about how to ask good questions.

This is in no way an IDLE issue.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: if we write a line of code like i wrote keys = pygame.key.get_pressed() 
is showing error called unexpected indent -> Unexpected indent message

___
Python tracker 

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



[issue47226] Unexpected indent message

2022-04-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -paul.moore, steve.dower, terry.reedy, 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



[issue47203] ImportError: DLL load failed while importing binascii: %1 is not a valid Win32 application.

2022-04-05 Thread Steve Dower


Steve Dower  added the comment:

> There is something fundamentally wrong with the way modules built into the 
> interpreter DLL (python3x.dll) are loaded if anything in sys.path or the 
> system PATH can cause an import to fail.

Probably there was also shadowing involved, since the built-in module doesn't 
try to load anything else. Would be nice to know for sure (@Matthew) to make 
sure we don't have some other issue here, but you're right, I don't see any way 
for this to happen without other causes.

--

___
Python tracker 

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



[issue47212] Minor issues in reported Syntax errors

2022-04-05 Thread Matthieu Dartiailh


Change by Matthieu Dartiailh :


--
pull_requests: +30391
pull_request: https://github.com/python/cpython/pull/32334

___
Python tracker 

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



[issue42012] typing support in wsgiref

2022-04-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue46607] Add DeprecationWarning to configparser's LegacyInterpolation

2022-04-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 75280944e5ca957eec7f814b9d0608fc84fc5811 by Hugo van Kemenade in 
branch 'main':
bpo-46607: Add DeprecationWarning for LegacyInterpolation, deprecated in docs 
since 3.2 (GH-30927)
https://github.com/python/cpython/commit/75280944e5ca957eec7f814b9d0608fc84fc5811


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



[issue42012] typing support in wsgiref

2022-04-05 Thread Sebastian Rittau


Change by Sebastian Rittau :


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

___
Python tracker 

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



[issue47009] Streamline list.append for the common case

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 9e88b572fb904b172f9e344069fb7118f1cee517 by Christian Heimes in 
branch 'main':
bpo-47009: Fix assert on big endian (GH-32332)
https://github.com/python/cpython/commit/9e88b572fb904b172f9e344069fb7118f1cee517


--

___
Python tracker 

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



[issue47212] Minor issues in reported Syntax errors

2022-04-05 Thread miss-islington


miss-islington  added the comment:


New changeset 94609e3192f15636c760a48c4c1c2c236fac3217 by Matthieu Dartiailh in 
branch '3.10':
[3.10] Backport bpo-47212 (GH-32302) to Python 3.10 (GH-32334)
https://github.com/python/cpython/commit/94609e3192f15636c760a48c4c1c2c236fac3217


--
nosy: +miss-islington

___
Python tracker 

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



[issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter

2022-04-05 Thread Yann Droneaud


Yann Droneaud  added the comment:

I looked at posixmodule: os.chdir() accepts a file descriptor.
Maybe it can be possible to invoke it from _posixsubprocess.c instead of 
calling chdir().

--

___
Python tracker 

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



[issue47212] Minor issues in reported Syntax errors

2022-04-05 Thread Alex Waygood


Change by Alex Waygood :


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



[issue17004] Expand zipimport to include other compression methods

2022-04-05 Thread Christian Heimes


Change by Christian Heimes :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue47136] The variable __module__ in the class body getting an undesirable value from __prepare__ of the metaclass

2022-04-05 Thread Ethan Furman


Ethan Furman  added the comment:

You are using the same generic example -- it does show the issue you are 
concerned with, but offers no rational for why we should "fix" it -- in other 
words, we cannot tell if it's actually broken.

Please provide an example of code you are actually using -- a trimmed down 
metaclass is fine, but it should show the kinds of names you are changing to, 
why you want to change the names, etc.

Maybe this is a just a documentation issue, or maybe it's an overlooked case 
that should be supported in Python -- we cannot tell based solely on your 
generic example.

--

___
Python tracker 

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



[issue47229] IDLE / Thonny UI crashes on Chromebook Linux/Bullseye

2022-04-05 Thread Doug Bates


New submission from Doug Bates :

Having installed IDLE on Chromebbok/Linux Bullseye, on startup the UI crashes 
as soon as a menu item is selected.  Also when trying to use Thonny. Other 
packages seem OK.

Used to work fine under Buster, but not since fresh install to Bullseye.

Apologies from my knowledge/skill level.

--
assignee: terry.reedy
components: IDLE
files: Thonny crashes.txt
messages: 416790
nosy: Coloneldare, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE / Thonny UI crashes on Chromebook Linux/Bullseye
type: crash
Added file: https://bugs.python.org/file50720/Thonny crashes.txt

___
Python tracker 

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



[issue47131] Speedup test_unparse

2022-04-05 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Resolved with merged PR.

--
resolution:  -> fixed

___
Python tracker 

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



[issue47131] Speedup test_unparse

2022-04-05 Thread Jeremy Kloth


Change by Jeremy Kloth :


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



[issue45354] test_winconsoleio fails on Windows 11

2022-04-05 Thread Jeremy Kloth


Change by Jeremy Kloth :


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



[issue47230] New compiler warnings with latest zlib

2022-04-05 Thread Jeremy Kloth


New submission from Jeremy Kloth :

The latest zlib (1.2.12) introduces 3 new compiler warnings.  Now being an 
external library, I do not think we generally patch them, so I propose to 
simply silence the warnings for the offending file.

For reference, the problem comes from:

--- deflate.h.old   2022-04-05 11:27:26.869042900 -0600
+++ deflate.h.new   2022-04-05 11:26:11.512039600 -0600
@@ -329,8 +329,8 @@
 # define _tr_tally_dist(s, distance, length, flush) \
   { uch len = (uch)(length); \
 ush dist = (ush)(distance); \
-s->sym_buf[s->sym_next++] = dist; \
-s->sym_buf[s->sym_next++] = dist >> 8; \
+s->sym_buf[s->sym_next++] = (uch)dist; \
+s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
 s->sym_buf[s->sym_next++] = len; \
 dist--; \
 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \

--
components: Build, Windows
messages: 416792
nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: New compiler warnings with latest zlib
type: compile error
versions: Python 3.11

___
Python tracker 

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



[issue47230] New compiler warnings with latest zlib

2022-04-05 Thread Jeremy Kloth


Change by Jeremy Kloth :


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

___
Python tracker 

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



[issue47231] TarFile.getmember cannot work on tar sourced directory over 100 characters

2022-04-05 Thread Chris Fernald


New submission from Chris Fernald :

A fix was made to unify handling of the trailing slash in TarFile.getmember 
related to https://bugs.python.org/issue21987. This change fixed the <100 
character case, but made it so directories over 100 character which come from a 
tar file can no longer be accessed through getmember, even if returned from 
getnames. This appears to be because internal to tarfile, member names still 
include the trailing slash on directories over 100 characters but getmember 
will always remove the trailing slash from the provided name so the comparison 
will always fail.

A simple example of this is as follows using 3.10.4.

1. Download: 
https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz

2. place attached python script in same directory

3. run on 3.8.2 -> fails to get stripped version of path (line 16)

4. run on 3.10.4 -> fails to get even unstripped version (line 12 & 16)

--
components: Library (Lib)
files: tarfile_repro.py
messages: 416793
nosy: cfernald, serhiy.storchaka
priority: normal
severity: normal
status: open
title: TarFile.getmember cannot work on tar sourced directory over 100 
characters
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50721/tarfile_repro.py

___
Python tracker 

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



[issue47139] pthread_sigmask needs SIG_BLOCK behaviour explaination

2022-04-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The "trick" wouldn't be too useful though as this API can't block and the 
signal flag needs to be processed on the main thread. So I guess documentation 
it is.

The way I think of this is that the signal.pthread_sigmask API is pretty low 
level. After that API is called, no more signals will _reach the process_, but 
the interpreter may process some that happened beforehand. So installing a 
handler is indeed appropriate.

Also, it is entirely possible for C extension modules or code embedding Python 
to call pthread_sigmask in its own threads outside of the Python runtimes 
knowledge. So we us tracking what signals are blocked on our own may not be 
accurate.  We could instead change the eval loop signal processing code to call 
`pthread_sigmask(SIG_UNBLOCK, NULL /* set */, &oldset);` to retrieve the 
processes current mask to decide if the flagged signals should be processed by 
Python or not.

BUT... I can imagine complex race cases where that'd surprise people who are 
chaining multiple signal handlers such as one from outside of Python that saved 
the Python handler and calls it afterwards.  Their C/process-level handler 
would be called, would chain to Python's "record that signal X happened and set 
the bit" handler, but Python wouldn't then be guaranteed to call the Python 
handler code if the sigmask changed before the eval loop did its pending signal 
check.

So I'm still inclined to keep this simple and stick with just documenting best 
practices for now.  An implementation of masking from the python eval handler 
may need to be something conditionally controllable for differing application 
situations if added.

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch
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



[issue47006] PEP 646: Decide on substitution behavior

2022-04-05 Thread Matthew Rahtz


Matthew Rahtz  added the comment:

[Guido]

> 1. Some edge case seems to be that if *tuple[...] is involved on either side 
> we will never simplify.

Alright, let me think this through with some examples to get my head round it.

It would prohibit the following difficult case:

class C(Generic[*Ts]): ...
Alias = C[T, *Ts]
Alias[*tuple[int, ...]]  # Does not simplify; stays C[T, *Ts][*tuple[int, ...]]

That seems pretty reasonable. It would also prohibit these other relatively 
simple cases, but I guess that's fine:

Alias = C[*Ts]
Alias[*tuple[int, ...]]  # Does not simplify; stays C[*Ts][*tuple[int, ...]]

Alias = C[T, *tuple[int, ...]]
Alias[str]  # Does not simplify; stays C[T, *tuple[int, ...]][str]


> Or perhaps a better rule is that *tuple[...] is never simplified away (but 
> fixed items before and after it may be).

Is this to say that we effectively prohibit binding *tuple[...] to anything? If 
we can simplify without binding *tuple[...] to anything, then we do simplify, 
but otherwise, we don't simplify? So under this rule, the following WOULD work?

Alias = C[T, *tuple[int, ...]]
Alias[str]  # Simplifies to C[str, *tuple[int, ...]], because we didn't have to 
bind *tuple[int, ...] to do it


> 2. Another edge case is that if neither side has any starred items we will 
> always simplify (since this is the existing behavior in 3.10). This may raise 
> an error if the number of subscripts on the right does not match the number 
> of parameters on the left.

Alright, so this is business as usual.


> 3. If there's a single *Ts on the left but not on the right, we should be 
> able to simplify, which again may raise an error if there are not enough 
> values on the right, but if there are more than enough, the excess will be 
> consumed by *Ts (in fact that's the only way *Ts is fed).

So then:

class C(Generic[*Ts]): ...
Alias = C[T, *Ts]
Alias[()]  # Raises error
Alias[int] # Simplifies to C[int, *Ts]
Alias[int, str]# Simplifies to C[int, str]
Alias[int, str, bool]  # Simplifies to C[int, str, bool]

Yup, seems straightforward.


> 4. If there's a *Ts on the right but not on the left, we should _not_ 
> simplify, since whatever we have on the left serves as a constraint for *Ts.

Ok, so this is about the following situations:

class C(Generic[*Ts]): ...
Alias = C[T1, T2]
Alias[*Ts]  # Does not simplify; stays C[T1, T2][*Ts]

Yikes - in fact, this is actually super hairy; I hadn't thought about this edge 
case at all in the PEP.

Agreed that it seems reasonable not to simplify here.


> E.g. tuple[int, int][*Ts] constrains *Ts to being (int, int).

Was that a typo? Surely tuple[int, int][*Ts] isn't valid - since tuple[int, 
int] doesn't have any free parameters?


> 5. If there's exactly one *Ts on the left and one on the right, we _might__ 
> be able to simplify if the prefix and suffix of the __parameters__ match the 
> prefix and suffix of the subscript on the right. E.g. C[int, T, *Ts, 
> float][str, *Ts] can be simplified to C[int, str, *Ts, float]. OTOH C[int, T, 
> *Ts, float][*Ts] cannot be simplified -- but we cannot flag it as an error 
> either. Note that __parameters__ in this example is (T, Ts); we have to 
> assume that typevartuples in __parameters__ are always used as *Ts (since the 
> PEP recognizes no valid unstarred uses of Ts).

Ok, this also makes sense.


---

Still, though, doesn't the point that Serhiy brought up about __origin__, 
__parameters__ and __args__ still apply? In cases where we *don't* simplify, 
there'd still be the issue of what we'd set these things to be.

This evening I'll also revisit the PRs adding tests for substitution to try and 
make them a comprehensive reference as to what's currently possible.

--

___
Python tracker 

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



[issue47231] TarFile.getmember cannot work on tar sourced directory over 100 characters

2022-04-05 Thread Ethan Furman


Ethan Furman  added the comment:

Nosied others from issue21987.

--
nosy: +andrei.avk, ethan.furman, r.david.murray, vstinner

___
Python tracker 

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



[issue46576] test_peg_generator is extremely slow

2022-04-05 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth
nosy_count: 3.0 -> 4.0
pull_requests: +30394
pull_request: https://github.com/python/cpython/pull/32338

___
Python tracker 

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



[issue46576] test_peg_generator is extremely slow

2022-04-05 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

My PR-32338 further reduces the runtime of the test another ~25%.

On my machine, before 85s, after 65s.

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm not interested in having this move forward.  AFAICT it doesn't solve any 
known user problems (no one has cared about this before or since this issue was 
opened).  It slightly slows the code.  And it might break some existing code 
that wasn't previously a need to catch an OverflowError.

Marking this as closed.  If someone thinks this is really needed, feel free to 
reopen.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One other thought.  The mental model for degrees() is just a simple scaling 
operation.  If done in pure Python, we would get *inf* rather than an 
OverflowError.  I don't see any value in breaking with the obvious substitution:

>>> sys.float_info.max * (180 / pi)
inf

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue4833] Explicit directories for zipfiles

2022-04-05 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 050a8f94c678a05d506fe192c863c4a572178c42 by Sam Ezeh in branch 
'main':
bpo-4833: Add ZipFile.mkdir (GH-32160)
https://github.com/python/cpython/commit/050a8f94c678a05d506fe192c863c4a572178c42


--

___
Python tracker 

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



[issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter

2022-04-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

this mostly requires plumbing to accept an int as the cwd and plumb that 
through to the between fork and exec code to call `fchdir(cwd_fd)` on the `int` 
instead of chdir(cwd) on the `char*`.

the Modules/_posixsubprocess.c internals are a bit of a mess today with a 
bazillion parameters passed to internal functions which makes this a pain... I 
want to refactor things to use a struct and not need that, but adding this 
feature is doable regardless.

--
components: +Extension Modules -Library (Lib)

___
Python tracker 

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



[issue47230] New compiler warnings with latest zlib

2022-04-05 Thread Steve Dower


Steve Dower  added the comment:

Do we need to backport this?

--

___
Python tracker 

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



[issue47230] New compiler warnings with latest zlib

2022-04-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset 944f09adfcc59f54432ac2947cf95f3465d90e1e by Jeremy Kloth in 
branch 'main':
bpo-47230: Silence compiler warnings on Windows from zlib 1.2.12 (GH-32337)
https://github.com/python/cpython/commit/944f09adfcc59f54432ac2947cf95f3465d90e1e


--

___
Python tracker 

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



[issue47061] Deprecate modules listed in PEP 594

2022-04-05 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset c1d93b6411f975d67e43942f1a2745a22983c18c by Brett Cannon in 
branch 'main':
bpo-47061: deprecate the `aifc` module (GH-32134)
https://github.com/python/cpython/commit/c1d93b6411f975d67e43942f1a2745a22983c18c


--

___
Python tracker 

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



[issue47184] multiprocessing.set_start_method force argument is not documented

2022-04-05 Thread Sam Ezeh


Change by Sam Ezeh :


--
keywords: +patch
nosy: +sam_ezeh
nosy_count: 2.0 -> 3.0
pull_requests: +30395
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32339

___
Python tracker 

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



[issue47184] multiprocessing.set_start_method force argument is not documented

2022-04-05 Thread Sam Ezeh


Sam Ezeh  added the comment:

It's quite weird, the documentation says set_start_method "should not be used 
more than once in the program" twice.

The source code also contains the following line

```
# Type of default context -- underlying context can be set at most once
```

I'm not too familiar with the multiprocessing library but with the force 
parameter set to True, I don't understand why that can't happen. If there's a 
specific reason, maybe that should be documented too.

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

FWIW, I do consider this a bug, albeit a minor one. I may find time to fix it 
at some point (but it's fine to leave it closed until that time comes).

--

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


New submission from Hood Chatham :

I am trying to build tot Python for Emscripten to test recent changes and 
having trouble. The problem is caused by recent changes since 3.11.0a6 to 
`sre`. I build a build Python 3.11 from tot, and provided it to `./configure 
--with-build-python=$(HOSTBUILDDIR)/python`. However, I still see invocations 
to the system Python 3.11 at `/usr/local/bin/python3.11`.

The problem seems to be that the generated `Makefile` has a bunch of stuff 
collapsed into one line:
```
PYTHON_FOR_BUILD=_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
/src/cpython/build/Python-3.11.0dev0/builddir/build-host/python
```
manually fixing this to:
```
PYTHON_FOR_BUILD=/src/cpython/build/Python-3.11.0dev0/builddir/build-host/python
_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) 
PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat 
pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH)
```
fixes the problem.

My configure invocation is as follows:
```
( \
cd $(BUILDDIR); \
CONFIG_SITE=./config.site-wasm32-emscripten emconfigure \
  ../../configure \
  --cache-file=$(ROOT)/python.config.cache \
  CFLAGS="${PYTHON_CFLAGS}" \
  CPPFLAGS="-I$(SQLITEBUILD) -I$(BZIP2BUILD) 
-I$(ZLIBBUILD)" \
  PLATFORM_TRIPLET="$(PLATFORM_TRIPLET)" \
  --with-build-python=$(HOSTBUILDDIR)/python \
  --without-pymalloc \
  --disable-shared \
  --disable-ipv6 \
  --enable-big-digits=30 \
  --enable-optimizations \
  --host=wasm32-unknown-emscripten\
  --build=$(shell $(EXTRACTDIR)/config.guess) \
  --prefix=$(INSTALL)  \
)
```

--
messages: 416807
nosy: christian.heimes, hoodchatham
priority: normal
severity: normal
status: open
title: Difficulties building tip of tree Python for emscripten

___
Python tracker 

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



[issue47139] pthread_sigmask needs SIG_BLOCK behaviour explaination

2022-04-05 Thread Richard Purdie


Richard Purdie  added the comment:

I think the python code implementing pthread_sigmask already does trigger 
interrupts if any have been queued before the function returns from blocking or 
unblocking.

The key subtlety which I initially missed is that if you have another thread in 
your python script, any interrupt it receives can be raised in the main thread 
whilst you're in the SIGBLOCK section. This obviously isn't what you expect at 
all as those interrupts are supposed to be blocked! It isn't really practical 
to try and SIGBLOCK on all your individual threads.

What I'd wondered is what you mention, specifically checking if a signal is 
masked in the python signal raising code with something like the 
"pthread_sigmask(SIG_UNBLOCK, NULL /* set */, &oldset)" before it raises it and 
if there is blocked, just leave it queued. The current code would trigger the 
interrupts when it was unmasked. This would effectively only apply on the main 
thread where all the signals/interrupts are raised. 

This would certainly give the behaviour that would be expected from the calls 
and save everyone implementing the workarounds as I have. Due to the threads 
issue, I'm not sure SIGBLOCK is actually useful in the real world with the 
current implementation unfortunately.

Equally, if that isn't an acceptable fix, documenting it would definitely be 
good too.

--

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread pmp-p


Change by pmp-p :


--
nosy: +pmpp

___
Python tracker 

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



[issue47230] New compiler warnings with latest zlib

2022-04-05 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

It seems so, as the zlib update was also backported to 3.9 and 3.10.

--

___
Python tracker 

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



[issue47233] show_caches option affects code positions reported by dis.get_instructions(...)

2022-04-05 Thread 15r10nk


New submission from 15r10nk <15r10nk-python-iss...@polarbit.de>:

The Instructions reported by dis.get_instructions(...) and dis.Bytecode(...) 
have different positions depending on the value of their show_caches argument.

test2.py reproduces the problem.

--
files: test2.py
messages: 416810
nosy: 15r10nk
priority: normal
severity: normal
status: open
title: show_caches option affects code positions reported by 
dis.get_instructions(...)
type: behavior
versions: Python 3.11
Added file: https://bugs.python.org/file50722/test2.py

___
Python tracker 

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



[issue47203] ImportError: DLL load failed while importing binascii: %1 is not a valid Win32 application.

2022-04-05 Thread Matthew


Matthew  added the comment:

> Probably there was also shadowing involved, since the built-in module doesn't 
> try to load anything else. Would be nice to know for sure (@Matthew) to make 
> sure we don't have some other issue here, but you're right, I don't see any 
> way for this to happen without other causes.

I'm pretty sure the Python interpreter that was causing the issue was bundled 
with the MSYS2 Mingw64 compiler. I tried reproducing the bug, but I've recently 
reinstalled the compiler due to some issues I was having with it, and the bug 
with importing binascii is no longer present.

--

___
Python tracker 

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



[issue47006] PEP 646: Decide on substitution behavior

2022-04-05 Thread Matthew Rahtz


Change by Matthew Rahtz :


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

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

Okay I found the problem. Elsewhere in my Makefiles `PYTHON_FOR_BUILD` was 
getting overwritten.

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



[issue47006] PEP 646: Decide on substitution behavior

2022-04-05 Thread Matthew Rahtz


Matthew Rahtz  added the comment:

Ok, https://github.com/python/cpython/pull/32341/files is a reference of how 
the current implementation behaves. Fwiw, it *is* mostly correct - with a few 
minor tweaks it might be alright for at least the 3.11 release.

In particular, instead of dealing with the thorny issue of what to do about 
splitting unpacked arbitrary-length tuples over multiple type variables - e.g. 
C[T, *Ts][*tuple[int, ...]] - instead either deciding to try and evaluate it 
properly and living with the complexity, or leaving it unsimplified and living 
with the __args__, __parameters__ and __origin__ problem - for now, we could 
just raise an exception for any substitutions which involve an unpacked 
arbitrary-length tuple, since I'd guess it's going to be an extremely rare 
use-case.

--

___
Python tracker 

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



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-05 Thread Thomas Fischbacher

New submission from Thomas Fischbacher :

Here is a major general problem with python-static-typing as it is
described by PEP-484: The approach described in
https://peps.python.org/pep-0484/#the-numeric-tower negatively impacts
our ability to reason about the behavior of code with stringency.

I would like to clarify one thing in advance: this is a real problem
if we subscribe to some of the important ideas that Dijkstra
articulated in his classic article "On the role of scientific thought"
(e.g.: https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD447.html).
Specifically, this part:

"""
Let me try to explain to you, what to my taste is characteristic
for all intelligent thinking. It is, that one is willing to study in
depth an aspect of one's subject matter in isolation for the sake of
its own consistency, all the time knowing that one is occupying
oneself only with one of the aspects. We know that a program must be
correct and we can study it from that viewpoint only; we also know
that it should be efficient and we can study its efficiency on another
day, so to speak. In another mood we may ask ourselves whether, and if
so: why, the program is desirable. But nothing is gained —on the
contrary!— by tackling these various aspects simultaneously. It is
what I sometimes have called "the separation of concerns", which, even
if not perfectly possible, is yet the only available technique for
effective ordering of one's thoughts, that I know of. This is what I
mean by "focussing one's attention upon some aspect": it does not mean
ignoring the other aspects, it is just doing justice to the fact that
from this aspect's point of view, the other is irrelevant. It is being
one- and multiple-track minded simultaneously.
"""

So, "code should be easy to reason about".

Now, let us look at this function - I am here (mostly) following the
Google Python style guide (https://google.github.io/styleguide/pyguide.html) 
for now:

=== Example 1, original form ===

def middle_mean(xs):
  """Compute the average of the nonterminal elements of `xs`.

  Args:
`xs`: a list of floating point numbers.

  Returns:
A float, the mean of the elements in `xs[1:-1]`.

  Raises:
ValueError: If `len(xs) < 3`.
  """
  if len(xs) < 3:
raise ValueError('Need at least 3 elements to compute middle mean.')
  return sum(xs[1:-1]) / (len(xs) - 2)
==

Let's not discuss performance, or whether it makes sense to readily
generalize this to operate on other sequences than lists, but focus,
following Dijkstra, on one specific concern here: Guaranteed properties.

Given the function as it is above, I can make statements that are
found to be correct when reasoning with mathematical rigor, such as
this specific one that we will come back to:

=== Theorem 1 ===
  If we have an object X that satisfies these properties...:

  1. type(X) is list
  2. len(X) == 4
  3. all(type(x) is float for x in X)

  ...then we are guaranteed that `middle_mean(X)` evaluates to a value Y
  which satisfies:

  - type(Y) is float
  - Y == (X[1] + X[2]) * 0.5 or math.isnan(Y)
===

Now, following PEP-484, we would want to re-write our function, adding type 
annotations.
Doing this mechanically would give us:

=== Example 1, with mechanically added type information ===
def middle_mean(xs: List[float]) -> float:
  """Compute the average of the nonterminal elements of `xs`.

  Args:
`xs`: a list of floating point numbers.

  Returns:
A float, the mean of the elements in `xs[1:-1]`.

  Raises:
ValueError: If `len(xs) < 3`.
  """
  if len(xs) < 3:
raise ValueError('Need at least 3 elements to compute middle mean.')
  return sum(xs[1:-1]) / (len(xs) - 2)
==

(We are also deliberately not discussing another question here: given
this documentation and type annotation, should the callee be
considered to be permitted to mutate the input list?)


So, given the above form, we now find that there seems to be quite a
bit of redundancy here. After all, we have the type annotation but
also repeat some typing information in the docstring. Hence, the
obvious proposal here is to re-write the above definition again, obtaining:

=== Example 1, "cleaned up" ===
def middle_mean(xs: List[float]) -> float:
  """Compute the average of the nonterminal elements of `xs`.

  Args:
`xs`: numbers to average, with terminals ignored.

  Returns:
The mean of the elements in `xs[1:-1]`.

  Raises:
ValueError: If `len(xs) < 3`.
  """
  if len(xs) < 3:
raise ValueError('Need at least 3 elements to compute middle mean.')
  return sum(xs[1:-1]) / (len(xs) - 2)
==

But now, what does this change mean for the contract? Part of the "If
arguments have these properties, then these are the guarantees"
contract now is no longer spelled out by the docstring, but via type
annotations. We naturally would expect this to be straightforward,
so, we would like to have:

=== Theorem 1b ===
  If we have an object X that satisfies these properties...:

  1. Static typ

[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

I take it back, I am still having this problem.

--
status: closed -> open

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:

Please attach config.log and Makefile from the builddir.

--

___
Python tracker 

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



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for your report, but I would appreciate a more concise explanation. Let 
me try to rephrase the problem.

Given this function:

def mean(x: list[float]) -> float:
return sum(x) / len(x)

We want to provide a guarantee that if x is a nonempty list containing only 
floats, the function returns successfully and returns a float.

But the type system currently doesn't give this guarantee, because PEP 484 
specifies that ints are compatible with floats, and `mean([0.0, 1.25, 10**1000, 
0.0])` will throw OverflowError.

---

We generally discuss issues with the general type system over at 
https://github.com/python/typing/issues, but here are a few thoughts:

- The type system doesn't generally try to cover exceptions. Your function 
could also raise MemoryError, or KeyboardInterrupt, and the type system can't 
tell you.
- The concrete proposal here would be to make int no longer implicitly 
compatible with float. That might be nice, but at this point it would be a big 
break in backwards compatibility, so I'm not sure we can do it.

--
nosy: +AlexWaygood, JelleZijlstra, gvanrossum, kj

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-04-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30397
pull_request: https://github.com/python/cpython/pull/32343

___
Python tracker 

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



[issue47222] subprocess.Popen() should allow capturing output and sending it to stdout and stderr

2022-04-05 Thread Philip Prindeville


Change by Philip Prindeville :


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

___
Python tracker 

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



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This is a partial duplicate of an issue you already filed: 
https://bugs.python.org/issue47121 where math.isfinite(10**1000) raises an 
OverflowError even though it type checks.

Here was one of the comments:
"""
Types relationships are useful for verifying which methods are available, but 
they don't make promises about the range of valid values.  For example 
math.sqrt(float) -> float promises which types are acceptable but doesn't 
promise that negative inputs won't raise an exception.  Likewise, "n: int=10; 
len(range(n))" is type correct but will raise an OverflowError for "n = 
10**100".
"""

--
nosy: +rhettinger

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

config.log is apparently 1.7 MB and when I try to upload I get "Error 413: 
Entity Too Large". I've attached the Makefile.

--
Added file: https://bugs.python.org/file50723/Makefile

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

There is still a pretty good change I am making some dumb mistake.

--

___
Python tracker 

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



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:

You are building a cross-build with 
"--with-build-python=/usr/local/bin/python3.11". Is the interpreter up to date?

During alpha and beta phase, the build Python interpreter should be built from 
the exact same git commit as the sources in "../..". If the interpreter 
deviates from the sources in your srcdir, then Python byte code (.pyc), frozen 
byte code, and re engine can have mismatching magic.

I recommend that you build inside an environment that does not have Python 3.11 
installed. Instead build a build Python interpreter from the same checkout that 
you later use for cross-compilation. "./configure && make" is sufficient. You 
don't have to install the build interpreter. 
"--with-build-python=$(pwd)/../build/python" works fine.

We use this approach in python-wasm:

mkdir -p cpython/builddir/build
pushd cpython/builddir/build
../../configure -C
make -j$(nproc)
popd

mkdir -p cpython/builddir/emscripten-browser
pushd cpython/builddir/emscripten-browser
CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \
  emconfigure ../../configure -C \
--host=wasm32-unknown-emscripten \
--build=$(../../config.guess) \
--with-build-python=$(pwd)/../build/python
emmake make -j$(nproc)


It's going to get easier and less painful as soon as we reach beta phase. 
During beta the byte code will only change when it is required for a bug fix.

--

___
Python tracker 

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



[issue47231] TarFile.getmember cannot work on tar sourced directory over 100 characters

2022-04-05 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue46607] Add DeprecationWarning to configparser's LegacyInterpolation

2022-04-05 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Hugo for the your contribution. I close the issue.

> Searching the top 5,000 PyPI sdists, there's very little (if any "real") use 
> of LegacyInterpolation. Details: https://bugs.python.org/issue45173#msg409685

You can offer them a PR to avoid the deprecated API, or at least notify them by 
creating an issue that this API is deprecated in Python 3.11.

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-04-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

At this point I think it's worth filing a new bug proposing to deprecate 1-arg 
super(), pointing out the broken usages that search found.

--

___
Python tracker 

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



  1   2   >