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

2020-09-10 Thread Yury Selivanov


Yury Selivanov  added the comment:

Big +1 from me. This is something I always wanted to do myself (since the time 
of PEP 492 & 525 implementations) and I think this is a necessary change. It's 
great that this isn't just a C API UX improvement but also yields a big perf 
improvement.

--
nosy: +Mark.Shannon, lukasz.langa, vstinner

___
Python tracker 

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



[issue41757] weakmethod's ref is deleted before weakref's garbage-collect callback is executed

2020-09-10 Thread Giordon Stark


Giordon Stark  added the comment:

This PR seems highly related: https://github.com/python/cpython/pull/18189. Not 
sure if it should be linked to this issue or not.

--

___
Python tracker 

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



[issue41757] weakmethod's ref is deleted before weakref's garbage-collect callback is executed

2020-09-10 Thread Giordon Stark


New submission from Giordon Stark :

Hi, this is my first issue, so I hope to try my best to explain the problem. 
Unfortunately, I cannot get an easy minimum-reproducible-example of this 
because I can only seem to invoke this behavior using pytest (6.0.1) on two 
tests of our code. First, let me explain the issue.

AttributeError: 'NoneType' object has no attribute '_alive'
Exception ignored in: ._cb at 0x1696c2a70>
Traceback (most recent call last):
  File "/Users/kratsg/.virtualenvs/pyhf-dev/lib/python3.7/weakref.py", line 55, 
in _cb
if self._alive:

occurs sometimes. Not always (feels like a race condition) and occurs after 
pytest has finished, which indicates it must be hitting garbage-collect. The 
backtrace isn't as helpful as it seems to jump from our code straight to the 
callback (indicating a garbage-collect):

/Users/kratsg/pyhf/tests/test_validation.py(1082)test_optimizer_stitching()
-> pdf = pyhf.simplemodels.hepdata_like([50.0], [100.0], [10])
  /Users/kratsg/pyhf/src/pyhf/simplemodels.py(64)hepdata_like()
-> return Model(spec, batch_size=batch_size)
  /Users/kratsg/pyhf/src/pyhf/pdf.py(590)__init__()
-> config=self.config, batch_size=self.batch_size
  /Users/kratsg/pyhf/src/pyhf/pdf.py(339)__init__()
-> self.config.auxdata_order,
  /Users/kratsg/pyhf/src/pyhf/parameters/paramview.py(66)__init__()
-> self._precompute()
  /Users/kratsg/pyhf/src/pyhf/parameters/paramview.py(78)_precompute()
-> self.allpar_viewer, self.selected_viewer, self.all_indices
  /Users/kratsg/pyhf/src/pyhf/parameters/paramview.py(27)extract_index_access()
-> index_selection = baseviewer.split(indices, selection=subviewer.names)
  /Users/kratsg/pyhf/src/pyhf/tensor/common.py(59)split()
-> data = tensorlib.einsum('...j->j...', tensorlib.astensor(data))
  /Users/kratsg/pyhf/src/pyhf/tensor/numpy_backend.py(268)einsum()
-> return np.einsum(subscripts, *operands)
  <__array_function__ internals>(6)einsum()
> /Users/kratsg/.virtualenvs/pyhf-dev/lib/python3.7/weakref.py(56)_cb()
-> if self._alive:

Essentially, inside weakref.py's _cb(), I tried to figure out what "self" was:

(Pdb) self
(Pdb) !arg


and it seems like the evaluation of "self._alive" is doomed to fail as self is 
None. So meth comes in, we take it apart into obj and func, define an inner 
function _cb that closes over a weakref to a weakref to obj and registers that 
function to fire when the underlying object gets gc'd. However, there seems to 
be an assumption that "self" is not None by the time the callback is fired.

---

Steps to reproduce:

Clone: https://github.com/scikit-hep/pyhf
Set up virtual env/install: python3 -m pip install -e .[complete]
Run pytest: pytest tests/test_validation.py - -k 
"test_optimizer_stitching[scipy-numpy or test_optimizer_stitching[minuit-numpy" 
-s

--
components: macOS
messages: 376699
nosy: kratsg, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: weakmethod's ref is deleted before weakref's garbage-collect callback is 
executed
type: behavior
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



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

2020-09-10 Thread Vladimir Matveev


Change by Vladimir Matveev :


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

___
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

2020-09-10 Thread Vladimir Matveev


New submission from Vladimir Matveev :

