[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Vedran Čačić

Vedran Čačić  added the comment:

> choose one for the default so that default encoding/decoding will work cross 
> platform.  I think "little" is the most common (intel and arm).

Raymond, please don't do this. We already have a "sensible default" in a 
network context, and it is big endian. Having another "sensible default" 
opposite to the previous one is really no way to ensure interoperability. 
(https://xkcd.com/927/ only becomes more ridiculous when the number in question 
is 2.:) I don't want to think about whether the way machines A and B exchange 
data can be called "a network" or not.

Of course, having the byteorder optional when there's only one (unsigned) byte 
is good.

--
nosy: +veky

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-09-09 Thread paul j3


paul j3  added the comment:

In

https://stackoverflow.com/questions/69108632/unable-to-catch-exception-error-for-argparse

we found that `exit_on_error` does not work when the error occurs in a 
subparser.

Unless someone wants to take time to get this right, I think this feature 
should be removed.  It's too buggy.

--

___
Python tracker 

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



[issue45159] data_received called on protocol after call to pause_reading on ssl transport

2021-09-09 Thread Christopher Brichford


New submission from Christopher Brichford :

An SSL connection created with loop.create_connection may have data_received 
called on its protocol after pause_reading has been called on the transport.

If an application has a protocol whose data_received method calls pause_reading 
on the transport then there is a chance that the data_received method will be 
called again before the application calls resume_reading on the transport.

That existing implementation of pause_reading at:
https://github.com/python/cpython/blob/62fa613f6a6e872723505ee9d56242c31a654a9d/Lib/asyncio/sslproto.py#L335

calls pause_reading on the underlying socket transport, which is correct.  
However, there is a loop in the SSLProtocol's data_received method:
https://github.com/python/cpython/blob/62fa613f6a6e872723505ee9d56242c31a654a9d/Lib/asyncio/sslproto.py#L335

If the loop referenced above has more than one iteration then there is a chance 
that the application protocol's data_received method could call pause_reading 
on the transport.  If that happens on any iteration of the loop other than the 
last iteration, then the SSLProtocol's data_received method will call the 
application protocol's data_received method when it should not.

Stealing uvloop's asyncio ssl implementation would resolve this bug: 
https://bugs.python.org/issue44011

--
components: asyncio
messages: 401553
nosy: asvetlov, chrisb2, yselivanov
priority: normal
severity: normal
status: open
title: data_received called on protocol after call to pause_reading on ssl 
transport
type: behavior
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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Serhiy is likely thinking of other the other cases.  Prior to this discussion, 
the principal use for to_bytes and from_bytes was for integers larger than a 
single byte.  If we're going to add a *byteorder* default, it needs to make 
sense for those cases as well.

--

___
Python tracker 

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



[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
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



[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) 
in branch '3.10':
bpo-45024 and bpo-23864: Document how interface testing works with the 
collections ABCs (GH-28218) (GH-28266)
https://github.com/python/cpython/commit/89edd18779e382c5fa7f57722b0b897a907ed2c4


--

___
Python tracker 

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



[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) 
in branch '3.10':
bpo-45024 and bpo-23864: Document how interface testing works with the 
collections ABCs (GH-28218) (GH-28266)
https://github.com/python/cpython/commit/89edd18779e382c5fa7f57722b0b897a907ed2c4


--

___
Python tracker 

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



[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2021-09-09 Thread Dave Tapley


Dave Tapley  added the comment:

I don't know if it helps, but I just ran in to this when I followed the advice 
at (1) because I wanted to type hint a method with the type of the enclosing 
class.

This broke a package I'm working on in parallel (2) because it uses 
dataclasses.fields internally.

I'm not sure what the advice would be here, should my package detect if the 
caller has `from __future__ import annotations` and do something?



(1) 
https://stackoverflow.com/questions/33533148/how-do-i-type-hint-a-method-with-the-type-of-the-enclosing-class/33533514#33533514
(2) https://pypi.org/project/dataclasses-configobj/

--
nosy: +davetapley

___
Python tracker 

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



[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +26687
pull_request: https://github.com/python/cpython/pull/28266

___
Python tracker 

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



[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in 
branch 'main':
bpo-45024 and bpo-23864: Document how interface testing works with the 
collections ABCs (GH-28218)
https://github.com/python/cpython/commit/62fa613f6a6e872723505ee9d56242c31a654a9d


--

___
Python tracker 

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



[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in 
branch 'main':
bpo-45024 and bpo-23864: Document how interface testing works with the 
collections ABCs (GH-28218)
https://github.com/python/cpython/commit/62fa613f6a6e872723505ee9d56242c31a654a9d


--

___
Python tracker 

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



[issue45154] Enumerate() function or class?

2021-09-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Thank you Raymond for the explanation. I didn't realise that there was a 
technical reason why built-in generators had to be implemented as classes in 
CPython.

Sanmitha's question was already discussed answered here:

https://discuss.python.org/t/enumerate-function-or-class/10504/1

--
nosy: +steven.daprano

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

For the common case where you’re using all defaults, it won’t matter.  
byteorder doesn’t matter when length=1.

> On Sep 9, 2021, at 18:12, Raymond Hettinger  wrote:
> 
> 
> Raymond Hettinger  added the comment:
> 
> Perhaps instead of the system byte ordering, choose one for the default so 
> that default encoding/decoding will work cross platform.  I think "little" is 
> the most common (intel and arm).

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Perhaps instead of the system byte ordering, choose one for the default so that 
default encoding/decoding will work cross platform.  I think "little" is the 
most common (intel and arm).

--
nosy: +rhettinger

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

> Ah, signed=False by default, so (128).to_bytes() will work. But I still worry 
> that it can provoke writing more errorprone code.

Can you elaborate on that?  Obviously no existing code will change behavior.  I 
really don’t expect people to write `(128).to_bytes(signed=True)` by accident.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Ah, signed=False by default, so (128).to_bytes() will work. But I still worry 
that it can provoke writing more errorprone code.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

So (128).to_bytes() will raise an error, right?

I afraid also that it will lead to some programs working correctly only on 
platforms with the most common byte order, just because authors are not aware 
of byte ordering. Currently the interface forces programmers to read something 
about byte ordering.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

Never mind, I've forced network byte order in struct strings for so long I had 
forgotten that native byte order was also the default there. Hence I withdraw 
that objection.

--

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Raymond, I am super grateful that you are showing us the assembly language. 
That's the kind of thing we need to do more of if we want to be successful. (In 
this case I'm not surprised by the outcome, but I have never studied x86 
assembly and this was a nice explanation.)

Regarding speeding up marshal, I am not at all convinced that this is still I/O 
bound. Raymond, do you have data about this? In my own informal experiments I 
believe the main cost I found was (a) stat() operations, and (b) the allocation 
and initialization of a large number of objects. In my (limited) understanding, 
"freezing" modules (like in bpo-45020) is mostly a win because it avoids stat() 
operations (and listdir(), too). But it would be nice to do a detailed 
experiment to get real facts here.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

Rather than defaulting to sys.byteorder, could the byte order default to None 
and only be optional when not needed? (input value fits in a single byte, 
output is a single byte)

Otherwise the difference in defaults between this method and the struct module 
(network byte order rather than host byte order) could be very confusing.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue31100] unable to open python on Windows

2021-09-09 Thread Steve Dower


Steve Dower  added the comment:

At this point, this isn't a helpful bug report anymore.

--
resolution:  -> out of date
stage:  -> 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



[issue45151] Logger library with task scheduler

2021-09-09 Thread Steve Dower


Steve Dower  added the comment:

Also, can you include your full task definition? There are a lot of options 
there which could cause it to launch in a different working directory (which 
will mess with your relative paths) or as a different user (which could mess 
with whether you can import your libraries).

I think it's possible to export the task definition as XML. Copy/pasting that 
here will be fine (not as an attachment, please, we just need to read it).

It's also difficult to collect standard output, so you may want to try adding 
something like "sys.stdout = sys.stderr = open(r'C:\Users\Public\Public 
Documents\log.txt', 'w')" to try and collect any output that you may be 
missing. The full path to the file is important, and it will need to be 
somewhere that most accounts can write.

--

___
Python tracker 

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



[issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2.7 is no longer maintained and the current configure files no longer 
have the lines that the patch modifies.

Please create a new issue if you are seeing this problem on a current version 
(>= 3.9).

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31100] unable to open python on Windows

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Is there anything more we can do on this or can we close it?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue30991] test_ctypes , test_dbm and test_ssl fail on arm64 (aarch64) architecture

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Changing type since test failures are not crash.

--
type: crash -> behavior

___
Python tracker 

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



[issue30991] test_ctypes , test_dbm and test_ssl fail on arm64 (aarch64) architecture

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.6 is no longer maintained. Please create a new issue if you are having 
problems with this on a current version (>= 3.9).

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue33085] *** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 ***

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

There isn't enough information here for us to do anything about this, and in 
any case Python 3.6 is no longer maintained. Please create a new issue if you 
are having this problem with a current version (>= 3.9) and can provide more 
information about how to reproduce it.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35301] python.exe crashes - lzma?

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

This sounds like it may very well be memory corruption by BOINC.  In any case, 
Python 3.6.3 is no longer maintained.

--
nosy: +iritkatriel
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45158] Refactor traceback.py to make TracebackException more extensible.

