[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 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



[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26067
pull_request: https://github.com/python/cpython/pull/27560

___
Python tracker 

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



[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread Ken Jin


New submission from Ken Jin :

I can't seem to find PyMember_GetOne or PyMember_SetOne in C API docs, yet they 
are in stable_abi.txt.

Sending a PR shortly, please tell me if these were accidentally exposed and not 
supposed to be documented (I will close the PR if so).

--
assignee: docs@python
components: Documentation
messages: 398777
nosy: docs@python, kj, petr.viktorin
priority: normal
severity: normal
status: open
title: [docs] Document PyMember_{Get/Set}One in C API reference
versions: Python 3.10, Python 3.11, Python 3.9

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b57011d2a5375bc9f255361dc64c9e6fbc203e0e by Miss Islington (bot) 
in branch '3.9':
bpo-41911: Update docs for various expressions (GH-27470) (GH-27491)
https://github.com/python/cpython/commit/b57011d2a5375bc9f255361dc64c9e6fbc203e0e


--

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 843b3d28209b7754c51c6cc3844f66808b6dbdaf by Miss Islington (bot) 
in branch '3.10':
bpo-41911: Update docs for various expressions (GH-27470) (GH-27490)
https://github.com/python/cpython/commit/843b3d28209b7754c51c6cc3844f66808b6dbdaf


--

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26007
pull_request: https://github.com/python/cpython/pull/27491

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4bd9caafb64589288e5171087070bde726178c58 by andrei kulakov in 
branch 'main':
bpo-41911: Update docs for various expressions (GH-27470)
https://github.com/python/cpython/commit/4bd9caafb64589288e5171087070bde726178c58


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-30 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-07-30 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +25992
pull_request: https://github.com/python/cpython/pull/27473

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-29 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

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

--

___
Python tracker 

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



[issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected

2021-07-29 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 3.0 -> 4.0
pull_requests: +25989
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27470

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

Also, when dataclasses was originally written, it deliberately did not import 
typing, for performance reasons. I don't know if PEP 560 (I think) improved 
performance enough to make a difference. But adding this dependency needs to be 
looked at.

But if we are going to import typing, there are other changes that I'd like to 
make, like improving the ClassVar stuff.

--

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-24 Thread Eric V. Smith

Eric V. Smith  added the comment:

I’m deferring any action on this until PEP 649 is ruled on.

--
assignee:  -> eric.smith

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-24 Thread Misha Drachuk


Change by Misha Drachuk :


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

___
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



[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



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

2021-07-23 Thread santhosh


santhosh  added the comment:

build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 In function `ffi_prep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined 
reference to `ffi_closure_FASTCALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_ 
FASTCALL' can not be used when making a shared object
/usr/bin/ld: final link failed
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 In function `ffi_prep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined 
reference to `ffi_closure_FASTCALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/c//c/types/li bf 
fi/ s 
rc/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_ 
closure_ FAST CALL' can not be used when making a shared object
/usr/bin/ld: final link 
failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 In function `ffi_prep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined 
reference to `ffi_closure_FASTCALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' 
can not be used when making a shared object
/usr/bin/ld: final link 
failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffio:
 In function `ffiprep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ c types/ b f fi/sr c/x86/ffi.c:678: 
undefined reference to ` ff_ closure_ FAST CALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' 
can not be used when making a shared object
/usr/bin/ld: final link 
failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 In function `ffi_prep_closure_loc':
/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined 
reference to `ffi_closure_FASTCALL'
/usr/bin/ld: 
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o:
 relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' 
can not be used when making a shared object
/usr/bin/ld: final link failed

--
nosy: +santhu_reddy12

___
Python tracker 
<https://bugs.python.org/issue33063>
___
___
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-22 Thread Fantix King


Change by Fantix King :


--
nosy: +fantix
nosy_count: 3.0 -> 4.0
pull_requests: +25844
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/8620

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-22 Thread Eric V. Smith

Eric V. Smith  added the comment:

It can’t be resolved in fields(): it is still undefined when the fields are 
created. 

I think the best solution is PEP 649.

--

___
Python tracker 

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



[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg


Anders Kaseorg  added the comment:

> extra_states[o] = ExtraState(obj)

(Typo for extra_states[obj] = ExtraState(obj), obviously.)

--

___
Python tracker 

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



[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg

New submission from Anders Kaseorg :

Because WeakKeyDictionary unconditionally maintains strong references to its 
values, the garbage collector fails to collect a reference cycle from a 
WeakKeyDictionary value to its key.  For example, the following program 
unexpectedly leaks memory:

from weakref import WeakKeyDictionary
class C: pass
d = WeakKeyDictionary()
while True:
c = C()
d[c] = [c]

I would expect a WeakKeyDictionary value to be marked live _if_ its key is 
marked live, not unconditionally.  This could be implemented with garbage 
collector support for ephemerons 
(https://www.researchgate.net/publication/221320677_Ephemerons_A_New_Finalization_Mechanism).

To motivate this issue, a typical use of WeakKeyDictionary is as a hygienic 
replacement for patching extra properties into third-party objects:

# before:
obj._extra_state = ExtraState(obj)
# after:
extra_states = WeakKeyDictionary()
extra_states[o] = ExtraState(obj)

However, such a conversion will introduce this memory leak if ExtraState(obj) 
has any transitive references to obj.

This leak does not occur in JavaScript:

class C {}
const d = new WeakMap();
while (true) {
  const c = new C();
  d[c] = [c];
}

--
components: Library (Lib)
messages: 397841
nosy: andersk
priority: normal
severity: normal
status: open
title: Reference cycles from a WeakKeyDictionary value to its key aren’t 
collected
type: resource usage
versions: Python 3.9

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-07-18 Thread Vincent Bernat


New submission from Vincent Bernat :

asyncio will only keep weak references to alive tasks (in `_all_tasks`). If a 
user does not keep a reference to a task and the task is not currently 
executing or sleeping, the user may get "Task was destroyed but it is pending!".

I would suggest adding the following paragraph to `create_task()` documentation:

Python only keeps weak references to the scheduled tasks. To avoid the task 
being destroyed by the garbage collector while still pending, a reference to it 
should be kept until the task is done.

And maybe an example in case a user wants something "fire and forget"?

```python
running_tasks = set()
# [...]
task = asyncio.create_task(some_background_function())
running_tasks.add(task)
task.add_done_callback(lambda t: running_tasks.remove(t))
```

The same applies to ensure_future as it now uses create_task, so maybe a "See 
create_task()".

--
assignee: docs@python
components: Documentation
messages: 397741
nosy: bernat, docs@python
priority: normal
severity: normal
status: open
title: asyncio.create_task() documentation should mention user needs to keep 
reference to the task
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-06 Thread Paolo Lammens


Paolo Lammens  added the comment:

I was about to create the exact same ticket; I'm nudging this.

--
nosy: +plammens

___
Python tracker 

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



[issue7464] circular reference in HTTPResponse by urllib2

2021-06-18 Thread Irit Katriel


Irit Katriel  added the comment:

> It doesn't appear to be an issue in py3k.

I agree, I can't find this code anywhere. Closing.

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

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

Fix in the main branch:

commit c10c2ec7a0e06975e8010c56c9c3270f8ea322ec
Author: Antoine Pitrou 
Date:   Fri May 14 21:37:20 2021 +0200

bpo-37788: Fix reference leak when Thread is never joined (GH-26103)



When a Thread is not joined after it has stopped, its lock may remain in 
the _shutdown_locks set until interpreter shutdown.  If many threads are 
created this way, the _shutdown_locks set could therefore grow endlessly.  To 
avoid such a situation, purge expired locks each time a new one is added or 
removed.

--

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-24 Thread Filipe Laíns

Filipe Laíns  added the comment:

s/holder/older/

Sorry, my dyslexia is acting up.

--

___
Python tracker 

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-24 Thread Filipe Laíns

Filipe Laíns  added the comment:

The annotations will effectively become strings, instead of object references, 
in Python 3.11, which solves this issue.

You can enable this behavior in holder Python version with `from __future__ 
import annotations`, see PEP 563[1].

>>> class Base:
... _sub: list[Sub]
...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in Base
NameError: name 'Sub' is not defined


>>> from __future__ import annotations
>>> class Base:
... _sub: list[Sub]
...
>>> class Sub:
... _parent: Base
...
>>>

[1] https://www.python.org/dev/peps/pep-0563/

--
nosy: +FFY00

___
Python tracker 

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

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



[issue44192] Annotations, Inheritance and Circular Reference

2021-05-20 Thread ReOb


New submission from ReOb :

Basically, I have:

```
class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

What creates a circular reference.

It could be solved doing:

```
class Sub:
pass

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

But in the annotation, I will get the class Sub without his annotations, 
methods and properties (the first definition is not updated in annotation after 
the redefinition).

Then, I suggest one of three possible solutions:

1. Update the reference to class in annotations if the class was redefined
2. Add a way to forward declaration (it could be implemented by a new reserved 
word "forward")
3. Or, like Ruby, make that the redefinition of a class, open the class to 
change the definition of class, including new methods, properties and 
annotations.

It is very important to have the correct type in annotation, because we use 
this type to create new objects dinamically, but actually is impossible to 
solve this problem because we can not have the correct definition at both 
classes: Base and Sub class.

When we use the type annotated to create a new object, as it is, we loose the 
annotations, methods and properties defined at the redefinition of the class.

This problem occurs only if we use annotations.

Like Python added the possibility to define annotations, needs to provide one 
of these solutions pointed (or another) to solve problems like this.

If the decision was to implement a forward reserved word, it could be solved 
doing:

```
class Sub:
forward

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

If the first or third solution was preferred this code will work:

```
class Sub:
pass

class Base:
_sub: list[Sub]

class Sub:
_parent: Base
```

I hope Python could implement one of these solutions to provide a better 
support for annotations, because actually what we have are two classes, with 
the same name, that walks like a duck, swim like a duck, sound like a duck but 
they are not the same duck, and they should be.

The framework that we are developping depends strongly that we could get the 
correct type from annotation to create the correct object based on this.

I hope it could be handled as soon as possible, because change the definition 
to another class that was a super class of both classes (Base and Sub, in this 
example) will not permit us to know the correct class to create another object 
dinamically and probabily we will need to create a hack to handle this, making 
the code less Pythonic.

Thanks.

--
components: Parser
messages: 394038
nosy: lys.nikolaou, pablogsal, reob-info
priority: normal
severity: normal
status: open
title: Annotations, Inheritance and Circular Reference
type: resource usage
versions: Python 3.9

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset b30b25b26663fb6070b8ed86fe3a20dcb557d05d by Antoine Pitrou in 
branch '3.9':
[3.9] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) 
(GH-26142)
https://github.com/python/cpython/commit/b30b25b26663fb6070b8ed86fe3a20dcb557d05d


--

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 71dca6ea73aaf215fafa094512e8c748248c16b0 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) 
(GH-26138)
https://github.com/python/cpython/commit/71dca6ea73aaf215fafa094512e8c748248c16b0


--

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +24777
pull_request: https://github.com/python/cpython/pull/26142

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
versions:  -Python 3.8

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 14.0 -> 15.0
pull_requests: +24772
pull_request: https://github.com/python/cpython/pull/26138

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-13 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +pitrou
nosy_count: 13.0 -> 14.0
pull_requests: +24745
pull_request: https://github.com/python/cpython/pull/26103

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-13 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-04-26 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I retired the backporting request. Thanks, Ned.

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-11 Thread hai shi


hai shi  added the comment:

I created PR 25226. It's a another way to solve this problem.
Compared to PR 15175, `_set_sentinel()` don't need to receive any params :)

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-06 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991
nosy_count: 12.0 -> 13.0
pull_requests: +23963
pull_request: https://github.com/python/cpython/pull/25226

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-03 Thread Martin Panter


Martin Panter  added the comment:

Anselm's pull request PR 15175 looked hopeful to me. I've been using those 
changes in our builds at work for a while.

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-02 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 11.0 -> 12.0
pull_requests: +23895
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25148

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the bug report.

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

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset d104a786fff5980360056d908a2d952b42306171 by Miss Islington (bot) 
in branch '3.9':
bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (GH-25123) (#25140)
https://github.com/python/cpython/commit/d104a786fff5980360056d908a2d952b42306171


--

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e689cdca3c14aab8d2d454b79ddd661b238fd301 by Zackery Spytz in 
branch 'master':
bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (#25123)
https://github.com/python/cpython/commit/e689cdca3c14aab8d2d454b79ddd661b238fd301


--

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-03-31 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +23870
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25123

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-03-31 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think it's PyMethod_Type.

--
nosy: +eric.smith, rhettinger

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-03-31 Thread Daniel Torres


Change by Daniel Torres :


--
title: Descriptor Documentation - Reference to Py_MethodType is not up to date 
-> Descriptor.rst - Reference to Py_MethodType is not up to date

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



[issue43677] Descriptor Documentation - Reference to Py_MethodType is not up to date

2021-03-31 Thread Daniel Torres


Change by Daniel Torres :


--
title: Documentation -> Descriptor Documentation - Reference to Py_MethodType 
is not up to date

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Ned Deily


Ned Deily  added the comment:

"Those releases are in their"

--

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Ned Deily


Ned Deily  added the comment:

@jcea, I see you have created backports for 3.7 and 3.6 as well. Those release 
as in their security-fix-only phase of their life cycles. This doesn't seem 
like a security issue but am I missing something?

--
nosy: +ned.deily

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset d914813a7a9cee3b42e9c91f91ac491f3bbfe118 by Miss Islington (bot) 
in branch '3.9':
bpo-35930: Raising an exception raised in a "future" instance will create 
reference cycles (GH-24995) (#25070)
https://github.com/python/cpython/commit/d914813a7a9cee3b42e9c91f91ac491f3bbfe118


--

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset dae1963cf38f730291126b7dadfda89ffb21cefd by Miss Islington (bot) 
in branch '3.8':
bpo-35930: Raising an exception raised in a "future" instance will create 
reference cycles (GH-24995) (#25071)
https://github.com/python/cpython/commit/dae1963cf38f730291126b7dadfda89ffb21cefd


--

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23821
pull_request: https://github.com/python/cpython/pull/25071

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23823
pull_request: https://github.com/python/cpython/pull/25073

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset 32430aadadf6e012e39167d3c18a24e49fb84874 by Jesús Cea in branch 
'master':
bpo-35930: Raising an exception raised in a "future" instance will create 
reference cycles (#24995)
https://github.com/python/cpython/commit/32430aadadf6e012e39167d3c18a24e49fb84874


--

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +23820
pull_request: https://github.com/python/cpython/pull/25070

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23822
pull_request: https://github.com/python/cpython/pull/25072

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-29 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

No. The issue remains open.

--
stage:  -> needs patch
versions:  -Python 3.7

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-29 Thread Zhipeng Xie


Zhipeng Xie <775350...@qq.com> added the comment:

ping

I also encountered this problem. Is there a fix now?

--
nosy: +Zhipeng Xie

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-23 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-23 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
assignee:  -> jcea

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2021-03-23 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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

___
Python tracker 

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



[issue14189] C API documentation must document if returned object is a borrowed reference or strong reference

2021-03-21 Thread Irit Katriel


Irit Katriel  added the comment:

This was fixed for all the functions listed by the OP, except a few that no 
longer exist AFAICT:

Doc/c-api/import.rst:  _PyImport_FindExtension
Doc/c-api/import.rst:  _PyImport_FixupExtension
Doc/c-api/init.rst:  PyEval_GetCallStats
Doc/c-api/int.rst:  PyInt_FromSize_t

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



[issue43533] Exception and contextmanager in __getattr__ causes reference cycle

2021-03-17 Thread Ran Chen


New submission from Ran Chen :

If __getattr__ raises exception within a contextlib.context_manager, it creates 
a reference cycle and prevents the frame from being garbage collected. This 
only happens if the exception is raised inside a context manager inside 
__getattr__. It doesn't happen if there's no context manager.

Repro:

```
import contextlib
import gc

@contextlib.contextmanager
def ct():
  yield


class A(object):

  def __getattr__(self, name):
with ct():
  raise AttributeError()
  


def f():
  a = A()
  hasattr(a, 'notexist')


gc.set_debug(gc.DEBUG_LEAK)
f()
gc.collect()
```

It also doesn't happen if we catch the exception outside of the context manager 
and re-raise it:

```
  def __getattr__(self, name):
try:
  with ct():
raise AttributeError()
except:
  raise
```

--
components: Library (Lib)
messages: 388977
nosy: crccw
priority: normal
severity: normal
status: open
title: Exception and contextmanager in __getattr__ causes reference cycle
type: behavior
versions: Python 3.6

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



[issue40255] Fixing Copy on Writes from reference counting

2021-03-15 Thread Eric Snow


Eric Snow  added the comment:

While the eventual solution may overlap, my interests are divergent enough from 
those here that I've created a separate issue: bpo-43503.

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I'm confused. This issue is about the threading module, whereas bpo-37193 
is unrelated: it's about the socketserver module.

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

Re-opening; I believe this issue is still valid.

Here's output on a debug build on current master (commit 
7591d9455eb37525c832da3d65e1a7b3e6dbf613) on my machine:

lovelace:cpython mdickinson$ ./python.exe
Python 3.10.0a6+ (remotes/upstream/master:7591d9455e, Mar 13 2021, 12:04:31) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, threading, time
>>> for _ in range(10):
... threading.Thread().start()
... time.sleep(0.1)
... print(sys.gettotalrefcount())
... 
109901
109905
109907
109909
109911
109913
109915
109917
109919
109921

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

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Victor: How does the fix for #37193 solve this issue? I think I'm missing 
something.

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-37193 has been fixed.

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



[issue40255] Fixing Copy on Writes from reference counting

2021-03-11 Thread Eric Snow


Eric Snow  added the comment:

Note that my PR does make the builtin types immortal (at least those 
initialized in _PyTypes_Init()).  However, I did not make the singletons or 
other candidate objects immortal in the PR.  That can be done separately.

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2021-03-11 Thread Eric Snow


Eric Snow  added the comment:

FYI, I've just put up a similar PR [1] to Eddie's, with a focus on object 
immortality rather than immutability.  However, if Py_IMMORTAL_CONST_REFCOUNTS 
is defined then it should have the behavior Eddie is after.

[1] https://github.com/python/cpython/pull/24828

--

___
Python tracker 

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



[issue40255] Fixing Copy on Writes from reference counting

2021-03-11 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow
nosy_count: 15.0 -> 16.0
pull_requests: +23592
pull_request: https://github.com/python/cpython/pull/24828

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-03-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43327] The docs falsely state that PyImport_ImportFrozenModuleObject() returns a new reference

2021-02-26 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue43327] The docs falsely state that PyImport_ImportFrozenModuleObject() returns a new reference

2021-02-26 Thread Zackery Spytz


New submission from Zackery Spytz :

The docs state that PyImport_ImportFrozenModuleObject() returns a new reference,
but it actually returns an int.

https://docs.python.org/3.10/c-api/import.html#c.PyImport_ImportFrozenModuleObject

--
assignee: docs@python
components: Documentation
messages: 387716
nosy: ZackerySpytz, docs@python
priority: normal
severity: normal
status: open
title: The docs falsely state that PyImport_ImportFrozenModuleObject() returns 
a new reference
versions: Python 3.10, Python 3.8, Python 3.9

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-01-27 Thread Martin Panter


Change by Martin Panter :


--
keywords: +3.7regression

___
Python tracker 

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



[issue42824] get_type_hints throws for local class reference

2021-01-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

This is a known limitation. To get this to work you have to pass globals() and 
locals():

typing.get_type_hints(Test, globals(), locals())

--
nosy: +gvanrossum
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42824] get_type_hints throws for local class reference

2021-01-04 Thread Fabian.M


New submission from Fabian.M :

The following code throws with "NameError: name 'Nested' is not defined".

For reference, it works well when moving class definitions out of the local 
scope.


import typing
T = typing.TypeVar('T')

def test():
class Nested(typing.Generic[T]):
pass

class Test(typing.Generic[T]):
  nested: Nested[T]

typing.get_type_hints(Test) # this throws

test()

--
components: Library (Lib)
messages: 384332
nosy: Fabian.M
priority: normal
severity: normal
status: open
title: get_type_hints throws for local class reference
type: behavior
versions: Python 3.9

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2020-12-15 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2020-12-15 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Even more reproductible case, now 100%:

"""
import gc
import concurrent.futures
executor = concurrent.futures.ThreadPoolExecutor(999)

def a():
  1/0

future=executor.submit(a)
future.result()
# An exception is raised here. That is normal
del future  # Variable vanish, but data is still there because the cycle
1/0  # Raises another exception drop references to the future one
gc.set_debug(gc.DEBUG_SAVEALL)
gc.collect()
gc.garbage
"""

--

___
Python tracker 

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



[issue35930] Raising an exception raised in a "future" instance will create reference cycles

2020-12-15 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

The corrected test case in the terminal: (a "del" was missing)

"""
import gc
import concurrent.futures
executor = concurrent.futures.ThreadPoolExecutor(999)

def a():
  1/0

future=executor.submit(a)
future.result()
# An exception is raised here. That is normal
del future  # Variable vanish, but data is still there because the cycle
gc.set_debug(gc.DEBUG_SAVEALL)
gc.collect()
gc.garbage
"""

--

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-12-04 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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-12-04 Thread miss-islington


miss-islington  added the comment:


New changeset 40b92f1cc06f9aaba813ae38266f424e0969b089 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-42482: remove reference to exc_traceback from TracebackException 
(GH-23531) (GH-23578)
https://github.com/python/cpython/commit/40b92f1cc06f9aaba813ae38266f424e0969b089


--

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



[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8b6c4a921af6d5d0a9640211ac93d7886a55a8f3 by Victor Stinner in 
branch 'master':
bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626)
https://github.com/python/cpython/commit/8b6c4a921af6d5d0a9640211ac93d7886a55a8f3


--

___
Python tracker 

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



[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22494
pull_request: https://github.com/python/cpython/pull/23626

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-12-01 Thread miss-islington


miss-islington  added the comment:


New changeset 4a44f53aa85c9400471ab084bc8fd8169065fc41 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-17852: Doc: Fix the tutorial about closing files (GH-23135) (GH-23527)
https://github.com/python/cpython/commit/4a44f53aa85c9400471ab084bc8fd8169065fc41


--

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-30 Thread miss-islington


miss-islington  added the comment:


New changeset 1cc5c943c007b92116f06b3ec8e71f2a510d1898 by Miss Islington (bot) 
in branch '3.8':
bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)
https://github.com/python/cpython/commit/1cc5c943c007b92116f06b3ec8e71f2a510d1898


--

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-30 Thread miss-islington


miss-islington  added the comment:


New changeset 427613f005f0f412d12f0d775d2b609bae0ae1ad by Irit Katriel in 
branch 'master':
bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)
https://github.com/python/cpython/commit/427613f005f0f412d12f0d775d2b609bae0ae1ad


--

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22458
pull_request: https://github.com/python/cpython/pull/23579

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-30 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Re-adding older versions.

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

I've added the refcount check that Victor suggested.

--

___
Python tracker 

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

I consider PR 23531 change as a bugfix and IMO it's fine to backport it.

TracebackException docstring is quite explicit:

The traceback module captures enough attributes from the original exception
to this intermediary form to ensure that no references are held, while
still being able to fully print or format it.

This issue shows that there was a bug in the implementation.

--

The unit test should check the ref count of the exception and the exception 
traceback, to check functionally that no strong reference is hold.

--

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



<    1   2   3   4   5   6   7   8   9   10   >