[issue44674] dataclasses should allow frozendict default value

2021-07-23 Thread Gianni Mariani


Gianni Mariani  added the comment:

@Arjun - this is about default values (See the bug description - Using a 
frozendict as a default value)

Try this:

from frozendict import frozendict
from dataclasses import dataclass

@dataclass
class A:
a: frozendict = frozendict(a=1)

This used to work until frozendict became a subclass of dict.

Perhaps another fix is to convert any dict to a frozendict? Maybe not.

How would you handle this case? The only thing I figured was:
from frozendict import frozendict, field
from dataclasses import dataclass

AD=frozendict(a=1)
@dataclass
class A:
a: frozendict = field(default_factory=lambda:AD)

Which imho is cumbersome.

--

___
Python tracker 

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



[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree with Steven's more careful analysis and with canning 'pseudo'.  Current 
suggestion.

A *future statement*, "from __future__ import *feature* ...",  directs the 
compiler to compile the current module using syntax or semantics that will 
become standard in a future release of Python.  The *__future__ module* 
documents the possible values of *feature*.

Cross reference *future statement to 
 and *__future__ module* to its 
doc chapter.  The first sentence above is based on the first sentence of the 
future statement doc.

--

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-23 Thread Ken Jin


Change by Ken Jin :


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



[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

What exactly is a "pseudo-module"? I can only imagine it is something 
like sys, which exists internally in the interpreter but doesn't have an 
independent existence as a .py .dll or .so file.

That's not the case with `__future__`, which is an *actual* module. I 
think that talking about "pseudo-module" is inaccurate and confusing and 
I suggest we ought to drop it.

The real difference is (as I understand it) is that the **syntax**

from __future__ import 

is not an actual import, it doesn't go through the import system, it 
doesn't touch the `__future__` module, and it can only appear in 
restricted positions.

(It is legal in the interactive interpreter, and as the very first 
executable line of code in a .py file. So after the docstring, but 
before any code.)

So the current docs are misleading. It's not `__future__` that is 
special. That is a real module. It is the syntactic form that is 
special. It's not a pseudo-*module* but a pseudo-*import*.

With a little bit of jiggery-pokery we can even get the "from ... import 
..." version working:

>>> from __future__ import nested_scopes as nested_scopes
>>> nested_scopes
_Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), 16)

(Only tested in the interactive interpreter, but I presume it will also 
work in a .py file.)

So:

1. `__future__` is a real, not "pseudo", module.

2. We can import from the module like any other module.

3. It is the *syntax* `from __future__ import ` that is 
   special, not the module.

4. It behaves as a compiler directive, not an import.

Let's fix the docs to describe what actually happens and drop any 
reference to "pseudo-module". It is needlessly confusing and inaccurate.

--

___
Python tracker 

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



[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I think GH-27313 will fix this

--

___
Python tracker 

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



[issue44720] Weakref proxy crashes on null tp_iternext slot.

2021-07-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Here's a simpler reproducer:

not_an_iterator = lambda: 0

class A:
def __iter__(self):
return weakref.proxy(not_an_iterator)
a = A()
list(a)

I opened a PR.

--
title: Finding string in iteratively deleted object cause segfault -> Weakref 
proxy crashes on null tp_iternext slot.

___
Python tracker 

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



[issue44720] Finding string in iteratively deleted object cause segfault

2021-07-23 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
keywords: +patch
nosy: +Dennis Sweeney
nosy_count: 1.0 -> 2.0
pull_requests: +25862
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27316

___
Python tracker 

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



[issue42357] Wrong Availability for signal.SIGCHLD

2021-07-23 Thread Zachary Ware


Zachary Ware  added the comment:

You are correct, thanks for the ping Andrei.

And thank you for the patch, Maiyun!

--
nosy: +zach.ware
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue42357] Wrong Availability for signal.SIGCHLD

2021-07-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This can be closed (fixed).

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44722] RFC: string Multiline Formatter

2021-07-23 Thread creative-resort


creative-resort  added the comment:

Thank you for your kind guidance :)

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



[issue44685] Email package issue with Outlook msg files

2021-07-23 Thread R. David Murray


R. David Murray  added the comment:

That file appears to be a binary file?  By itself it isn't enough to reproduce 
the problem.  Can you provide a complete script as well as the email message 
you are parsing that demonstrates the problem?

By "looks like any other eml file", are you including the MIME headers 
associated with the part?  Because it is the MIME headers that contain the 
information you say is missing.  Mostly likely, outlook is not supplying that 
information for these transformed eml files.  If you can supply a copy of the 
actual email message you are parsing, we should be able to confirm that.

--

___
Python tracker 

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



[issue44694] Message from BytesParser cannot be flattened immediately

2021-07-23 Thread R. David Murray


R. David Murray  added the comment:

I suspect maxheaderlen=0 works because it causes the original lines to be 
re-emitted without any folding or other processing.  Without that, lines longer 
than the default max_line_length get refolded.

Can you provide an example of an input message that triggers this problem?

--

___
Python tracker 

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



[issue44730] unittest.mock.patch does not work as a decorator on generator functions

2021-07-23 Thread Gareth Williams


Change by Gareth Williams :


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

___
Python tracker 

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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread R. David Murray


R. David Murray  added the comment:

Having looked at the cited part of the RFC (but not tried to analyze it in 
detail), I think you are correct.  I've also glanced at your PR, and I think 
your approach is correct in broad outline, but I haven't looked at the details. 
 For full message/global support, however, it will also be necessary to look at 
the output side: given a message/global part, a transfer encoding should be 
applied when serializing with cte_type=7bit.  Support for message/global should 
also be added to the contentmanager.

I won't have an objection if this is accepted with only the feedparser support, 
but I would recommend that the remaining pieces of support for message/global 
be added before the feature is released.

--

___
Python tracker 

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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread Francis Johnson

Francis Johnson  added the comment:

The first paragraph of section 3.5 states two positions that the RFC holds on 
Content-Transfer-Encodings:
(1) “allows newly defined MIME types to permit content-transfer-encoding;” and
(2) “allows content-transfer-encoding for message/global (see Section 3.7) 
[sic].”

The second position refers to and combines with section 3.7 (namely the 
“Encoding considerations” paragraph) to support my interpretation that 
implementations should accurately parse "message/global Emails with 
non-identity Content-Transfer-Encodings” (how I have paraphrased it).  For 
quick reference, “non-identity” refers to the “quoted-printable” and “base64” 
Content-Transfer-Encodings.
The first position “suggests” a wider breadth, but I do not think its words 
“necessitate” it.  For, the RFC lists only one “newly defined MIME type;” 
whereas a media/MIME type in general (in this case, all others) only affects 
the scope of RFCs that define/update it.

So I think my interpretation is precise if one defers to section 3 of the RFC.

Now, admittedly, two other sections in the RFC seem to contradict section 3.5 
by broadening the scope (Abstract, p. 2; Introduction, s. 1, p. 3).  I’m not 
super hung up on how to resolve the contradiction; but I think, at a minimum, 
the missing support for “message/global” should be added.

--

___
Python tracker 

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



[issue44429] Tkinter Flow Geometry Manager

2021-07-23 Thread Gary Davenport


Gary Davenport  added the comment:

Just an update on this issue.  I did make 2 packages available on pypi.org:

https://pypi.org/project/flowframe/

and 

https://pypi.org/project/tkinterflow/

Thank you very much for your help.

--
resolution:  -> works for me
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



[issue44674] dataclasses should allow frozendict default value

2021-07-23 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue44674] dataclasses should allow frozendict default value

2021-07-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

When I originally read this, I read it as frozenset. I agree that there's no 
good way of telling if an arbitrary class is immutable, so I'm not sure we can 
do anything here.

So I think we should close this as a rejected idea.

--

___
Python tracker 

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



[issue44730] unittest.mock.patch does not work as a decorator on generator functions

2021-07-23 Thread Gareth Williams


New submission from Gareth Williams :

unitest.mock.patch does not work well when applied as a decorator to a function 
which is a generator.

It results in the function being changed from a generator function (co_flags 
99) to a non-generator (co_flag 31) and the patch is not applied.