2021-09-09 Thread Anton Abrosimov


Anton Abrosimov  added the comment:

I think now is a good time for such a change. `FrameSummary`,` StackSummary` 
and `TracebackException` can be left backward compatible. And PEP 657 already 
breaks backward compatibility of output parsers.

--

___
Python tracker 

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



[issue45158] Refactor traceback.py to make TracebackException more extensible.

2021-09-09 Thread Anton Abrosimov


New submission from Anton Abrosimov :

1. Move internal dependencies (`FrameSummary`, `StackSummary`) to class 
attributes. Reduce coupling.
2. Separate receiving, processing and presenting traceback information.
How to replace `repr` with `pformat` in `FrameSummary`?
def __init__(...):
...
self.locals = {k: repr(v) for k, v in locals.items()} if locals else None
...
3. Move formatting templates to class attributes.
4. ...

Motivation:
1. For the sake of small changes to the view, you have to rewrite the entire 
`TracebackException` hierarchy. Or use string parsing.
2.1. During development, I want to see as much information as possible.
2.2. During production, displaying unnecessary information can lead to security 
problems.
2.3. In large projects, it is more convenient to use JSON for further 
processing in the system environment.

I have not found any PEPs describing `traceback.py`.
I can make a prototype of the changes if anyone is interested.

