[issue38211] clean up type_init()

2021-06-17 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I'm marking this as closed/fixed. Mark, please reopen if you disagree :)

--
nosy: +erlendaasland
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



[issue44439] PickleBuffer doesn't have __len__ method

2021-06-17 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

(The nosy list change was an accident of my local copy not being complete 
refreshed before posting.)

If (b=b, *c) were evaluated in order, then the byte code for b=b and any 
subsequent keyword arguments would have to be put aside, such as in a separate 
buffer, until it was known that there would be no following *exp.  Without 
lookahead, this is known when either **kw or closing ) is reached.  At that 
point, the keyword buffer would be copied to the main buffer.

It might actually be easier to remove all order restrictions and compile all 
keyword values to a side buffer, to be copied to the main buffer when the 
closing ) is reached. 

One version of the question I am raising is this: given that f(a, b=b) and 
f(*(a,), b=b) have the same effect (are alternate spellings of the same 
instruction(s)), why should f(b=b, a) and f(b=b, *(a,)) *not* have the same 
effect, with one spelling being prohibited and the other not?

The meaning of '*expression' is defined as having the same effect as an 
equivalent sequence of positional argument expression in the same place as the 
expression. 

"If the syntax *expression appears in the function call, expression must 
evaluate to an iterable. Elements from these iterables are treated as if they 
were additional positional arguments. For the call f(x1, x2, *y, x3, x4), if y 
evaluates to a sequence y1, …, yM, this is equivalent to a call with M+4 
positional arguments x1, x2, y1, …, yM, x3, x4."

The first sentence of the next paragrapsh, allowing only *exp to follow b=exp, 
contradicts the last line above.  I am sorry I did not read these paregraphs 
carefully until now.

--

___
Python tracker 

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



[issue16437] issubclass doc improvement

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

@Ken - not quite. This issue is about isinstance containing "(or recursively, 
other such tuples)" which is not there for issubclass.

--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-17 Thread Karolina Surma


Karolina Surma  added the comment:

Thanks for the fix, this indeed worked. Documentation however still doesn't 
build successfully, this time with a traceback:

Warning, treated as error:
/builddir/build/BUILD/Python-3.10.0b2/Doc/c-api/object.rst:314:Error in 
declarator or parameters
Error in declarator or parameters
Invalid C declaration: Expected identifier, got keyword: default [error at 62]
  Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default)
  --^
make: *** [Makefile:51: build] Error 2

I'm afraid there will be more on the way as this item is resolved.

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

___
Python tracker 

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