[I have a MWE, attached, and fairly simple fix, to the file mock.py, which I 
will put up as a PR in due course. This is the first time I've submitted a bug 
or PR, so apologies if I've not done this particularly well.]

--
components: Library (Lib)
files: example_patch_failure.py
messages: 398104
nosy: garethmjwilliams
priority: normal
severity: normal
status: open
title: unittest.mock.patch does not work as a decorator on generator functions
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file50176/example_patch_failure.py

___
Python tracker 

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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread blackrose 1337


blackrose 1337  added the comment:

#44713: subprocess.rst typo ``"shell=True"`` => ``shell=True``

--
nosy: +virusdetected1337

___
Python tracker 

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



[issue44729] sys.setprofile bug

2021-07-23 Thread Hasan


Change by Hasan :


--
type:  -> behavior

___
Python tracker 

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



[issue44729] sys.setprofile bug

2021-07-23 Thread Hasan


New submission from Hasan :

1. If we try to import modules except os or sys, we will get such events. 

2. If we access frame.f_locals.items() and frame.f_code.replace() inside 
tracefunc, function execution shows events and stops, but if access other 
frame.f_locals.* it begins to call and look all files in python directory

import sys

def tracefunc(frame, event, arg):
if event == "call":
print('frame.f_locals.items: ->', frame.f_locals.items())
return tracefunc

sys.setprofile(tracefunc)


def test_sum(x: int, y: int):
return x + y

test_sum(10, 20)

import asyncio

-

event: -> call
frame.f_locals.items: -> dict_items([('x', 10), ('y', 20)])
event: -> return
event: -> call
frame.f_locals.items: -> dict_items([('name', 'asyncio'), ('import_', )])
event: -> call
frame.f_locals.items: -> dict_items([('self', 
<_frozen_importlib._ModuleLockManager object at 0x10ae2a3f0>), ('name', 
'asyncio')])
event: -> return
event: -> call
frame.f_locals.items: -> dict_items([('self', 
<_frozen_importlib._ModuleLockManager object at 0x10ae2a3f0>)])
event: -> call
frame.f_locals.items: -> dict_items([('name', 'asyncio')])
event: -> c_call
event: -> c_return
event: -> call
frame.f_locals.items: -> Traceback (most recent call last):
  File 
"/Users/hasanaliyev/Documents/programming/github/test/debugger/notwork.py", 
line 38, in 
import asyncio
^^
  File "", line 1024, in _find_and_load
  File "", line 170, in __enter__
  File "", line 196, in _get_module_lock
  File "", line 71, in __init__
  File 
"/Users/hasanaliyev/Documents/programming/github/test/debugger/notwork.py", 
line 24, in tracefunc
print('frame.f_locals.items: ->', frame.f_locals.items())
^
  File "", line 139, in __repr__
AttributeError: '_ModuleLock' object has no attribute 'name'

--
components: Library (Lib)
messages: 398102
nosy: AliyevH
priority: normal
severity: normal
status: open
title: sys.setprofile bug
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



[issue44611] CPython uses deprecated randomness API

2021-07-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +25859
pull_request: https://github.com/python/cpython/pull/27314

___
Python tracker 

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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread Francis Johnson

Francis Johnson  added the comment:

Try parsing an example such as this through the Python email library:

Content-Type: message/global
Content-Transfer-Encoding: quoted-printable

Content-Type: text/plain; =
charset=3D”us-ascii”

Hello, World!



You will find that the valid quoted-printable content is visited but not 
decoded prior to parsing; it is parsed as-is and treated as a bad message: the 
charset in the “text/plain” Content-Type improperly parsed, for example.  I 
have a draft pull request for this, which might be easier to understand.  Let 
me know if you need further clarification.

--

___
Python tracker 

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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

dont obviously *match* 

--

___
Python tracker 

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



[issue44722] RFC: string Multiline Formatter

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I suggest you close this issue and if you have an improved code, propose it on 
python-ideas list for discussion.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue44674] dataclasses should allow frozendict default value

2021-07-23 Thread Arjun


Arjun  added the comment:

Which frozendict does your message concern? I found this in some test: 
https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/test/test_builtin.py#L741
 or are you suggesting any user defined immutable object?

I'm not sure indicating that an object should be immutable to dataclasses will 
be less cumbersome than default_factory.

Currently, you have to do this:
> x: frozendict = field(default_factory=frozendict)

But, indicating mutability would be something like this:
> x: frozendict = field(mutable=false)

--
nosy: +CCLDArjun

___
Python tracker 

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