Currently async functions are more expensive to use comparing to their sync 
counterparts. A simple microbenchmark shows that difference could be quite 
significant:
```
import time

def f(a):
if a == 0:
return 0
return f(a - 1)

async def g(a):
if a == 0:
return 0
return await g(a - 1)

N = 10
C = 200

t0 = time.time()
for _ in range(N):
f(C)
t1 = time.time()
for _ in range(N):
try:
g(C).send(None)
except StopIteration:
pass
t2 = time.time()

print(f"Sync functions: {t1 - t0} s")
print(f"Coroutines: {t2 - t1} s")
```
Results from master on my machine:

Sync functions: 2.8642687797546387 s
Coroutines: 9.172159910202026 s

NOTE: Due to viral nature of async functions their number in codebase could 
become quite significant so having hundreds of them in a single call stack is 
not something uncommon.

One of reasons of such performance gap is that async functions always return 
its results via raising StopIteration exception which is not cheap. This can be 
avoided if in addition to `_PyGen_Send` always return result via exception we 
could have another function that will allow us to distinguish whether value 
that was returned from generator is a final result (return case) of whether 
this is yielded value.
In linked PR I've added function `_PyGen_SendNoStopIteration` with this 
behavior and updated ceval.c and _asynciomodule.c to use it instead of 
`_PyGen_Send` which resulted in a measurable difference:

Sync functions: 2.8861589431762695 s
Coroutines: 5.730362176895142 s

--
messages: 376698
nosy: v2m, yselivanov
priority: normal
severity: normal
status: open
title: Do not always use exceptions to return result from coroutine
type: performance
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



[issue41744] NuGet python.props only works in python nuget, not other variants

2020-09-10 Thread Steve Dower


Steve Dower  added the comment:

Thanks! Just need a NEWS file (click Details next to the failed check for the 
helper app). Something like "Fixes automatic import of props file when using 
the Nuget package" would be good.

(Also posted on the PR)

--

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-10 Thread Steve Dower


Steve Dower  added the comment:

We'd CreateFile the file and then immediately pass it to _open_osfhandle, which 
would keep the semantics the same apart from the share flags.

I'm not entirely against getting rid of O_TEXT support, but haven't taken the 
time to think through the implications.

--

___
Python tracker 

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



[issue41755] Docs: Please remove `from distutils.core import setup`

2020-09-10 Thread Thomas Guettler


New submission from Thomas Guettler :

Please remove this page or at least the code snippet 
containing `from distutils.core import setup`
on this page: https://docs.python.org/3/distutils/setupscript.html

There is the more up to date doc here: 
https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

Quoting Zen o Py: There should be one-- and preferably only one --obvious way 
to do it.

Thank you very much!

--
messages: 376695
nosy: guettli
priority: normal
severity: normal
status: open
title: Docs: Please remove `from distutils.core import setup`

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The tkdocs pages load in less than a second rather than in several seconds, 
have the obsolete link lined out, and include a short explanatory note.  So I 
made the replacement.

Ned, please backport to 3.7 and 3.6 if still built nightly.

--
resolution:  -> fixed
stage: patch review -> resolved
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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 8a30bdd21dff6d1957df135c9d0b9983a0f61228 by Miss Islington (bot) 
in branch '3.8':
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188) 
(#22193)
https://github.com/python/cpython/commit/8a30bdd21dff6d1957df135c9d0b9983a0f61228


--

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread miss-islington


miss-islington  added the comment:


New changeset 1b4bdb4cd71df6339da3f247516e0c642f40c37e by Miss Islington (bot) 
in branch '3.9':
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188)
https://github.com/python/cpython/commit/1b4bdb4cd71df6339da3f247516e0c642f40c37e


--

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21254
pull_request: https://github.com/python/cpython/pull/22193

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21253
pull_request: https://github.com/python/cpython/pull/22192

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 06d0b8b67e8aebd8fe4c34e97d6915c11f4afa30 by Mark Roseman in 
branch 'master':
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188)
https://github.com/python/cpython/commit/06d0b8b67e8aebd8fe4c34e97d6915c11f4afa30


--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-10 Thread Skip Montanaro


Skip Montanaro  added the comment:

@Vladyslav.Bondar I can't tell where you are suggesting MinProtocol should be 
set. I don't see that particular string in any .c, .h or .py file in the Python 
source.

--

___
Python tracker 

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



[issue17254] add thai encoding aliases to encodings.aliases

2020-09-10 Thread Benjamin Wood


Benjamin Wood  added the comment:

Bumping this again.