--
components: Library (Lib)
messages: 401528
nosy: abrosimov.a.a
priority: normal
severity: normal
status: open
title: Refactor traceback.py to make TracebackException more extensible.
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



[issue45157] DTrace on RHEL7, generated Include/pydtrace_probes.h fails to build: error: impossible constraint in ‘asm’

2021-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

Similar error with Python 3.10, AMD64 RHEL7 3.10 logs:
https://buildbot.python.org/all/#/builders/666/builds/344

--

___
Python tracker 

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



[issue45157] DTrace on RHEL7, generated Include/pydtrace_probes.h fails to build: error: impossible constraint in ‘asm’

2021-09-09 Thread STINNER Victor

New submission from STINNER Victor :

I modified RHEL7 configuration to build Python using --with-dtrace:

 argv: [b'./configure', b'--prefix', b'$(PWD)/target', b'--with-pydebug', 
b'--with-platlibdir=lib64', b'--enable-ipv6', b'--enable-shared', 
b'--with-computed-gotos=yes', b'--with-dbmliborder=gdbm:ndbm:bdb', 
b'--enable-loadable-sqlite-extensions', b'--with-dtrace', b'--with-lto', 
b'--with-ssl-default-suites=openssl', b'--without-static-libpython', 
b'--with-valgrind']

Problem: the generated Include/pydtrace_probes.h failed to build :-(

---
/usr/bin/dtrace  -o Include/pydtrace_probes.h -h -s Include/pydtrace.d
sed 's/PYTHON_/PyDTrace_/' Include/pydtrace_probes.h > 
Include/pydtrace_probes.h.tmp
mv Include/pydtrace_probes.h.tmp Include/pydtrace_probes.h
(...)
In file included from ./Include/pydtrace_probes.h:10:0,
 from ./Include/pydtrace.h:11,
 from Modules/gcmodule.c:33:
Modules/gcmodule.c: In function ‘gc_collect_main’:
./Include/pydtrace_probes.h:98:1: error: impossible constraint in ‘asm’
 DTRACE_PROBE1 (python, gc__start, arg1)
 ^
./Include/pydtrace_probes.h:109:1: error: impossible constraint in ‘asm’
 DTRACE_PROBE1 (python, gc__done, arg1)
 ^
---

Full logs of AMD64 RHEL7 3.x:
https://buildbot.python.org/all/#/builders/15/builds/761

In the meantime, I disabled --with-dtrace since other buildbot workers failed 
when dtrace was no installed. See:
https://github.com/python/buildmaster-config/pull/264

Maybe it's a problem on RHEL7. Maybe the problem is that Python is built with 
LTO?

--
components: Build
messages: 401526
nosy: cstratak, hroncok, vstinner
priority: normal
severity: normal
status: open
title: DTrace on RHEL7, generated Include/pydtrace_probes.h fails to build: 
error: impossible constraint in ‘asm’
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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
keywords: +patch
pull_requests: +26685
pull_request: https://github.com/python/cpython/pull/28265

___
Python tracker 

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



[issue45156] mock.seal has infinite recursion with int class attributes

2021-09-09 Thread David Mandelberg


New submission from David Mandelberg :

The code below seems to have infinite recursion in the mock.seal call with 
python 3.9.2.

from unittest import mock
class Foo:
  foo = 0
foo = mock.create_autospec(Foo)
mock.seal(foo)

--
components: Library (Lib)
messages: 401525
nosy: dseomn
priority: normal
severity: normal
status: open
title: mock.seal has infinite recursion with int class attributes
type: crash
versions: Python 3.9

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Barry A. Warsaw


New submission from Barry A. Warsaw :

In the PEP 467 discussion, I proposed being able to use

>>> (65).to_bytes()
b'A'

IOW, adding default arguments for the `length` and `byteorder` arguments to 
`int.to_bytes()`

https://mail.python.org/archives/list/python-...@python.org/message/PUR7UCOITMMH6TZVVJA5LKRCBYS4RBMR/

It occurs to me that this is (1) useful on its own merits; (2) easy to do.  So 
I've done it.  Creating this bug so I can link a PR against it.

--
components: Interpreter Core
messages: 401524
nosy: barry
priority: normal
severity: normal
stage: patch review
status: open
title: Add default arguments for int.to_bytes()
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



[issue10501] make_buildinfo regression with unquoted path

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

There is no longer a make_buildinfo.c

--
nosy: +iritkatriel
resolution: accepted -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39447] imaplib documentation claims that commands return a string, but they return bytes