[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Interpreting the last post ...

--
nosy: +terry.reedy
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



[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I thnk the glossary should say both.  Approximately: "When the first statement 
of a program starts 'from __future__ import feature', a pseudo-module ... . 
When used later in a program,  __future__ is a real module."  Link each 
statement to an appropriate place in the doc.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue44671] Create a built-in yaml module

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The current status of this idea is that it has been rejected.  Please read the 
previous discussion(s) and consider the arguments against.  If you then still 
want this idea reconsidered, please post to the python-ideas list explaining 
why you think the rejection is wrong, or what you think has changed.  Please do 
not simply repeat the previous arguments.

--
nosy: +terry.reedy
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



[issue44660] email.feedparser: support RFC 6532 section 3.5

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

RFC 6532 Internationalized Email Headers
https://datatracker.ietf.org/doc/html/rfc6532

3.5.  Changes to MIME Message Type Encoding Restrictions
https://datatracker.ietf.org/doc/html/rfc6532#section-3.5

don't obviously "message/global Emails with non-identity 
Content-Transfer-Encodings".  Please clarify.

--
nosy: +terry.reedy
title: email.feedparser Module Lacks Support for Section 3.5 of RFC 6532: 
message/global Emails with non-identity Content-Transfer-Encodings -> 
email.feedparser: support RFC 6532 section 3.5

___
Python tracker 

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



[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

> it doesn't do a normal import of the `__future__.py` module, it is actually a 
> compiler directive.

It’s both!  The compiler has special handling for this line (pseudo-module), 
and the interpreter does a regular import that gets the regular python module 
which can be used for introspection (the third purpose noted in the module doc).

--
nosy: +eric.araujo

___
Python tracker 

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



[issue42414] unable to document fields of dataclass

2021-07-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I was thinking about adding this to named tuple as well, but it's less useful 
than with dataclasses because named tuples are simpler and smaller. However if 
this feature is added to dataclasses and is widely used, it would make a lot of 
sense to expand it to namedtuples especially if people request that.

I don't think it makes sense for attributes because many attributes are 
immutable so you can't add a doc attr to them. Additionally, most attrs can be 
documented via methods that set or update them.

I agree it's a good idea to bring this to Ideas, I'll think about this for a 
few days and then do that. Thanks!

--

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

Two other things we realized while working on this:

- The first occurrence of line 15 in the example output should be marked as 
incorrectly traced.

- We should emit a NOP to show coverage of "case _" (that fix will be part of 
the same PR).

--

___
Python tracker 

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



[issue42414] unable to document fields of dataclass

2021-07-23 Thread Eric V. Smith

Eric V. Smith  added the comment:

The more I think about this, the less I like it as a dataclasses-specific 
solution (if it’s accepted at all, that is). Why dataclasses and not attrs or 
NamedTuple? I suggest bringing it up on python-ideas for wider exposure.

--

___
Python tracker 

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



[issue43950] Include column offsets for bytecode instructions

2021-07-23 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25858
pull_request: https://github.com/python/cpython/pull/27313

___
Python tracker 

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



[issue43950] Include column offsets for bytecode instructions

2021-07-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

bpo-44719 managed to make the `assert(source_line);` fail

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

### Simplified crasher

from weakref import ref

def f():
ref(lambda: 0, [])
f()

f()




Running this in debug mode, I got a failed assertion at traceback.c,
line 746, `assert(source_line);`. 
If that assertion is commented out, a null pointer is dereferenced in
_PyPegen_byte_offset_to_character_offset()

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue35728] Tkinter font nametofont requires default root

2021-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The code I gave above now exits with a clearer message.
RuntimeError: No master specified and tkinter is configured to not support 
default root

But now, in 3.10, the master can be specified, so that
  fnt = font.nametofont('TkFixedFont', root)
works.  Thank you Serhiy and desmondcheongzx.

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



[issue41256] activate script created by venv is not smart enough

2021-07-23 Thread Jack DeVries


Jack DeVries  added the comment:

*please disregard the typo in the shebang line!*

--

___
Python tracker 

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



[issue41256] activate script created by venv is not smart enough

2021-07-23 Thread Jack DeVries


Jack DeVries  added the comment:

What do you think about this as an entrypoint?

```sh
#!/usr/bin/env

# this becomes venv/bin/activate
# the old venv/bin/activate is now venv/bin/activate.sh

# Try to execute a `return` statement,
# but do it in a sub-shell and catch the results.
# If this script isn't sourced, that will raise an error.
$(return >/dev/null 2>&1)

# What exit code did that give?
if [ "$?" -ne "0" ]
then
echo "Warning: this script must be sourced, not run in a subshell."
echo "Try \"source /path/to/activate\" on unix-like systems."
fi

# dispatch to shell-specific activate scripts
# *ignore proper path construction for the sake of demonstration...*
[ $BASH_VERSION ] || [ $ZSH_VERSION ] && . ./activate.sh
[ $FISH_VERSION ] && . ./activate.fish
[ $csh_version ] && . ./activate.csh
```

The try-to-return trick was shamelessly taken from here:
https://stackoverflow.com/a/34642589/13262536

I am a shell scripting novice, so I am certain that there are many unaddressed 
edge cases here. I know that reliably detecting whether a script has been 
sourced or "ran" is essentially impossible to do in a cross-platform way.

--
nosy: +jack__d

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-23 Thread Sebastian Rittau


Change by Sebastian Rittau :


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

___
Python tracker 

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



[issue44728] Testsuite fails on x86_64

2021-07-23 Thread Erich Eckner


New submission from Erich Eckner :

The following tests fails on x86 32 bit:

test_cmath test_math test_posix test_turtle - looks, like the expected 
precision is too high.

Full log is attached.

--
components: Tests
files: build-log.php?a=pentium4&p=python
messages: 398084
nosy: deep42thought
priority: normal
severity: normal
status: open
title: Testsuite fails on x86_64
versions: Python 3.9
Added file: https://bugs.python.org/file50175/build-log.php?a=pentium4&p=python

___
Python tracker 

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-23 Thread Dominic Davis-Foster


Change by Dominic Davis-Foster :


--
nosy: +domdfcoding

___
Python tracker 

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



[issue44721] Problem in tkinter button widget

2021-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue44721] Problem in tkinter button widget

2021-07-23 Thread Seyed Amirhossein Misaghi


Change by Seyed Amirhossein Misaghi :


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



[issue44721] Problem in tkinter button widget