[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-17 Thread miss-islington


miss-islington  added the comment:


New changeset c544393b89f9b3e2b1a22588fc9ae58019314879 by Joe in branch 'main':
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
https://github.com/python/cpython/commit/c544393b89f9b3e2b1a22588fc9ae58019314879


--

___
Python tracker 

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



[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25351
pull_request: https://github.com/python/cpython/pull/26765

___
Python tracker 

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



[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-17 Thread miss-islington


miss-islington  added the comment:


New changeset 08f2b9dedea13d2e9d11c189914387db3a66e2ca by Miss Islington (bot) 
in branch '3.10':
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
https://github.com/python/cpython/commit/08f2b9dedea13d2e9d11c189914387db3a66e2ca


--

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-06-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25352
pull_request: https://github.com/python/cpython/pull/26766

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-06-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 00710e6346fd2394aa020b2dfae170093effac98 by Erlend Egeberg 
Aasland in branch 'main':
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)
https://github.com/python/cpython/commit/00710e6346fd2394aa020b2dfae170093effac98


--

___
Python tracker 

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



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Alexander Dietz


New submission from Alexander Dietz :

Using python 3.8.10 and the documentation 
https://docs.python.org/3.8/library/logging.html it seems that either the 
documentation is incorrect/unclear, or that the logging module does not work as 
described. 

Reading on the Logger Object and the setLevel method I created the attached 
python code, which does not work as expected. As I set the level to "DEBUG", 
and the documentation clearly says " Logging messages which are less severe 
than level will be ignored". But having set the level to DEBUG, even the more 
"severe" info message is ignored. That is clearly contradicting the 
documentation!

--
assignee: docs@python
components: Documentation
files: problem.py
messages: 395984
nosy: alex4200, docs@python
priority: normal
severity: normal
status: open
title: logging does not work as documented (setLevel)
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50114/problem.py

___
Python tracker 

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



[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread kryheb


New submission from kryheb :

Hi all,

I observed misbehavior trying to embed the Python interpreter into a C app.
It seems that after re-initialization, PyImport_Inittab is malformed and points 
to the memory freed _PyImport_Fini2.


Steps to reproduce:

1. Append embedded module
2. Initialize Python from config with run_filename
3. Run main with an infinite loop
4. Interrupt script execution with async call
5. Finalize Python
6. Repeat all above

Observed behavior:
The script is executed at first iteration, but re-initialization fails with an 
error:
"
Traceback (most recent call last):
  File "", line 1187, in 
_install_external_importers
ModuleNotFoundError: No module named 'posix'

Error: external importer setup failed
"

Head of modules list at fist run:
-- Modules: --
#0 'posix'
#1 'errno'
#2 'pwd'
--
and after re-initialization:
-- Modules: --
#0 'P ''
#1 'errno'
#2 'pwd'
--

An issue discovered on:
Fedora 33
gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
python3-devel.x86_64 3.9.5-2.fc33

Issue still exists on the latest main and on the rc 3.10
Source code to reproduce an issue in attachment.

Best regards,
Krystian Heberlein

--
components: C API, Library (Lib)
files: inittab-bug.c
messages: 395985
nosy: kryheb
priority: normal
severity: normal
status: open
title: Malformed PyImport_Inittab after re-initialization
versions: Python 3.10, Python 3.9
Added file: https://bugs.python.org/file50115/inittab-bug.c

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks. That one's a genuine keyword. Looks like what we probably need to do is 
get a list of all these errors, so that they can all be fixed at once. 
Presumably running without the "-W" flag would make that easier.

--

___
Python tracker 

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



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

Logging can be quite tricky. There are filters at multiple levels. In this 
case, you didn't set up the "global logging" and I am guessing, by default, it 
only shows WARNING and above. You can fix your problem by doing:

logging.basicConfig(level=logging.DEBUG)

--
nosy: +cryvate

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-06-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7297d74251de3b1c02dcdb9ca281461cc7fb4535 by Miss Islington (bot) 
in branch '3.10':
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351) 
(GH-26766)
https://github.com/python/cpython/commit/7297d74251de3b1c02dcdb9ca281461cc7fb4535


--

___
Python tracker 

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



[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread kryheb


Change by kryheb :


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

___
Python tracker 

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



[issue16376] wrong type for wintypes.BYTE

2021-06-17 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +amaury.forgeotdarc, belopolsky
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue20115] NUL bytes in commented lines

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue1105770.

--

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Bluenix


Bluenix  added the comment:

My exact use-case is that I am subclassing asyncio.Semaphore to change some 
functionality (override `release()` to do nothing and set up tasks to schedule 
calls to reset the counter). I am expecting *a lot* of these instances so (like 
Serhiy Storchaka nicely put it) I would like to reduce the memory footprint of 
these classes by using __slots__. The issue now becomes that asyncio.Semaphore 
(like most other asyncio classes) have not defined __slots__, this prohibits my 
subclass from taking advantage of __slots__.

--

___
Python tracker 

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



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

2021-06-17 Thread Mark Shannon


Change by Mark Shannon :


--
assignee: Mark.Shannon -> eric.snow

___
Python tracker 

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



[issue9102] pybench: Cannot compare 2.x and 3.x benchmarks

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

Can we close this? I don't think we are still interested in performance 
comparisons with Python 2.

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue9102] pybench: Cannot compare 2.x and 3.x benchmarks

2021-06-17 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Yes, closing.

--
stage: needs patch -> 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



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Alexander Dietz


Alexander Dietz  added the comment:

I was not asking for a solution or a workaround. I simply wanted to submit this 
bug in either the code or the documentation.

--

___
Python tracker 

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



[issue12600] Add example of using load_tests to parameterise Test Cases

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

It remains to update the load_test doc along the lines of Michael's suggestion 
in msg140999.

--
keywords: +easy
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon


New submission from Mark Shannon :

When calling frame.clear(), the globals (and builtins) are cleared.
This is not the case in 3.10. We should restore the 3.10 behavior, as there is 
no reason not to.


Victor, you've mentioned this problem. Did you have a specific example I can 
add as a test?

--
assignee: Mark.Shannon
messages: 395995
nosy: Mark.Shannon, vstinner
priority: normal
severity: normal
status: open
title: Globals (and presumably builtins) are cleared premuturely in FrameObject
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



[issue10582] PyErr_PrintEx exits silently when passed SystemExit exception

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

This was removed in https://github.com/python/cpython/pull/13390.

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



[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-06-17 Thread Irit Katriel


Change by Irit Katriel :


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



[issue14322] More test coverage for hmac

2021-06-17 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue44405] add program passed as string to dis module.

2021-06-17 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-17 Thread Karolina Surma


Karolina Surma  added the comment:

Thanks for the suggestion, I reran the build without -W option. 

Fortunately, the output shows that the reported errors shall be the only ones.

Build logs from the test build for reference: 
https://download.copr.fedorainfracloud.org/results/ksurma/pygments-2.9.0/fedora-rawhide-x86_64/02257459-python3-docs/build.log.gz

--

___
Python tracker 

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



[issue44324] add a "expected expression" syntax error

2021-06-17 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue44440] logging does not work as documented (setLevel)

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