2021-09-09 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This issue was fixed in https://github.com/python/cpython/commit/c75330605d4 -- 
closing.

--
nosy: +andrei.avk, kj
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue45119] test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide: Linux kernel 5.15 regression

2021-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.10 is also affected. Example with aarch64 Fedora Rawhide 3.10:
https://buildbot.python.org/all/#builders/636/builds/286

--
title: test_signal.test_itimer_virtual() failed on AMD64 Fedora Rawhide 3.x: 
Linux kernel 5.15 regression -> test_signal.test_itimer_virtual() failed on 
AMD64 Fedora Rawhide: Linux kernel 5.15 regression
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



[issue23249] test_win32 fails on aarch64

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
status: open -> closed

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 
3.2

___
Python tracker 

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



[issue23249] test_win32 fails on aarch64

2021-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Original bug report at https://bugzilla.redhat.com/show_bug.cgi?id=1174037

The bug was reported on Fedora (Linux).

We do now have a multiple AArch64 buildbots running Fedora and the whole test 
suite now pass there.

Example with "aarch64 Fedora Stable 3.x":
https://buildbot.python.org/all/#/builders/125/builds/612

"0:00:03 load avg: 4.20 [ 62/427] test_ctypes passed"

So yes, this issue can now be fixed ;-)

FYI Python is built with --with-system-ffi on Fedora, but buildbots don't use 
this flag. I'm working on using --with-system-ffi on buildbots, see:
https://github.com/python/buildmaster-config/pull/264

--
status: pending -> open

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

This issue was created 11 years ago today. Let's celebrate its anniversary by 
resolving it!

--

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 8.0 -> 9.0
pull_requests: +26684
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28264

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-09-09 Thread Steve Dower


Steve Dower  added the comment:

Going to just decide that we won't backport the update. If a big enough 
security issue is found we can consider it, but it would have to justify the 
potential-but-unlikely breaking change for users who are relying on the name of 
the DLL.

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue11255] 2to3 throws AttributeError during distutils installation with -O

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.2 is out of date, and distutils and 2to3 are both deprecated.

--
nosy: +iritkatriel
resolution:  -> out of date
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue45144] Use subtests in test_peepholer

2021-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am currently working on a feature which can be better in these cases that 
subTest(). It will allow to reduce the indentation level instead of increasing 
it.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44492] Building a C extension on Big Sur and SDK v10.15 fails

2021-09-09 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> ned.deily

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset b86437bb15fbaba55f9e56661598b4d5a3db86bb by Miss Islington (bot) 
in branch '3.10':
bpo-45067 - Verify the version of ncurses for extended color support feature 
usage. (GH-28260)
https://github.com/python/cpython/commit/b86437bb15fbaba55f9e56661598b4d5a3db86bb


--

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.9

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Idea for improving unmarshalling speed:  Since reading PYCs is I/O bound, it 
may be worthwhile to compress them.  When the idea came up previously, Antoine 
suggested choosing an algorithm with the fastest possible decompression speed 
(iirc, it was lzma4 at the time).  This should be an easy optimization that 
doesn't require changing the rest of the runtime.

--

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel

Irit Katriel  added the comment:

I’m not sure we’re hoping this to be faster, just reduce the code object size 
and not be slower. (Smaller code object could be faster to unmarshal).

--

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for the link.  This is a worthwhile experiment.  However, the potential 
gains will be hard to come by.

The workload of LOAD_CONST is very small.  After paying for the usual dispatch 
logic overhead, all it does is an index into a struct member and an incref.  
Both the co_consts table and the popular constant objects are already likely to 
be in the L1 data cache.  


##DEBUG_LABEL: TARGET_LOAD_CONST
movslq  %r15d, %rax ## OpArg fetch, typically a zero code 
register rename   
movq-368(%rbp), %rcx## 8-byte Reload to access co_consts
movq24(%rcx,%rax,8), %rax   ## The actual indexing operation  (3 
cycles)
incq(%rax)  ## The incref  


A specialized opcode for a specific constant like None can 1) eliminate the 
oparg fetch (likely saving nothing), and 2) eliminate the two sequentially 
dependent memory access (this is a win):

##DEBUG_LABEL: TARGET_LOAD_NONE
  ​  movq   __Py_NoneStruct@GOTPCREL(%rip), rax
incq(%rax)  ## The incref


Any more general opcode for loading small ints would still need the oparg fetch 
and the incref.  To win, it would need to convert the oparg into an int more 
efficiently than the two movq steps.  If the small int table is in a fixed 
location (not per-subinterpreter), then you can save 2 cycles with the simpler 
address computation:

##DEBUG_LABEL: TARGET_SMALLINT
movslq  %r15d, %rax ## OpArg fetch, typically a zero code 
register rename 
movq__Py_SmallInt@GOTPCREL(%rip), %rcx## Find an array of 
ints
movq(%rcx,%rax,8), %rax ## Cheaper address computation takes 1 
cycle
incq(%rax)  ## The incref 

The 2 cycle win (intel-only) will be partially offset by the additional 
pressure on the L1 data cache.  Right now, the co_consts is almost certainly in 
cache, holding only the constants that actually get used (at a rate of 8 per 
cache line).  Accesses into a small_int array will push other data out of L1.

IIRC, Serhiy already experimented with a LOAD_NONE opcode and couldn't get a 
measurable win.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44841] ZipInfo crashes on filemode

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Crash typically means segfault or the like, not an exception. 

Can you provide code to create the file "test-one-dir.zip" so that we can 
reproduce the issue?

--
nosy: +iritkatriel
type: crash -> behavior

___
Python tracker 

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



[issue23249] test_win32 fails on aarch64

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
status: closed -> pending

___
Python tracker 

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



[issue23249] test_win32 fails on aarch64

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

I believe we are on libffi 3.3 now - the code on that branch looks very 
different from this patch. Can we close this issue?

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 794430700defb913512f871b701a888aa730de81 by Senthil Kumaran in 
branch 'main':
bpo-45067 - Verify the version of ncurses for extended color support feature 
usage. (GH-28260)
https://github.com/python/cpython/commit/794430700defb913512f871b701a888aa730de81


--

___
Python tracker 

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



[issue24544] Race condition and crash when embedding multi-thread script

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2.7 is no longer maintained. Please create a new issue if you are having 
problems with this in a current version (>= 3.9).

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2021-09-09 Thread Irit Katriel

Irit Katriel  added the comment:

I get a different error now:

>>> import html.parser
>>> html.parser.HTMLParser().feed("", line 1, in 
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 110, in feed
self.goahead(0)
^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 178, in 
goahead
k = self.parse_html_declaration(i)
^^
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 263, in 
parse_html_declaration
return self.parse_marked_section(i)
   
  File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 144, in 
parse_marked_section
sectName, j = self._scan_name( i+3, i )
  ^
  File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 390, in 
_scan_name
raise AssertionError(
^
AssertionError: expected name token at '
<https://bugs.python.org/issue32876>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com


[issue38573] Not Implemented Error in stdLib HTMLParser

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Changing type since this is an exception and not a crash.

I get a different error now:

>>> parser.feed(bytearray.fromhex('3c215b63612121').decode('ascii'))
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 110, in feed
self.goahead(0)
^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 178, in 
goahead
k = self.parse_html_declaration(i)
^^
  File "/Users/iritkatriel/src/cpython-1/Lib/html/parser.py", line 263, in 
parse_html_declaration
return self.parse_marked_section(i)
   
  File "/Users/iritkatriel/src/cpython-1/Lib/_markupbase.py", line 154, in 
parse_marked_section
raise AssertionError(
^
AssertionError: unknown status keyword 'ca' in marked section

--
nosy: +iritkatriel
type: crash -> behavior

___
Python tracker 

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



[issue38596] simple example give a Linux core dumped with atk-bridge

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.7 is no longer maintained. If you are still seeing crashes in a 
current version (>= 3.9) then please create a new issue.

However, note that a bug report is more likely to get attention if it shows a 
bug in python, rather than just reporting that a complicated a system built on 
top of python is crashing.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45083] Need to use the exception class qualname when rendering exception (in C code)

2021-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

If the change is considered as a bugfix, it can wait for the next 3.9.x and 
3.10.x release.

If it's considered as a feature (which is backward incompatible), it should 
only land in 3.10 if it's in 3.10.0, but be reverted in the 3.9 branch.

Honestly, I don't care about which option is taken, I'm just worried about the 
consistency of branches.

--

___
Python tracker 

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



[issue36463] python37.dll crashing 0xc000041d

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as there isn't enough information here for us to do anything about 
this.  Also, Python 3.7 is no longer in maintenance. 


If you are still having this problem with a current version (>= 3.9) please 
create a new issue with information on how we can reproduce the problem.

--
nosy: +iritkatriel
resolution:  -> rejected
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



[issue39955] argparse print_help breaks when help is blank space

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> In argparse empty choices cannot be printed in the help
type: crash -> behavior

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel


Irit Katriel  added the comment:

It's related to this work: https://github.com/faster-cpython/ideas/issues/65

--

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I didn't know this was in the works.  Can you point me to the relevant 
discussion about why LOAD_CONST would be split?

--
nosy: +rhettinger

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +26682
pull_request: https://github.com/python/cpython/pull/28262

___
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-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The pow() docs could use substantial updating.  All of the logic for pow() is 
implemented in base.__pow__(exp, [mod]).  Technically, it isn't restricted to 
numeric types, that is just a norm.  The relationship between "pow(a,b)" and 
"a**b" is that both make the same call, a.__pow__(b).  The discussion of 
coercion rules dates back to Python 2 where used to have a coerce() builtin.  
Now, the cross-type logic is buried in either in type(a).__pow__ or in 
type(b).__rpow__.  The equivalence of pow(a, b, c) to a more efficient form of 
"a ** b % c" is a norm but not a requirement and is only supported by ints or 
third-party types.

My suggestions

1st paragraphs:  Stay at a high level, covering only the most common use case 
and simple understanding of how most people use pow():

   Return *base* to the power *exp* giving the same result
   as ``base**exp``.

   If *mod* is present and all the arguments are integers,
   return *base* to the power *exp*, modulo *mod*.  This
   gives the same result as ``base ** exp % mod`` but is
   computed much more efficiently.

2nd paragraph:  Be precise about what pow() actually does, differentiating the 
typical case from what is actually required:

   The :func:`pow` function calls the base's meth:`__pow__` method
   falling back to the exp's meth:`__rpow__` if needed.  The logic
   and semantics of those methods varies depending on the type.
   Typically, the arguments have numeric types but this is not required.
   For types that support the three-argument form, the usual semantics
   are that ``pow(b, e, m)`` is equivalent to ``a ** b % c`` but
   this is not required.

3rd paragraph: Cover behaviors common to int, float, and complex.

4th paragraph and later:  Cover type specific behaviors (i.e. only int supports 
the three argument form and the other arguments must be ints as well).

--
nosy: +rhettinger

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Changes merged to master and 3.10. Thanks, everyone!

@pablogsal: You can merge this to 3.10.0 if you see fit, but I'm going to close 
this issue.

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



[issue45083] Need to use the exception class qualname when rendering exception (in C code)

2021-09-09 Thread Łukasz Langa

Łukasz Langa  added the comment:

I agree with Serhiy, I consider this a bugfix. Let's raise it to "release 
blocker" to let Pablo decide if this should wait for 3.10.1 or get bumped up to 
3.10.0.

--
nosy: +pablogsal
priority: normal -> release blocker

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-09 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26681
pull_request: https://github.com/python/cpython/pull/28261

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> In my case, the file in question is implemented as a FUSE mount which is 
> served by the same process (different thread of course). Thus holding the GIL 
> at this point causes a rather interesting deadlock.

Since the change fixes a deadlock, I agree to backport it to 3.9 and 3.10.

Thanks for the fix!

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

I have created a pull request - https://github.com/python/cpython/pull/28260

Please review this.

--
assignee:  -> orsenthil
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread Senthil Kumaran


Change by Senthil Kumaran :


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

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-09 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 23c46778d65870784cb6d4de30f43aac62d71e73 by Miss Islington (bot) 
in branch '3.10':
bpo-44219: Release the GIL during isatty syscalls (GH-28250) (GH-28255)
https://github.com/python/cpython/commit/23c46778d65870784cb6d4de30f43aac62d71e73


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45154] Enumerate() function or class?

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

In pure python, generators are implemented as functions.  In CPython, the only 
way to implement them is as a class.  From a user's point of view, enumerate(), 
map(), zip(), and filter() are used like a functions (they doesn't have 
non-dunder methods).  Accordingly, they don't have class markup in the docs 
even though technically they are classes.  The docs are mostly consistent in 
this regard and have opted for the presentation that tends to be the most 
helpful to users.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45139] Docs: add source directive for minor translation simplification

2021-09-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

New directives introduce complexity. They should be saved for pervasive and 
non-trivial problems.

The motivation for this change is dubious (that a translator can't easily 
handle a simple fixed string pattern).  The OP grants that this is a "only 
small burden".   In general, translation is a large, difficult and time 
consuming task.  Adding this directive would not change that noticeably 
(changing the source text is among the easiest and most trivial subtasks).  It 
may even make translators job more difficult because it entails knowing how to 
edit the directive as opposed to use basic knowledge to make a simple in-line 
text substitution.

OTOH, there are costs.  Every new directive takes time to learn and remember.  
This is especially problematic when the directives are specific to one project; 
otherwise, the documentation skills don't translate across projects.  
Generally, it is best to use dirt simple, standard Sphinx markup, especially 
for trivial tasks like this one.

I do a lot of documentation work and am constantly wrestling will sphinx, many 
times unsuccessfully. Even among core developers, very few people already know 
all the directives that we already have.  Making the list longer doesn't make 
our lives easier unless a directive is solves a challenging problem and is 
commonly used.

--

___
Python tracker 

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



[issue45103] IDLE: make configdialog font page survive font failures

2021-09-09 Thread E. Paine


E. Paine  added the comment:

It turns out the problem is a combination of the font and IDLE preview content. 
With the phaistos font installed, inserting the content of the "Devanagari, 
Tamil" or "East Asian" sections into a Tk text widget causes it to freeze. For 
example, the following will fail:

pack [text .t]
.t insert end \u0966