2021-07-23 Thread Seyed Amirhossein Misaghi


Seyed Amirhossein Misaghi  added the comment:

Thanks for your response

--

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Currently deprecation warnings are emitted in test_typing:

$ ./python -m test test_typing
0:00:00 load avg: 3.38 Run tests sequentially
0:00:00 load avg: 3.38 [1/1] test_typing
/home/serhiy/py/cpython/Lib/test/test_typing.py:4657: DeprecationWarning: 
typing.io is deprecated, import directly from typing instead. typing.io will be 
removed in Python 3.12.
  k not in typing.io.__all__ and
/home/serhiy/py/cpython/Lib/test/test_typing.py:4658: DeprecationWarning: 
typing.re is deprecated, import directly from typing instead. typing.re will be 
removed in Python 3.12.
  k not in typing.re.__all__ and

== Tests result: SUCCESS ==

1 test OK.

Total duration: 564 ms
Tests result: SUCCESS

--
assignee: docs@python -> 
nosy: +serhiy.storchaka
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue44721] Problem in tkinter button widget

2021-07-23 Thread E. Paine


E. Paine  added the comment:

Sadly, there is no `activerelief` option. The Tk man pages note the following:
> A button's relief is changed to sunken whenever mouse button 1 is pressed 
> over the button, and the relief is restored to its original value when button 
> 1 is later released. [https://www.tcl.tk/man/tcl8.6/TkCmd/button.html#M18]

You can also see in the source code that sunken is hard-coded:
https://github.com/tcltk/tk/blob/1802b8a5d6807bdab6ac703f48e6e6bf07970266/library/button.tcl#L227

Personally, I think changing the relief to 'sunken' on click is an important 
feature, since a user needs feedback on when they've clicked the button. Thank 
you for reporting this issue, but I think it should be closed as either 'not a 
bug' or 'third party'.

--
nosy: +epaine, serhiy.storchaka

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 27311 copies tests from PR 9951, adds support of nested NewTypes (with 
__qualname__ containing multiple components) an makes them pickleable by name 
as functions and classes.

--

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +25856
pull_request: https://github.com/python/cpython/pull/27311

___
Python tracker 

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



[issue35728] Tkinter font nametofont requires default root

2021-07-23 Thread Leonardo Freua


Leonardo Freua  added the comment:

Has the PR already solved the problem? If yes, could this issue not be closed?

--
nosy: +Leonardofreua

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2021-07-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've put up a PR here: https://github.com/python/cpython/pull/27310/files

If this looks good, I will update the docs and add news entry.

--

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2021-07-23 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 1.0 -> 2.0
pull_requests: +25855
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27310

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

I usually wait until buildbots are green before closing the bpo, but I don't 
think there's anything else.

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



[issue22240] argparse support for "python -m module" in help

2021-07-23 Thread Nils Kattenbeck


Nils Kattenbeck  added the comment:

I expanded the patch from tebeka to also work with invocations like `python3 -m 
serial.tools.miniterm` where `miniterm.py` is a file and not a directory with a 
`__main__.py`. This was able to handle everything I threw at it.

However due to the import of zipfile which itself imports binascii the build of 
CPython itself fails at the `sharedmods` stage...


```text
 CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -fwrapv 
-O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python -E ./setup.py  
build
Traceback (most recent call last):
  File "/home/septatrix/Documents/programming/cpython/./setup.py", line 3, in 

import argparse
^^^
  File "/home/septatrix/Documents/programming/cpython/Lib/argparse.py", line 
93, in 
from zipfile import is_zipfile as _is_zipfile
^
  File "/home/septatrix/Documents/programming/cpython/Lib/zipfile.py", line 6, 
in 
import binascii
^^^
ModuleNotFoundError: No module named 'binascii'
make: *** [Makefile:639: sharedmods] Error 1
```

I guess this is because binascii is a c module and not yet build at that point 
in time. Does anyone who knows more about the build system have an idea how to 
resolve this?

---

Resolving this bug would also allow the removal of several workarounds for this 
in the stdlib:

* 
https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/unittest/__main__.py#L4
* 
https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/json/tool.py#L19
* 
https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/venv/__init__.py#L426

--
Added file: https://bugs.python.org/file50174/patch.diff

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41756] Do not always use exceptions to return result from coroutine

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

that is, bpo-44727

--

___
Python tracker 

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



[issue41756] Do not always use exceptions to return result from coroutine

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Hello!
This change added an enum to the stable ABI:
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} PySendResult;

Adding new values to enums might break the stable ABI in some (admittedly rare) 
cases; so usually it's better to avoid enums and stick with int and #ifdef'd 
values.
This particular one looks like it won't be extended and won't cause problems, 
but still, switching to int would make stable ABI easier to work with.
Is anyone against switching to int?