The sentence within the doc should not be considered in isolation.

The "Logger" object is *not* ignoring the message (in accordance with the 
documentation and your expectation), but the "Handler" is, see 
https://docs.python.org/3.8/library/logging.html#logging.Handler.setLevel and 
here: https://docs.python.org/3/howto/logging.html: "The default level is 
WARNING, which means that only events of this level and above will be tracked, 
unless the logging package is configured to do otherwise."

Logging is quite complicated, and reading the API reference is not the best 
starting point, as is noted at the top of the page and links provided.

--

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I was thinking about something like:

@dataclass
class FtpHelper(ftplib.FTP):
my_host: str
my_user: str
lookup_password: InitVar[Callable]

def __post_init__(self, lookup_password):
super().__init__(host=self.my_host, user=self.my_user, 
passwd=lookup_password())

def get_password():
return "a password"

ftp = FtpHelper(hostname, username, get_password)

--

___
Python tracker 

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



[issue44443] dataclass looks up default on the class, not the classes __dict__

2021-06-17 Thread Eric V. Smith


New submission from Eric V. Smith :

Consider:

class FtpHelper(ftplib.FTP):
host: str
baz: str = 'baz default'

>>> FtpHelper.host
''
>>> FtpHelper.baz
'baz default'
>>> getattr(FtpHelper, "host")
''
>>> getattr(FtpHelper, "baz")
'baz default'

But:
>>> FtpHelper.__dict__['host']
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'host'
>>> FtpHelper.__dict__['baz']
'baz default'


Now make this a dataclass, without a default value for baz:

@dataclass
class FtpHelper(ftplib.FTP):
host: str
baz: str

This gives an error:
TypeError: non-default argument 'baz' follows default argument

And this is because it's picking up a default value for host from the base 
class ftplib.FTP, and generating an __init__ like:

def __init__(self, host='', baz):

@dataclass uses getattr(cls, field_name, MISSING) to find the default value for 
the field, but in this case that's wrong. I think what should happen is that it 
should use getattr(cls.__dict__, field_name, MISSING). This would be consistent 
with other features where dataclasses does not look in base classes for various 
things, but only in the class itself (like __hash__).

--
assignee: eric.smith
components: Library (Lib)
messages: 396000
nosy: eric.smith
priority: normal
severity: normal
status: open
title: dataclass looks up default on the class, not the classes __dict__
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