I'd like to try and understand why this change can not or has not been approved.

I added the technical info here to the github PR.

Is there a shortage of reviewers? What can I do to help speed up the process?

--

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-10 Thread pmp-p


Change by pmp-p :


--
pull_requests: +21251
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22190

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-10 Thread Vladyslav Bondar


Vladyslav Bondar  added the comment:

This will help to solve it

https://stackoverflow.com/questions/61568215/openssl-v1-1-1-ubuntu-20-tlsv1-no-protocols-available

But in my case I've defined:
MinProtocol = None

--
nosy: +Vladyslav.Bondar

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-10 Thread pmp-p


Change by pmp-p :


--
versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9 -Python 2.6, Python 
2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-10 Thread Mark Roseman


Change by Mark Roseman :


--
nosy: +markroseman

___
Python tracker 

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



[issue41052] Opt out serialization/deserialization for heap type

2020-09-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +21250
pull_request: https://github.com/python/cpython/pull/22189

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-09-10 Thread Mark Roseman


Change by Mark Roseman :


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

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-09-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f76d894dc5d5facce1a6c1b71637f6a2b3f9fd2b by Mohamed Koubaa in 
branch 'master':
bpo-1635741: Port cmath to multi-phase init (PEP 489) (GH-22165)
https://github.com/python/cpython/commit/f76d894dc5d5facce1a6c1b71637f6a2b3f9fd2b


--

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

About subinterpreters. In Python 3.8, _ast.AST type is a static type:

static PyTypeObject AST_type = {...};

In Python 3.9, it's now a heap type:

static PyType_Spec AST_type_spec = {...};
state->AST_type = PyType_FromSpec(_type_spec);

In Python 3.8, the same _ast.AST type was shared by all interpreters. With my 
PR 21961, the _ast.AST type is a heap type but it is also shared by all 
interpreters.

Compared to Python 3.8, PR 21961 has no regression related to subinterpreters. 
It's not better nor worse. The minor benefit is that _ast.AST is cleared at 
Python exit (see _PyAST_Fini()).

While I would be nice to make _ast.AST per interpreter, it would be an 
*enhancement*. I consider that it can wait for Python 3.10.

--

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-09-10 Thread mohamed koubaa


mohamed koubaa  added the comment:

Something like this?

```
static PyObject *def;

PyMODINIT_FUNC
PyInit_mymod(void)
{
if (def == NULL) {
   def = PyModuleDef_Init();
}
return def;
}
```

Then add a flag to PyModuleDef to indicate it is already exec?

--

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-10 Thread Eryk Sun


Eryk Sun  added the comment:

> we'd have to reimplement the UCRT function using the system API. 

Could the implementation drop support for os.O_TEXT? I think Python 3 should 
have removed both os.O_TEXT and os.O_BINARY. 3.x has no need for the C 
runtime's ANSI text mode, with its Ctrl+Z behavior inherited from MS-DOS. I'd 
prefer that os.open always used _O_BINARY and raised a ValueError if passed any 
of the C runtime's text modes, including _O_TEXT, _O_WTEXT, _O_U16TEXT, and 
_O_U8TEXT.

If _O_TEXT is supported, then we have to copy the C runtime's behavior, which 
truncates a Ctrl+Z from the end of the file if it's opened with read-write 
access. If Unicode text modes are supported, then we have to read the BOM, 
which can involve opening the file twice if the caller doesn't request read 
access.

--

___
Python tracker 

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



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-10 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Interpreter Core -Argument Clinic
nosy:  -larry

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread wyz23x2


wyz23x2  added the comment:

Can any core reviewer review the PR?

--

___
Python tracker 

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



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-10 Thread chen-y0y0


chen-y0y0  added the comment:

Yep.

--

___
Python tracker 

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



[issue19521] Parallel build race condition on AIX since python-2.7

2020-09-10 Thread Stefan Krah


Stefan Krah  added the comment:

I have been asked to backport this to 3.8. There's a very small window
of opportunity:

3.8.6: Monday, 2020-09-21
3.8.7rc1: Monday, 2020-11-02
3.8.7: Monday, 2020-11-16 (final version!)


Backporting procedures since 3.8 are unclear and a source of
constant friction, so most core developers seem to have stopped
doing any backports at all.  It is not a battle I'll choose, but
if you get a second core dev to review this trivial patch I'll
commit it.

There's a simple solution for 3.8: Do not use the parallel build,
the regular build takes around 4 min.


For the buildbots you can ask the operator for a custom command
line.