See pbo-44727 for details.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2021-07-23 Thread Zachary Ware


Zachary Ware  added the comment:

The bundled version of libffi is no longer included in any version in bugfix 
support; closing this as out of date.  As suggested in an earlier message, the 
libffi from your system should be used instead if you're building a version of 
Python that still includes a copy of libffi.

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

> Delegating operations to the underlying mapping is still OK, all we're 
> wanting to bypass is the operand coercion dances in abstract.c and object.c 
> that may expose the underlying mapping to the *other* operand.

But this won't work if *both* operands are proxies, right? The left wrapped 
mapping will only ever see itself and the right mappingproxy, and the right 
operand will only ever see itself and the left mappingproxy. The overwhelmingly 
common case is where these proxies wrap dicts, and dicts only play nicely with 
other dicts.

I agree that creating redundant copies isn't optimal; it's just the only way 
that I see we'd be able to fix this without backward compatibility headaches. 
The fix is easy to explain to users without needing to get into the nuances of 
operator dispatch or bloating the code to handle weird edge-cases (trust me, I 
originally tried coding logic to handle all the different possibilities of 
subclasses and proxies and such before landing on the copying solution).

With that said, I think that if we decide it's really not worth it to copy 
here, Serhiy's proposal is probably "good enough". Just return a merged dict 
for the union operation, and implement mapping equality in a sane, usable way. 
I just worry that it will break backward-compatibility in subtle ways that are 
basically impossible to fix (comparing equality of proxied OrderedDicts, for 
example).

--

___
Python tracker 

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



[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2021-07-23 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests:  -25844

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2021-07-23 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue44727] Stable ABI should avoid `enum`

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

As far as I can see, the current enums in the stable ABI are:

PySendResult from object.h, return value of PyObject_Send:
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} PySendResult;
(This is unlikely to change in the future, but added in 3.10, maybe it can be 
converted to int.)

PyLockStatus from pythread.h, return value of PyThread_acquire_lock_timed:
typedef enum PyLockStatus {
PY_LOCK_FAILURE = 0,
PY_LOCK_ACQUIRED = 1,
PY_LOCK_INTR
} PyLockStatus;
(This has been there for a long time so shouldn't be changed now.)

PyGILState_STATE from pystate.h, for PyGILState_Ensure/PyGILState_Release:
typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;
(Also is unlikely to change in the future.)

--
nosy:  -corona10

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2021-07-23 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +25854
pull_request: https://github.com/python/cpython/pull/27309

___
Python tracker 

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



[issue44727] Stable ABI should avoid `enum`

2021-07-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44727] Stable ABI should avoid `enum`

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Devguide PR: https://github.com/python/devguide/pull/730

--

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2021-07-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is there anything left in this issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex()

2021-07-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex()

2021-07-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5ec275758dbc307e9838e7038bfc3b5390950ea7 by Miss Islington (bot) 
in branch '3.10':
bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and 
_ssl._SSLSocket.write (GH-27271) (GH-27308)
https://github.com/python/cpython/commit/5ec275758dbc307e9838e7038bfc3b5390950ea7


--

___
Python tracker 

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



[issue44727] Stable ABI should avoid `enum`

2021-07-23 Thread Petr Viktorin


New submission from Petr Viktorin :

Adding a new enumerator to a C enum can change the size of the type,
which would break the ABI.
This is not often a problem in practice, but the rules around when it is a 
problem and when it isn't are complicated enough that I believe enum should not 
be used in the stable ABI (possibly with well-reasoned exceptions)

AFAICS, the rules are:
- In C++, an incompatible change to an enum is one that changes the size of the 
*smallest bit field large enough to hold all enumerators*. Values outside the 
range cause undefined/unspecified behavior.
- In C, it looks like enums that fit in `char` are safe.

(Also, the compiler-defined size of enums will make it more cumbersome to 
formally define an ABI for non-C languages.)

--
components: C API
messages: 398067
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: Stable ABI should avoid `enum`

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Thanks for the suggestion. I will do some testing and, if warranted, make the 
> necessary changes.

Thanks Ned!

--

___
Python tracker 

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



[issue34963] String representation for types created with typing.NewType(…) are opaque and unappealing

2021-07-23 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

`NewType` was converted into callable class at scope of 
https://bugs.python.org/issue44353

Currently `repr` of `NewType` is:
```
>>> UserId = NewType("UserId", int)
__main__.UserId
```

--
nosy: +uriyyo

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the suggestion. I will do some testing and, if warranted, make the 
necessary changes.

--
assignee:  -> ned.deily

___
Python tracker 

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



[issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex()

2021-07-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 83d1430ee5b8008631e7f2a75447e740eed065c1 by Pablo Galindo Salgado 
in branch 'main':
bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and 
_ssl._SSLSocket.write (GH-27271)
https://github.com/python/cpython/commit/83d1430ee5b8008631e7f2a75447e740eed065c1


--
message_count: 11.0 -> 12.0
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25853
pull_request: https://github.com/python/cpython/pull/27308

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

However, to use thin-lto, build-installer.py should use clang compiler.
We need to check this issue.

--

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 632e8a69593efb12ec58d90e624ddf249a7a1b65 by Miss Islington (bot) 
in branch '3.10':
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG 
no-op (GH-27260) (GH-27306)
https://github.com/python/cpython/commit/632e8a69593efb12ec58d90e624ddf249a7a1b65


--

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

see bpo-44340

--

___
Python tracker 

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



[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-23 Thread Łukasz Langa

Łukasz Langa  added the comment:

I'm still unable to reproduce this locally. Objects/listobject.c:527:24 is this 
line in `list_concat`:

dest = np->ob_item + Py_SIZE(a);

(permalink: 
https://github.com/python/cpython/blob/8f42106b5c362495f72c6ca2fa3884538e4023db/Objects/listobject.c#L527)

This can only be problematic if `ob_item` of the new list is NULL *AND* list 
`a` is non-empty. In practice that's impossible because if `a` is non-empty, it 
would already populate `np` with its elements using the for-loop right above 
the line in question.

So this sounds like the compiler complaining about NULL + 0 which seems 
unnecessary?

By the way, instead of messing with CC, it's preferred to use the 
--with-undefined-behavior-sanitizer option to ./configure.

We could accept Serhiy's change but I'm afraid that without a reliable way to 
reproduce, this will regress at some point.

--

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue44726] Build macOS version with thin lto option

2021-07-23 Thread Dong-hee Na


New submission from Dong-hee Na :

Since the thin-lto option is available for macOS distribution.
We can consider using the thin-lto option for the next macOS Python 
distribution?

--
components: Build, macOS
messages: 398058
nosy: corona10, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Build macOS version with thin lto option
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



[issue44353] PEP 604 NewType

2021-07-23 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue44353] PEP 604 NewType

2021-07-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8f42106b5c362495f72c6ca2fa3884538e4023db by Yurii Karabas in 
branch 'main':
bpo-44353: Fix memory leak introduced by GH-27262 (GH-27305)
https://github.com/python/cpython/commit/8f42106b5c362495f72c6ca2fa3884538e4023db


--

___
Python tracker 

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



[issue44725] Expose specialization stats in python

2021-07-23 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue44611] CPython uses deprecated randomness API

2021-07-23 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue44611] CPython uses deprecated randomness API

2021-07-23 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 906fe47083bc9ab7ed2b70c99c1b0daad021f126 by Dong-hee Na in branch 
'main':
bpo-44611: Use BCryptGenRandom instead of CryptGenRandom on Windows (GH-27168)
https://github.com/python/cpython/commit/906fe47083bc9ab7ed2b70c99c1b0daad021f126


--

___
Python tracker 

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



[issue44725] Expose specialization stats in python

2021-07-23 Thread Irit Katriel


New submission from Irit Katriel :

Make it possible to fetch the current specialization stats in python so that we 
can compute deltas for small code snippets as well as use them for 
specialization unit tests.

--
components: Interpreter Core
messages: 398055
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Expose specialization stats in python
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



[issue42414] unable to document fields of dataclass

2021-07-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I haven't modified `_finddoc` in my PR because it currently doesn't show all 
existing dataclass fields (only those with default set) -- therefore it would 
make sense to consider this addition if / when complete set of dataclass fields 
is added to _finddoc. Also as Terry mentioned, help() may end up using 
inspect.getdoc() in the future.

--

___
Python tracker 

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



[issue44724] Resource Tracker is never reaped

2021-07-23 Thread Viktor Ivanov


New submission from Viktor Ivanov :

The multiprocessing.resource_tracker instance is never reaped, leaving zombie 
processes.

There is a waitpid() call for the ResourceTracker's pid but it is in a private 
method _stop() which seems to be only called from some test modules.

Usually environments have some process handling zombies but if python is the 
"main" process in a container, for example, and runs another python instance 
that does something leaking a ResourceTracker process, zombies start to 
accumulate.

This is easily reproducible with a couple of small python programs as long as 
they are not run from a shell or another parent process that takes care of 
forgotten children.

It was originally discovered in a docker container that has a python program as 
its entry point (celery worker in an airflow container) running other python 
programs (dbt).

The minimal code is available on Github here: 
https://github.com/viktorvia/python-multi-issue

The attached multi.py is leaking resource tracker processes, but just running 
it from a full-fledged development environment will not show the issue.

Instead, run it via another python program from a Docker container:

Dockerfile:
---
FROM python:3.9

WORKDIR /usr/src/multi

COPY . ./

CMD ["python", "main.py"]
---