[issue44443] dataclass looks up default on the class, not the class's __dict__

2021-06-17 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: dataclass looks up default on the class, not the classes __dict__ -> 
dataclass looks up default on the class, not the class's __dict__

___
Python tracker 

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



[issue44443] dataclass looks up default on the class, not the class's __dict__

2021-06-17 Thread Eric V. Smith


Change by Eric V. Smith :


--
type:  -> behavior

___
Python tracker 

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



[issue44324] add a "expected expression" syntax error

2021-06-17 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2021-06-17 Thread Irit Katriel


Change by Irit Katriel :


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



[issue38146] QVariant NULL returns anomalous values in equality statements

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

This looks like an issue with the way QVariant is defined. I'm not sure why you 
are reporting it as a Python bug?

--
nosy: +iritkatriel
resolution:  -> third party
status: open -> pending

___
Python tracker 

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



[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2021-06-17 Thread Henk-Jaap Wagenaar


Change by Henk-Jaap Wagenaar :


--
nosy: +cryvate

___
Python tracker 

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



[issue44441] Malformed PyImport_Inittab after re-initialization

2021-06-17 Thread Petr Viktorin


Change by Petr Viktorin :


--
nosy: +vstinner

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-06-17 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +25356
pull_request: https://github.com/python/cpython/pull/26769

___
Python tracker 

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



[issue44443] dataclass looks up field default value on the class, not the class's __dict__

2021-06-17 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: dataclass looks up default on the class, not the class's __dict__ -> 
dataclass looks up field default value on the class, not the class's __dict__

___
Python tracker 

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



[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, you've mentioned this problem. Did you have a specific example I can 
> add as a test?

Sorry, I didn't have any reproducer. I vaguely recall an error in the unittest 
module when getting globals from a frame.

--

___
Python tracker 

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



[issue44444] How can track and trace your parcel live?

2021-06-17 Thread fastway track


New submission from fastway track :

Do you feel worried about your parcel and also get bored collecting the parcel 
from depo? Fastway Tracking is the best service for tracking the parcel. You 
are looking for a service in which you can track your parcel and also get the 
parcel at home? Then this is the right page for the solution to your problem. 
And it also provides the service of delivery. https://fastwaytracking.com/

--
messages: 396003
nosy: fastwaytracking123
priority: normal
severity: normal
status: open
title: How can track and trace your parcel live?

___
Python tracker 

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



[issue44444] How can track and trace your parcel live?

2021-06-17 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue44445] Add `site-include` install scheme path in sysconfig

2021-06-17 Thread Filipe Laíns

New submission from Filipe Laíns :

During the distutils deprecation, we have identified that there is no good 
replacement for the distutils `headers` install path. This path defines where 
packages are supposed to install headers on the system.

The setuptools equivalent would be `include`/`platinclude`, but these paths 
depend on `installed_base`/`installed_platbase`, which makes them the same on 
virtual environments. For this reason, they are not very suitable as a 
`headers` replacement -- if a package installs to `include` on a virtual 
environment, those files will be available everywhere.

{
...
'include': '{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude': 
'{installed_platbase}/include/python{py_version_short}{abiflags}',
}

I propose introducing two new paths, `site-include` and `site-platinclude`, as 
follows:

{
...
'include': '{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude': 
'{installed_platbase}/include/python{py_version_short}{abiflags}',
'site-include': '{base}/include/python{py_version_short}{abiflags}-site',
'site-platinclude': 
'{platbase}/include/python{py_version_short}{abiflags}-site',
}

This would make them different paths on virtual environments and would allow us 
to install header files there instead of `include`/`platinclude`.

Does anyone have a better idea? Or is there perhaps something I have missed?

---

Hopefully, this could go into Python 3.10, so that users can easily replace 
distutils usages with sysconfig. I understand if that may be unlikely.

---

Relevant links:
https://discuss.python.org/t/clarification-on-a-wheels-header-data/9305
https://github.com/pypa/pip/issues/9617

--
messages: 396004
nosy: FFY00, dstufft, eric.araujo, jaraco, pablogsal, steve.dower, tarek
priority: high
severity: normal
status: open
title: Add `site-include` install scheme path in sysconfig
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



[issue1105770] null source chars handled oddly by tokenize

2021-06-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Closing in favor of issue20115.

--
nosy: +gvanrossum
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm currently not very interested in philosophizing about why we allow one
syntax but not the other.

--

___
Python tracker 

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



[issue44444] Spam

2021-06-17 Thread Zachary Ware


Zachary Ware  added the comment:

So disappointing that this issue number was taken by spam :(

--
nosy: +zach.ware -fastwaytracking123
title: How can track and trace your parcel live? -> Spam

___
Python tracker 

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



[issue44444] Spam

2021-06-17 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue44444] Spam

2021-06-17 Thread Zachary Ware


Change by Zachary Ware :


--
nosy:  -zach.ware

___
Python tracker 

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



[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon


Change by Mark Shannon :


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



[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon


Mark Shannon  added the comment:

No problem, I've added a simple test.

--
stage: patch review -> 

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-06-17 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +25357
pull_request: https://github.com/python/cpython/pull/26771

___
Python tracker 

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



[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I was pointing out what to me is a second related contradiction in the doc, 
between one sentence and the next.

--

___
Python tracker 

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



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

2021-06-17 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +25358
pull_request: https://github.com/python/cpython/pull/26772

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-06-17 Thread miss-islington

miss-islington  added the comment:


New changeset f73377d57c5272390de633c292c44689310a by Irit Katriel in 
branch 'main':
bpo-43024: improve signature (in help, etc) for functions taking sent… 
(GH-24331)
https://github.com/python/cpython/commit/f73377d57c5272390de633c292c44689310a


--
nosy: +miss-islington

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-06-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25359
pull_request: https://github.com/python/cpython/pull/26773

___
Python tracker 

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



[issue44384] test_ttk_guionly: 2 tests fail once each on Pipelines Ubuntu

2021-06-17 Thread E. Paine


Change by E. Paine :


--
nosy: +epaine

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-06-17 Thread Irit Katriel

Irit Katriel  added the comment:


New changeset eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983 by Miss Islington (bot) 
in branch '3.10':
bpo-43024: improve signature (in help, etc) for functions taking sent… 
(GH-24331) (GH-26773)
https://github.com/python/cpython/commit/eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983


--

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-06-17 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44445] Add `site-include` install scheme path in sysconfig

2021-06-17 Thread Steve Dower


Steve Dower  added the comment:

distutils.sysconfig doesn't expose the headers path either, it's only there as 
a default value for the install command (Lib/distutils/command/install.py).

So it doesn't seem unreasonable to provide a recommendation on where to put 
shared header files and let installers do their own calculation. If an 
installer wants to install into _another_ environment, it can't rely on 
sysconfig anyway, so we need the spec as well as any implementation. And if we 
don't have the spec then people will have to reverse-engineer the 
implementation anyway, so we may as well start with the spec.

Now, whether we actually need or want packages dumping all their headers in one 
directory is a different question. At least on some platforms they'll also need 
to import libraries too, and tools like Cython have different files yet again. 
Many existing project keep these files inside their package and offer the path 
on request (e.g. pybind11), so perhaps we actually want to standardise 
pkg-config-like metadata instead?

(Also crossposting back to the discuss thread)

--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks; this looks like an easy fix, then. No time right now, but I'll aim to 
get to it at some point before the end of the weekend, if no-one beats me to it.

--

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger


New submission from Thomas Grainger :

demo:

import traceback
import io

async def foo():
yield 1
traceback.print_stack(file=io.StringIO())
yield 2

async def bar():
return [chunk async for chunk in foo()]


next(bar().__await__(), None)
print("working!")


Traceback (most recent call last):
  File "/home/graingert/projects/anyio/foo.py", line 13, in 
next(bar().__await__(), None)
  File "/home/graingert/projects/anyio/foo.py", line 10, in bar
return [chunk async for chunk in foo()]
  File "/home/graingert/projects/anyio/foo.py", line -1, in 
  File "/home/graingert/projects/anyio/foo.py", line 6, in foo
traceback.print_stack(file=io.StringIO())
  File "/usr/lib/python3.10/traceback.py", line 203, in print_stack
print_list(extract_stack(f, limit=limit), file=file)
  File "/usr/lib/python3.10/traceback.py", line 224, in extract_stack
stack = StackSummary.extract(walk_stack(f), limit=limit)
  File "/usr/lib/python3.10/traceback.py", line 379, in extract
f.line
  File "/usr/lib/python3.10/traceback.py", line 301, in line
self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/usr/lib/python3.10/linecache.py", line 31, in getline
if 1 <= lineno <= len(lines):
TypeError: '<=' not supported between instances of 'int' and 'NoneType'

--
messages: 396014
nosy: graingert
priority: normal
severity: normal
status: open
title: linecache.getline TypeError when formatting tracebacks in stacks 
containing an async list comprehension
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



[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2021-06-17 Thread Henk-Jaap Wagenaar


Change by Henk-Jaap Wagenaar :


--
nosy: +Cryvate
nosy_count: 4.0 -> 5.0
pull_requests: +25360
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26774

___
Python tracker 

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



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

2021-06-17 Thread Eric Snow


Eric Snow  added the comment:

FWIW, I've wrapped up the key parts that I wanted to get done here
(co_localplusnames/kinds, MAKE_CELL, eliminate unused fast local
for arg cells).  I'm leaving this open for now as there are a few
things I didn't do that seem part of the original intention of this
issue:

* fully interleave the cells with the locals in their "natural" order
  (rather than only interleaving arg cells)
* update the compiler to track names/kinds rather than computing
  them after the fact during the assembler step
  (this will allow us to remove a decent amount of code)
* track the specific arg kinds in localspluskinds
  (this should allow us to make _PyEval_MakeFrameVector() simpler
  and a bit more efficient)

--

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Ned Batchelder


Change by Ned Batchelder :


--
nosy: +nedbat

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger


Change by Thomas Grainger :


--
nosy: +Mark.Shannon -nedbat

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger


Change by Thomas Grainger :


--
nosy: +nedbat

___
Python tracker 

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



[issue38193] http.client should be "runnable" like http.server

2021-06-17 Thread Jonathan Schweder


Change by Jonathan Schweder :


--
keywords: +patch
nosy: +jaswdr
nosy_count: 1.0 -> 2.0
pull_requests: +25361
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26775

___
Python tracker 

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



[issue31538] mailbox does not treat external factories the same

2021-06-17 Thread Henk-Jaap Wagenaar


Change by Henk-Jaap Wagenaar :


--
keywords: +patch
nosy: +Cryvate
nosy_count: 4.0 -> 5.0
pull_requests: +25362
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26776

___
Python tracker 

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



[issue31538] mailbox does not treat external factories the same

2021-06-17 Thread Henk-Jaap Wagenaar


Change by Henk-Jaap Wagenaar :


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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> if you are creating instances and calling this method 
> all the time, will lead to an infinite memory leak.

Your words aren't making any sense to me.  The default 
lru_cache will never hold more than maxsize entries.
The default maxsize is 128.  How is that "infinite"?

--

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

I clearly was missing some words there Raymond. I meant, if one has set 
maxsize=None.

--

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Henk-Jaap Wagenaar


Henk-Jaap Wagenaar  added the comment:

(but consenting adults, setting max_size=None for "efficiency", you better be 
sure what you are doing in a long running process and making sure it cannot 
grow unbounded.)

--

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I meant, if one has set maxsize=None.

The docs already say, "If maxsize is set to None, the LRU feature is disabled 
and the cache can grow without bound."

--

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 7f01f77f8fabcfd7ddb5d99f12d6fc99af9af384 by Raymond Hettinger in 
branch 'main':
bpo-44310: Add a FAQ entry for caching method calls (GH-26731)
https://github.com/python/cpython/commit/7f01f77f8fabcfd7ddb5d99f12d6fc99af9af384


--
message_count: 18.0 -> 19.0
pull_requests: +25363
pull_request: https://github.com/python/cpython/pull/26777

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25364
pull_request: https://github.com/python/cpython/pull/26778

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25363
pull_request: https://github.com/python/cpython/pull/26777

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +iritkatriel

___
Python tracker 

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



[issue25251] Unknown MS Compiler version 1900

2021-06-17 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 14.0 -> 15.0
pull_requests: +25365
pull_request: https://github.com/python/cpython/pull/26780

___
Python tracker 

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



[issue44310] Document that lru_cache uses hard references

2021-06-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 77eaf14d278882857e658f83681e5b9a52cf14ac by Miss Islington (bot) 
in branch '3.10':
bpo-44310: Add a FAQ entry for caching method calls (GH-26731) (GH-26777)
https://github.com/python/cpython/commit/77eaf14d278882857e658f83681e5b9a52cf14ac


--

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
keywords: +patch
nosy: +FFY00
nosy_count: 4.0 -> 5.0
pull_requests: +25366
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26781

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Filipe Laíns

Filipe Laíns  added the comment:

I bissected this to 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b and submitted a 
patch making traceback.FrameSummary take into consideration that lineno might 
be None, I believe this is probably the correct fix.

--

___
Python tracker 

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



[issue44447] Syntax Error not as detailed as shown

2021-06-17 Thread Eesa Ibrahim Khokhar


New submission from Eesa Ibrahim Khokhar :

I was testing the new features for python 3.10 beta 3, and noticed the errors 
were not as detailed as shown in the docs.

I have an image below:


In the docs, it was said that the entire generator statement would be pointed 
out by carets. However, it only pointed out 'for', and the error was not as 
detailed as shown in the docs.

--
components: Regular Expressions
files: Untitled.png
messages: 396023
nosy: ezio.melotti, khokhareesa.home, mrabarnett
priority: normal
severity: normal
status: open
title: Syntax Error not as detailed as shown
type: performance
versions: Python 3.10
Added file: https://bugs.python.org/file50116/Untitled.png

___
Python tracker 

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



[issue44447] Syntax Error not as detailed as shown

2021-06-17 Thread Andre Roberge


Andre Roberge  added the comment:

Your example is different than the one in the documentation (What's new).

>>> (x, x for x in range(7))  # Your example
  File "", line 1
(x, x for x in range(7))
  ^^^
SyntaxError: invalid syntax

>>> foo(x, x for x in range(7))  # Example similar to the docs
  File "", line 1
foo(x, x for x in range(7))
   ^^^
SyntaxError: Generator expression must be parenthesized

>>> [x, x for x in range(7)]  # Yet a different example
  File "", line 1
[x, x for x in range(7)]
 
SyntaxError: did you forget parentheses around the comprehension target?

--
nosy: +aroberge

___
Python tracker 

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



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2021-06-17 Thread Brett Cannon


Brett Cannon  added the comment:

Did you mean to link to a fork, Irit?

--
status: pending -> open

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +25367
pull_request: https://github.com/python/cpython/pull/26782

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Filipe Laíns

Filipe Laíns  added the comment:

Upon further investigation, there are actually two issues here. The first would 
be the one I identified already, traceback.FrameSummary not being prepared for 
lineno being None, but there is also a regression in lineno being invalid in 
this situation in the first place.

With only GH-26781, the traceback will look like the following:


  File "/home/anubis/git/cpython/rep.py", line 13, in 
next(bar().__await__(), None)
  File "/home/anubis/git/cpython/rep.py", line 10, in bar
return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line None, in 
  File "/home/anubis/git/cpython/rep.py", line 6, in foo
traceback.print_stack()
working!


which is different from 3.9



  File "/home/anubis/git/cpython/rep.py", line 13, in 
next(bar().__await__(), None)
  File "/home/anubis/git/cpython/rep.py", line 10, in bar
return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line 10, in 
return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line 6, in foo
traceback.print_stack()
working!


I bisected the second issue to b37181e69209746adc2119c471599a1ea5faa6c8 which 
moves generators to bytecode, and when doing so changes the behavior to set 
lineno to -1. I have opened a GH-26782 to fixing this.

--

___
Python tracker 

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



[issue44448] Suggestion: change existing error message for invalid function name

2021-06-17 Thread Andre Roberge


New submission from Andre Roberge :

Consider the following two examples with the latest beta release:

Python 3.10.0b3 ...

>>> def 3job(x):
  File "", line 1
def 3job(x):
 ^
SyntaxError: invalid imaginary literal

>>> def 3ob(x):
  File "", line 1
def 3ob(x):
^
SyntaxError: invalid decimal literal

In most situations, these error messages are fantastic improvements compared 
with what was done previously. Here however, as they are intended to be used as 
function names, perhaps they could be improved.

**If** it is easy to check if those "invalid number literals" are preceded by 
"def" during the analysis, perhaps a better error message might be

SyntaxError: invalid function name

If such an analysis would be difficult to do, I would suggest to simply close 
this issue as these examples are probably almost never going to be seen in 
real-life situations.


(One might also consider to change the error message in the cases of "invalid 
octal" and "invalid hexadecimal" when they are used as function names.)

--
components: Parser
messages: 396027
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Suggestion: change existing error message for invalid function name
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



[issue44433] processes created by subprocess.Popen is not terminating

2021-06-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this. If you can reproduce it with a smaller program that we 
can test, please attach the information and re-open this issue.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

It's a good example, but some readers might only have a vague idea (if any) of 
what FTP is, so a self contained example might be easier to digest?

--

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

The size of an instance of Semaphore is 48, of an empty tuple is 40, of a small 
int is 28, of an instance of a normal class with a single slot in __slots__ is 
also 40, are you use 48 byte size will really be an issue for you?

--

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Andrei: The size of an instance of Semaphore is 48 bytes + 104 more bytes for 
the __dict__ containing its three attributes (ignoring the cost of the 
attributes themselves). A slotted class with three attributes only needs 56 
bytes of overhead per-instance (it has no __dict__, so the 56 is the total 
cost). Dropping overhead of the instances by >60% can make a difference if 
you're really making many thousands of them.

Personally, I think Python level classes should generally default to using 
__slots__ unless the classes are explicitly not for subclassing; not using 
__slots__ means all subclasses have their hands tied by the decision of the 
parent class. Perhaps explicitly opting in to __weakref__ (which __slots__ 
removes by default) to allow weak referencing, but it's fairly rare a class 
*needs* to otherwise allow the creation of arbitrary attributes.

--
nosy: +josh.r

___
Python tracker 

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



[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2021-06-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

The description is nonsensical as is; not sure the patch goes far enough. 
C-style strings are *defined* to end at the NUL terminator; if it really needs 
a NUL after the int, saying it "points to the first character which follows the 
representation of the number" is highly misleading; the NUL isn't logically a 
character in the C-string way of looking at things.

The patch is also wrong; the digits need not end in a NUL byte (trailing 
whitespace is allowed).

AFAICT, the function really uses pend for two purposes:

1. If it succeeds in parsing, then pend reports the end of the string, nothing 
else
2. If it fails, because the string is not a legal input (contains non-numeric, 
or non-leading/terminal whitespace or whatever), pend tells you where the first 
violation character that couldn't be massaged to meet the rules for int() 
occurred.

#1 is a mostly useless bit of info (strlen would be equally informative, and if 
the value parsed, you rarely care how long it was anyway), so pend is, 
practically speaking, solely for error-checking/reporting.

The rewrite should basically say what is allowed (making it clear anything 
beyond the single parsable integer value with optional leading/trailing 
whitespace is illegal), and making it clear that pend always points to the end 
of the string on success (not just after the representation of the number, it's 
after the trailing whitespace too), and on failure indicates where parsing 
failed.

--
nosy: +josh.r

___
Python tracker 

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



[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

My mistake, I forgot the size of the dict itself is not included in getsizeof().

--

___
Python tracker 

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