The reason for this still confuses me, since Tk would never default (I believe) 
to trying to use phaistos font (and therefore it's installation should not 
affect this). I will report it to the Tk team.

--

___
Python tracker 

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



[issue45153] Except multiple types of exceptions with OR keyword is not working

2021-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Expression `A or B` gets you A if A is true.

If you want to catch several types of exception by one "except", use except 
with a tuple:

except (ConnectionResetError, ConnectionAbortedError):

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +26679
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28259

___
Python tracker 

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



[issue45139] Docs: add source directive for minor translation simplification

2021-09-09 Thread Zachary Ware


Zachary Ware  added the comment:

Note that this is suggesting to introduce a `.. source` directive, not adjust 
the existing `:source:` role.

There's nothing preventing the use of the existing pattern in special cases, 
while using the new directive in the common cases.  I don't have context for 
how much effort this would actually save translators (perhaps we could get 
representatives from various languages/workflows could chime in?) so it might 
not be worth it on other grounds, but I don't think this should be shot down 
just for "but sometimes" :)

--
nosy: +zach.ware
title: Docs: More surrounding text into the "source" directive -> Docs: add 
source directive for minor translation simplification
type:  -> enhancement

___
Python tracker 

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



[issue36424] Pickle fails on frozen dataclass that has slots

2021-09-09 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This actually can't be closed yet as the fix was not backported to 3.9

--

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread D.Lintin


D.Lintin  added the comment:

1 failing checks.

--

___
Python tracker 

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



[issue45154] Enumerate() function or class?

2021-09-09 Thread Sanmitha

New submission from Sanmitha :

I was learning about enumerate(). While learning, when I used,

>>>help(enumerate)

Help on class enumerate in module builtins:

class enumerate(object)
| enumerate(iterable, start=0)
|
| Return an enumerate object.
|
| iterable
| an object supporting iteration
|
| The enumerate object yields pairs containing a count (from start, which
| defaults to zero) and a value yielded by the iterable argument.
|
| enumerate is useful for obtaining an indexed list:
| (0, seq[0]), (1, seq[1]), (2, seq[2]), …
|
| Methods defined here:
|
| getattribute(self, name, /)

| Return getattr(self, name).
|
| iter(self, /)
| Implement iter(self).
|
| next(self, /)
| Implement next(self).
|
| reduce(…)
| Return state information for pickling.

Static methods defined here:
new(*args, **kwargs) from builtins.type
Create and return a new object. See help(type) for accurate signature.

Even when I gave as,

>>>enumerate


But, when I checked the documentation in the official website of python, 
www.python.org for enumerate()

Here : https://docs.python.org/3/library/functions.html#enumerate

It showed that enumerate() is a function which violated the information shown 
by help().

I couldn’t get whether enumerate() is a class or a function. Anyone please help 
me out of this please…

By the way, I had python 3.8.3. I even checked in python 3.6 and 3.7.10.

--
assignee: docs@python
components: Documentation
messages: 401487
nosy: Sanmitha Sadhishkumar, docs@python
priority: normal
severity: normal
status: open
title: Enumerate() function or class?
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue45153] Except multiple types of exceptions with OR keyword is not working

2021-09-09 Thread Shlomi


New submission from Shlomi :

When I want to catch multiple types of exceptions naturally 'OR' keyword is 
used. But it doesn't work. The interpreter doesn't show any error for the 
syntax, so developer may think it would work.

Small example:

try:
myfunc()
except ConnectionResetError or ConnectionAbortedError:
print("foo")
except Exception as e:
print("bar")

When myfunc() throws 'ConnectionAbortedError' the interpreter enters "bar" 
block, and not "foo" block.

--
components: Interpreter Core
messages: 401486
nosy: ShlomiRex
priority: normal
severity: normal
status: open
title: Except multiple types of exceptions with OR keyword is not working
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Irit Katriel


New submission from Irit Katriel :

This issue is to prepare the code for splitting LOAD_CONST to several opcodes.

There are a number of places in the code where an opcode is compared to 
LOAD_CONST (such as dis, the compiler, and the peephole optimizer). These need 
to be refactored to make the query "is this a hasconst opcode", and the value 
calculation needs to be refactored into a single place, which can later be 
updated to get the value from places other than co_consts.

--
assignee: iritkatriel
components: Interpreter Core, Library (Lib)
messages: 401485
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Prepare for splitting LOAD_CONST into several opcodes
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



[issue45151] Logger library with task scheduler

2021-09-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you simplify this to not use any external libraries?

--
components:  -IO, Windows
nosy: +eric.smith

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

@pablogsal: You might want to merge this back to 3.10.0, once it's merged to 
3.10. I'll merge it shortly, once the tests have run.

--
keywords:  -patch
nosy: +pablogsal
stage: patch review -> 

___
Python tracker 

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



[issue45151] Logger library with task scheduler

2021-09-09 Thread Brian Hunt

New submission from Brian Hunt :