main.py:
---
from subprocess import run
from time import sleep

while True:
result = run(["python", "multi.py"], capture_output=True)
print(result.stdout.decode('utf-8'))
result = run(["ps", "-ef", "--forest"], capture_output=True)
print(result.stdout.decode('utf-8'), flush=True)
sleep(1)
---

When the program is run it will accumulate 1 zombie on each run:
---
$ docker run -it multi python main.py
[1, 4, 9]

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0 11 11:33 pts/000:00:00 python main.py
root 8 1  0 11:33 pts/000:00:00 [python] 
root17 1  0 11:33 pts/000:00:00 ps -ef --forest

[1, 4, 9]

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0  6 11:33 pts/000:00:00 python main.py
root 8 1  3 11:33 pts/000:00:00 [python] 
root19 1  0 11:33 pts/000:00:00 [python] 
root28 1  0 11:33 pts/000:00:00 ps -ef --forest

[1, 4, 9]

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0  4 11:33 pts/000:00:00 python main.py
root 8 1  1 11:33 pts/000:00:00 [python] 
root19 1  3 11:33 pts/000:00:00 [python] 
root30 1  0 11:33 pts/000:00:00 [python] 
root39 1  0 11:33 pts/000:00:00 ps -ef --forest

[1, 4, 9]

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0  3 11:33 pts/000:00:00 python main.py
root 8 1  1 11:33 pts/000:00:00 [python] 
root19 1  1 11:33 pts/000:00:00 [python] 
root30 1  4 11:33 pts/000:00:00 [python] 
root41 1  0 11:33 pts/000:00:00 [python] 
root50 1  0 11:33 pts/000:00:00 ps -ef --forest
---

Running from a shell script, or just another python program that handles 
SIGCHLD by calling wait() takes care of the zombies.

--
components: Library (Lib)
files: multi.py
messages: 398053
nosy: viktor.ivanov
priority: normal
severity: normal
status: open
title: Resource Tracker is never reaped
type: resource usage
versions: Python 3.7, Python 3.9
Added file: https://bugs.python.org/file50173/multi.py

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 097801844c99ea3916bebe1cc761257ea7083d34 by Miss Islington (bot) 
in branch '3.9':
bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27304)
https://github.com/python/cpython/commit/097801844c99ea3916bebe1cc761257ea7083d34


--

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-23 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset c589992e09d0db7cb47d21d5948929e599fdbb94 by Miss Islington (bot) 
in branch '3.10':
bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27303)
https://github.com/python/cpython/commit/c589992e09d0db7cb47d21d5948929e599fdbb94


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2021-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset a4760cc32d9e5dac7be262e9736eb30502cd7be3 by Petr Viktorin in 
branch 'main':
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG 
no-op (GH-27260)
https://github.com/python/cpython/commit/a4760cc32d9e5dac7be262e9736eb30502cd7be3


--
nosy: +miss-islington

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2021-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25850
pull_request: https://github.com/python/cpython/pull/27306

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-23 Thread Yurii Karabas


Change by Yurii Karabas <1998uri...@gmail.com>:


--
pull_requests: +25849
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/27305

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25848
pull_request: https://github.com/python/cpython/pull/27304

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +25847
pull_request: https://github.com/python/cpython/pull/27303

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c by Anthony Sottile in 
branch 'main':
bpo-29298: Fix crash with required subparsers without dest (GH-3680)
https://github.com/python/cpython/commit/17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c


--

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-07-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

PR27262 introduced reference leaks and currently all refleak buildbots are red:

Example:

https://buildbot.python.org/all/#/builders/205/builds/102/steps/5/logs/stdio

Ran 367 tests in 0.198s
OK (skipped=1)
.
test_typing leaked [220, 220, 220] references, sum=660
test_typing leaked [69, 68, 68] memory blocks, sum=205
1 test failed again:
test_typing
== Tests result: FAILURE then FAILURE ==
Per our buildbot policy, if a fix is not performed in 24 h we will need to 
revert

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



[issue29555] Update Python Software Foundation Copyright Year

2021-07-23 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Yes, closing this.

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



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

2021-07-23 Thread Nick Coghlan


Nick Coghlan  added the comment:

I suspect the only reason the dis CLI isn't documented is because it's been 
around for so long (22 years!) that nobody previously noticed it was missing: 
https://github.com/python/cpython/commit/1fdae12c93246fcf4abbf882ba08df789070dfcc

Folks then either didn't know about it, or already knew how to use it.

Even the migration to use argparse was a code cleanup from a user that happened 
to be reading the module source code and noticed that it didn't already do so: 
https://bugs.python.org/issue18538

I can see value in supporting `-c` and `-m` options to dis to align with the 
main interpreter CLI.

--
nosy: +ncoghlan

___
Python tracker 

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



  1   2   >