--
status: closed -> open

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests:  -21248

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests: +21248
pull_request: https://github.com/python/cpython/pull/22186

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests:  -21247

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread wyz23x2


wyz23x2  added the comment:

All tests have passed. Now it's time to merge!

--

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread wyz23x2


wyz23x2  added the comment:

@epaine The doc (https://docs.python.org/3/library/tkinter.tix.html) states 
"This Tk extension is unmaintained and should not be used in new code.".

--

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests: +21247
pull_request: https://github.com/python/cpython/pull/22186

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests:  -21245

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


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

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-09-10 Thread wyz23x2


Change by wyz23x2 :


--
keywords: +patch
nosy: +wyz23x2
nosy_count: 6.0 -> 7.0
pull_requests: +21245
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22186

___
Python tracker 

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



[issue41744] NuGet python.props only works in python nuget, not other variants

2020-09-10 Thread Vaclav Slavik


Vaclav Slavik  added the comment:

Thank you, I didn't consider that situation. I forced-pushed an update to the 
PR now. 

I opted for duplicate file rather than including, because I think it imposes 
the least maintenance burden on keeping compatibility: the other alternative 
would mean
- one more file
- either a more complicated logic or the primary file including the compat one 
(so "normal" path slightly more convoluted)
- tiny, but not 100% trivial difference between python nuget and the other ones.

--

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread E. Paine


E. Paine  added the comment:

As I believe planning for removal (including the version this should occur in) 
is better suited to #31371, I think it would be best to remain non-committal 
about the version. I would personally prefer something a little more vague 
(such as below), though as I keep saying, this is just my opinion.

DeprecationWarning: the tkinter.tix module is deprecated in favour of 
tkinter.ttk and is set to be removed in the near-future

It *may* also be nice to clarify in the docs why Tix is deprecated (i.e. 
unmaintained), though I will leave this (like the deprecation message) at your 
discretion.

--

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

One option is to get the behavior before multi-phase initialization. We store 
extensions in a list. Once it's load, it cannot be unloaded before we exit 
Python. See _PyState_AddModule() and _PyState_AddModule().

Calling PyInit_xxx() the second time would simply return the existing module 
object.

When we exit Python, the clear and/or free function of the module is called.

--

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-10 Thread wyz23x2


wyz23x2  added the comment:

OK. What should the message be? "tkinter.tix is deprecated (and will be removed 
in Python 3.x), use tkinter.ttk instead"?

--

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-09-10 Thread Dong-hee Na


Dong-hee Na  added the comment:

One of my opinions is that

Since module object supports detecting error during Py_mod_exec,
The only thing we have to do is return -1 when the module has already existed.

we should define new exception type and don't have to define new slots.
The pros of this method is that we don't have to modify module object and no 
needs to write the new PEP

but the cons of this method is that we should promise the standard exception 
when try to create multiple instances which is not allowed.

ref: 
https://github.com/python/cpython/blob/788b79fa7b6184221e68d4f1a3fbe0b3270693f6/Objects/moduleobject.c#L399

On the other side, defining a Py_mod_exec_once that supports execution for just 
once can be a way.
Although the usage is little, it will be fine because the use case will exist.

Please point out what I missed :)

--

___
Python tracker 

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



[issue40288] [subinterpreters] atexit module should not be loaded more than once per interpreter

2020-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

I would prefer a more generic solution, if possible:

> bpo-40600: "Add an option to disallow creating more than one instance of a 
> module".

--

___
Python tracker 

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



[issue41754] Webbrowser Module Cannot Find xdg-settings on OSX

2020-09-10 Thread Tony DiLoreto


New submission from Tony DiLoreto :

The following code does not work on many OSX installations of Python via 
homebrew:

>>> import webbrowser
>>> webbrowser.open("http://www.google.com;)

And throws the following error stack trace:

  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/webbrowser.py",
 line 26, in register
register_standard_browsers()
  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/webbrowser.py",
 line 551, in register_standard_browsers
raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
 line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
 line 489, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
 line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File 
"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py",
 line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'xdg-settings'



The only workaround right now is to modify webbrowser.py via the instructions 
here: https://github.com/jupyter/notebook/issues/3746#issuecomment-489259515.

Thank you for resolving.

--
components: Library (Lib), macOS
messages: 376672
nosy: ned.deily, ronaldoussoren, tony.diloreto
priority: normal
severity: normal
status: open
title: Webbrowser Module Cannot Find xdg-settings on OSX
type: crash
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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