Version: Python 3.9.3
Package: Logger + Windows 10 Task Scheduler
Error Msg: None

Behavior:
I built a logging process to use with a python script that will be scheduled 
with Windows 10 task scheduler (this could be a bug in task scheduler too, but 
starting here). I noticed it wasn’t working and started trying to trace the 
root of the issue.

If I created a new file called scratch.py and ran some code, the logs showed 
up. However, the exact same code in the exact same folder (titled: run_xyz.py) 
didn’t log those same messages. It appears that something in either the task 
scheduler or logger library doesn’t like the fact that my file name contains an 
underscore because as soon as I pointed my task scheduler task that didn’t log 
to my other file, it worked again. Also, when I finally removed the underscores 
it started working. I believe it is Logger library related because the task 
with underscores does in fact run the python code and generate the script 
output.



Code in both files:
-a_b_c.py code---
import os
import pathlib
import sys

pl_path = pathlib.Path(__file__).parents[1].resolve()
sys.path.append(str(pl_path))



from src.Core.Logging import get_logger
#
logger = get_logger(__name__, False)
logger.info("TESTING_USing taskScheduler")



---src.Core.Logging.py get_logger code
import logging
import datetime
import time
import os

# from logging.handlers import SMTPHandler

from config import build_stage, log_config
from Pipelines.Databases import sqlAlchemy_logging_con


class DBHandler(logging.Handler):
def __init__(self, name):
"""

:param name: Deprecated
"""
logging.StreamHandler.__init__(self)
self.con = sqlAlchemy_logging_con()
self.sql = """insert into Logs (LogMessage, Datetime, FullPathNM, 
LogLevelNM, ErrorLine) values ('{message}', '{dbtime}', '{pathname}', 
'{level}', '{errLn}')"""
self.name = name



def formatDBTime(self, record):
record.dbtime = datetime.strftime("#%Y/%m/%d#", 
datetime.localtime(record.created))

def emit(self, record):
creation_time = time.strftime("%Y-%m-%d %H:%M:%S", 
time.localtime(record.created))

try:
self.format(record)

if record.exc_info:
record.exc_text = 
logging._defaultFormatter.formatException(record.exc_info)
else:
record.exc_text = ""

sql = self.sql.format(message=record.message
  , dbtime=creation_time
  , pathname=record.pathname
  , level=record.levelname
  , errLn=record.lineno)

self.con.execute(sql)




except:
pass


def get_logger(name, use_local_logging=False):
"""
Returns a logger based on a name given. Name should be __name__ variable or 
unique for each call.
Never call more than one time in a given file as it clears the logger. Use 
config.log_config to define configuration
of the logger and its handlers.
:param name:
:return: logger
"""
logger = logging.getLogger(name)
logger.handlers.clear()

# used to send logs to local file location. Level set to that of logger
if use_local_logging:
handler = logging.FileHandler("Data\\Output\\log_" + build_stage + 
str(datetime.date.today()).replace("-","") + ".log")
handler.setLevel(log_config['logger_level'])
logger.addHandler(handler)

dbhandler = DBHandler(name)
dbhandler.setLevel(log_config['db_handler_level'])
logger.addHandler(dbhandler)
logger.setLevel(log_config['logger_level'])



return logger

--
components: IO, Library (Lib), Windows
messages: 401482
nosy: btjehunt, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Logger library with task scheduler
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread D.Lintin


D.Lintin  added the comment:

Thankyou!

--

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks to both of you. Unfortunately, I have to pick one PR to use, and since 
dlintin had the earlier one, I'll use it.

--

___
Python tracker 

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



[issue45067] Failed to build _curses on CentOS 7

2021-09-09 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

A change like this will be required since these funcs were introduced only 
recently and nurses shipped with centos was older.

% git diff
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 61aaf85522..6fb6c490e6 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -135,7 +135,7 @@ typedef chtype attr_t;   /* No attr_t type is 
available */
 #define STRICT_SYSV_CURSES
 #endif

-#if NCURSES_EXT_COLORS+0 && NCURSES_EXT_FUNCS+0
+#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20170401) && 
(defined(NCURSES_EXT_COLORS) && NCURSES_EXT_COLORS >= 20170401)
 #define _NCURSES_EXTENDED_COLOR_FUNCS   1
 #else
 #define _NCURSES_EXTENDED_COLOR_FUNCS   0

--

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5c65834d801d6b4313eef0684a30e12c22ccfedd by Miss Islington (bot) 
in branch '3.9':
bpo-44219: Release the GIL during isatty syscalls (GH-28250)
https://github.com/python/cpython/commit/5c65834d801d6b4313eef0684a30e12c22ccfedd


--

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread D.Lintin


D.Lintin  added the comment:

Just updated the description to attach to the issues, thanks.

--

___
Python tracker 

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread D.Lintin


Change by D.Lintin :


--
pull_requests: +26677
pull_request: https://github.com/python/cpython/pull/28253

___
Python tracker 

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



  1   2   >