[issue36737] Warnings operate out of global runtime state.

2020-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Subinterpreters -Interpreter Core

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-05-10 Thread Eric Snow


Eric Snow  added the comment:


New changeset 86ea58149c3e83f402cecd17e6a536865fb06ce1 by Eric Snow in branch 
'master':
bpo-36737: Use the module state C-API for warnings. (gh-13159)
https://github.com/python/cpython/commit/86ea58149c3e83f402cecd17e6a536865fb06ce1


--

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-05-10 Thread Eric Snow


Change by Eric Snow :


--
assignee:  -> eric.snow
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



[issue36737] Warnings operate out of global runtime state.

2019-05-07 Thread Eric Snow


Change by Eric Snow :


--
keywords: +patch
pull_requests: +13078
stage: needs patch -> patch review

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-04-27 Thread Eric Snow


Eric Snow  added the comment:

Good point.

Also, the whole idea of inheriting things (settings, some copied objects, etc.) 
into subinterpreters is interesting.  My initial reaction is that folks would 
appreciate that feature, at least for a handful of things.  It's not critical, 
but is worth adding to the list of deferred ideas in PEP 554. :)

--

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-04-27 Thread Steve Dower


Steve Dower  added the comment:

> I could also see use cases for *also* configuring warnings process-wide but 
> that could be handled separately if actually desired.

Beyond "warning configuration is inherited by new interpreters", I don't see 
any reason to have process wide configuration. People using Python directly 
will get "process" wide from runtime configuration, and embedders don't want 
anything implicitly process-wide at all.

--

___
Python tracker 

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



[issue36737] Warnings operate out of global runtime state.

2019-04-27 Thread Eric Snow


New submission from Eric Snow :

(See Include/internal/pycore_warnings.h and Python/_warnings.c.)

The warnings module's state (filters, default action, etc.) is currently stored 
at the level of the global runtime.  That's a problem for the following reasons:

* Python objects are getting stored in _PyRuntimeState
* it breaks the isolation of behavior between interpreters
* objects are leaking between interpreters
* importing the module in a subinterpreter effectively resets the module's state

While those are all a problem in a future where interpreters don't share the 
GIL, that last one is a problem right now for people using subinterpreters.

One of the following should happen:

* move warnings state down to PyInterpreterState
* move warnings state into PyInterpreterState.dict
* use the module-state API (PEP 3121)
* just work out of the module's __dict__

I could also see use cases for *also* configuring warnings process-wide but 
that could be handled separately if actually desired.

--
components: Interpreter Core
messages: 340951
nosy: brett.cannon, eric.snow, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Warnings operate out of global runtime state.
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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