[issue39050] The "Help" button in IDLE's config dialog does not work

2020-03-02 Thread Zackery Spytz


Zackery Spytz  added the comment:

Terry, should this issue remain open?

--

___
Python tracker 

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



[issue37266] Daemon threads must be forbidden in subinterpreters

2020-03-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Ok, I opened issue39812

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> I propose to change module_traverse(), module_clear() and module_dealloc() to 
> not call m_traverse(), m_clear() and m_free() if md_state is NULL and m_size 
> > 0.

Note: This change also means that m_traverse, m_clear and m_free are no longer 
called if md_state is set to NULL. But it never occurs in practice.

module_dealloc() calls PyMem_FREE(m->md_state) but it doesn't set md_state to 
NULL. It's not needed, since the module memory is deallocated anyway.

--

___
Python tracker 

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



[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:

To make things more clear (it is good that Gregory asked):

ONLY use this flag if you don't use coroutines at all
OR control ALL async libraries in your application.

Random async libraries from PyPI may rely on the
ContextVar and silently give incorrect results.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> And setup.py does use use multiple processes via a thread pool, where each 
> thread calls fork(), if it detects that "make" was invoked with the parallel 
> (-j) option.

Oh ok, now I get it :-) setup.py uses distutils to build extensions and 
distutils.command.build_ext uses concurrent.futures for parallelism:

if self.parallel:
self._build_extensions_parallel()
else:
self._build_extensions_serial()

with:

def _build_extensions_parallel(self):
workers = self.parallel
if self.parallel is True:
workers = os.cpu_count()  # may return None
try:
from concurrent.futures import ThreadPoolExecutor
except ImportError:
workers = None

if workers is None:
self._build_extensions_serial()
return

with ThreadPoolExecutor(max_workers=workers) as executor:
futures = [executor.submit(self.build_extension, ext)
   for ext in self.extensions]
for ext, fut in zip(self.extensions, futures):
with self._filter_build_errors(ext):
fut.result()

The problem is not concurrent.futures but the job submitted to the executor: 
build_extension() uses distutils.spawn() which is unsafe.

distutils.spawn() is the root issue if I understood correctly. It must be 
rewritten with subprocess.

--

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 66b7973c1b2e6aa6a2462c6b13971a08cd665af2 by Victor Stinner in 
branch 'master':
bpo-39796: Fix _warnings module initialization (GH-18739)
https://github.com/python/cpython/commit/66b7973c1b2e6aa6a2462c6b13971a08cd665af2


--

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2020-03-02 Thread Eric Snow


Eric Snow  added the comment:

Possible backward incompatibility caused by this issue: issue39829

--
nosy: +eric.snow

___
Python tracker 

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



[issue39825] EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows)

2020-03-02 Thread Antoine Pitrou


New submission from Antoine Pitrou :

On Windows, Python 3.7.6 and 3.8.1:
```
>>> import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.pyd'
>>> from distutils import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.cp38-win_amd64.pyd'
```

The sysconfig answer is probably wrong (the ABI-qualified extension 
'.cp38-win_amd64.pyd' should be preferred).

--
components: Distutils, Library (Lib)
messages: 363171
nosy: dstufft, eric.araujo, paul.moore, pitrou, steve.dower, tarek, tim.golden, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig 
(Windows)
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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Yes, I don't think other weakref-supporting objects traverse the weakreflist in 
their tp_traverse.

--
nosy: +pitrou

___
Python tracker 

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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread STINNER Victor


New submission from STINNER Victor :

The json.tool module doesn't catch BrokenPipeError:
---
$ echo "{}" | python3 -m json.tool | true
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/usr/lib64/python3.7/json/tool.py", line 45, in 
main()
  File "/usr/lib64/python3.7/json/tool.py", line 41, in main
outfile.write('\n')
BrokenPipeError: [Errno 32] Broken pipe
---

json.tool should catch BrokenPipeError.

--
components: Library (Lib)
messages: 363185
nosy: vstinner
priority: normal
severity: normal
status: open
title: json.tool should catch BrokenPipeError
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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

Attached fork_mt.py example uses exec_fn() function... which is not defined. Is 
it on purpose?

--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Cool. Should I remove Python-3.* from the Versions label, so it doesn't show up 
in searches for 3.* issues?

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-02 Thread Kim-Adeline Miguel


New submission from Kim-Adeline Miguel :

(See #33234)

Recently we added Python 3.8 to our CI test matrix, and we noticed a possible 
backward incompatibility with the list() constructor.

We found that __len__ is getting called twice, while before 3.8 it was only 
called once.

Here's an example:

class Foo:
 def __iter__(self):
  print("iter")
  return iter([3, 5, 42, 69])

 def __len__(self):
  print("len")
  return 4

Calling list(Foo()) using Python 3.7 prints:

iter
len

But calling list(Foo()) using Python 3.8 prints:

len
iter
len

It looks like this behaviour was introduced for #33234 with PR GH-9846. 

We realize that this was merged a while back, but at least we wanted to make 
the team aware of this change in behaviour.

--
components: Interpreter Core
messages: 363186
nosy: brett.cannon, eric.snow, kimiguel, pablogsal, rhettinger
priority: normal
severity: normal
status: open
title: __len__ called twice in the list() constructor
type: behavior
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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

Leaving open until someone (*cough* Benjamin) confirms whether this has to go 
into 2.7 or not.

--
nosy: +benjamin.peterson
stage: patch review -> backport needed

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 7ad99821d8ae75222c50e69194a39f535bb058f5 by Miss Islington (bot) 
in branch '3.8':
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
https://github.com/python/cpython/commit/7ad99821d8ae75222c50e69194a39f535bb058f5


--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 7ca251bd85f1182b9734579975c17fbd0488e2a4 by Miss Islington (bot) 
in branch '3.7':
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
https://github.com/python/cpython/commit/7ca251bd85f1182b9734579975c17fbd0488e2a4


--

___
Python tracker 

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



[issue39826] logging HTTPHandler does not support proxy

2020-03-02 Thread lorb


Change by lorb :


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

___
Python tracker 

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



[issue37636] Deprecate slicing and ordering operations on sys.version

2020-03-02 Thread Ruairidh MacLeod


Change by Ruairidh MacLeod :


--
nosy: +rkm

___
Python tracker 

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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
assignee:  -> pablogsal

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur with Antoine and Tim. The GC already has the machinery to deal with 
weak references in the correct way (even more after recent bugfixes regarding 
callbacks). Traversing the weak reference list in incorrect because the object 
does not "own" the weak references to it, as the weak references can die even 
if the object is alive. Also, as Tim mentions, the traverse will be called on 
the head of the list, in the same way if you do object.__weakref__ you will 
only get the HEAD of the list:

>>> import weakref
>>> class A: ...
>>> a = A()
>>> w1 = weakref.ref(a)
>>> w2 = weakref.ref(a, lambda *args: None) # Use a callback to avoid re-using 
>>> the original weakref
>>> id(w1)
4328697104
>>> id(w2)
4328758864
>>> id(a.__weakref__)
4328697104

I think that this is not very well documented, as there is no pointers on what 
should and should not be traversed in 
https://docs.python.org/3.8/c-api/typeobj.html#c.PyTypeObject.tp_traverse.

I will prepare a PR to the documentation if everybody agrees and another one 
removing the traverse unless someone sees that something else is at play.

--
nosy: +pablogsal

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 18743 to reimplement distutils.spawn.spawn() function with the 
subprocess module.

It also changes setup.py to use a basic implementation of the subprocess module 
if the subprocess module is not available: before required C extension modules 
are built.

--

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> if we don't load _warnings module as soon as possible, what possible risks 
> will be raise?

There are different risks:

* Worst case: using the _warnings module state before it's initialized may lead 
to crash.
* Best case: some warnings are not emitted.

Anyway, the initial issue should now be fixed by my commit.

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



[issue39826] logging HTTPHandler does not support proxy

2020-03-02 Thread lorb


New submission from lorb :

The HTTPHandler does not support using a proxy. It would be necessary to 
subclass it and reimplement `emit` to enable passing in proxy settings.
Adding a hook to make it easy to customize the connection used would solve this.

--
components: Library (Lib)
messages: 363181
nosy: lorb
priority: normal
severity: normal
status: open
title: logging HTTPHandler does not support proxy
type: enhancement

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread hai shi


hai shi  added the comment:

copy that, thanks for your explanation, victor.

--

___
Python tracker 

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



[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-02 Thread Till Korten


New submission from Till Korten :

This issue occurs when a locale is set that uses comma as decimal separator 
(e.g. locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')).
I have a tkinter.Spinbox with increment=0.1 connected to a tkinter.DoubleVar.
When I change the value of the Spinbox using the arrow buttons and subsequently 
try to read out the variable with tkinter.DoubleVar.get(), my code throws the 
follwoing error:
_tkinter.TclError: expected floating-point number but got "0,1".

Here is a minimal code example:

-
import tkinter
import locale

locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')


class TestDoubleVar():
def __init__(self):
root = tkinter.Tk()
self.var = tkinter.DoubleVar()
self.var.set(0.8)
number = tkinter.Spinbox(
root,
from_=0, to=1, increment=0.1,
textvariable=self.var,
command=self.update,
width=4
)
number.pack(side=tkinter.LEFT)
root.mainloop()

def update(self, *args):
print(float(self.var.get()))


if __name__ == '__main__':
TestDoubleVar()

---

Actual result: the code throws an error

Expected result: the code should print the values of the DoubleVar even with a 
locale set that uses comma as the decimal separator.

n.b. the problem also occurs with tkinter.Scale

--
components: Tkinter
files: test_doublevar.py
messages: 363184
nosy: thawn
priority: normal
severity: normal
status: open
title: setting a locale that uses comma as decimal separator breaks 
tkinter.DoubleVar
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48943/test_doublevar.py

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Why should that be backwards incompatible? The number of times we can `__len__` 
on the constructor is an implementation detail. The reason is called now twice 
is because there is an extra check for the preallocation logic, which is 
detached from the logic of the subsequent list_extend(self, iterable). 

On the other hand, there may be a chance for optimization here, but on a very 
rough first plan, that may require coupling some logic (passing down the 
calculated length to list_extend() or some helper, which I am not very fond of.

--

___
Python tracker 

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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread Hakan


Hakan  added the comment:

I'd like to work on this issue but what should it do when it captures that 
error.

--
nosy: +hakancelik

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread Elad Lahav


Elad Lahav  added the comment:

"Attached fork_mt.py example uses exec_fn() function... which is not defined. 
Is it on purpose?"

That was my mistake - a copy/paste of existing code from distutils. Since the 
example hangs before the script gets to exec_fn() I didn't notice the problem. 
Just change it to os.execl

--

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-03-02 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 211055176157545ce98e6c02b09d624719e6dd30 by Inada Naoki in branch 
'master':
bpo-39775: inspect: Change Signature.parameters back to OrderedDict. (GH-18684)
https://github.com/python/cpython/commit/211055176157545ce98e6c02b09d624719e6dd30


--

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-03-02 Thread Inada Naoki


Change by Inada Naoki :


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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

No, that one is fine.

I just need someone else to jump in and tag the commit in cpython-source-deps 
for me (because I can't clone it successfully on my current internet 
connection).

--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ah, but you're all set @steve.dower, someone at cpython-source-deps already 
pulled my tags: https://github.com/python/cpython-source-deps/tags :)

But I guess that if I were to do the same maneouver again, it would probably be 
preferable if I made one PR for macOS and another for Windows, right?

--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

I marked the PR to backport to 3.7 and 3.8.

Up to Benjamin whether 2.7 gets it, but unless there's a specific and impactful 
CVE that's been fixed, I doubt it (the one linked at the start of this issue 
seems to require direct modification of the SQL statement, which would be a bug 
in itself if permitted, so I think it's outside of our threat model for 
CPython).

--

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

_PyWarnings_Init() initializes tstate->interp->warnings which is the module 
state of the warnings module:

WarningsState *st = _Warnings_GetState();
if (st == NULL) {
goto error;
}
if (_Warnings_InitState(st) < 0) {
goto error;
}

In Python 2, _PyWarnings_Init() called Py_InitModule3() which immediately 
stored the _warnings module to sys.modules['_warnings'].

In Python 3, _PyWarnings_Init() calls PyModule_Create() which creates a module 
but doesn't add it to sys.modules.

I don't think that removing _PyWarnings_Init() call from pylifecycle.c is 
correct. We want the _warnings module to be ready as early as possible.

The problem is that pylifecycle.c creates a module object which is not stored 
anywhere:

/* Initialize _warnings. */
if (_PyWarnings_Init() == NULL) {
return _PyStatus_ERR("can't initialize warnings");
}

pylifecycle.c should only call _Warnings_InitState() without creating a module.

There are C functions which access the module state (tstate->interp->warnings) 
without going through the module object, like PyErr_WarnFormat().

--
nosy: +vstinner

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18094
pull_request: https://github.com/python/cpython/pull/18739

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18096
pull_request: https://github.com/python/cpython/pull/18741

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: closed -> open

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Would you prefer that I close GH_18678 and split it up in separate RPs for 
macOS and Windows?

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
title: Multi-phase extension module (PEP 489): don't call m_traverse, m_clear 
nor m_free if md_state is NULL -> Multi-phase extension module (PEP 489): don't 
call m_traverse, m_clear nor m_free before the module state is allocated

___
Python tracker 

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



[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-03-02 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue23080] BoundArguments.arguments should be unordered

2020-03-02 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18095
pull_request: https://github.com/python/cpython/pull/18740

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e by Erlend Egeberg 
Aasland in branch 'master':
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
https://github.com/python/cpython/commit/1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e


--
nosy: +miss-islington

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

The question came up while I reviewed PR 18608 which ports the audioop 
extension module to multiphase initialization (PEP 489):
https://github.com/python/cpython/pull/18608/files#r386061746

Petr Viktorin referred to m_clear() documentation which says that md_state 
*can* be NULL when m_clear() is called:
https://docs.python.org/3/c-api/module.html#c.PyModuleDef.m_clear

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

2020-03-02 Thread STINNER Victor


New submission from STINNER Victor :

Currently, when a module implements m_traverse(), m_clear() or m_free(), these 
methods can be called with md_state=NULL even if the module implements the 
"Multi-phase extension module initialization" API (PEP 489).

I'm talking about these module methods:

* tp_traverse: module_traverse() calls md_def->m_traverse() if m_traverse is 
not NULL
* tp_clear: module_clear() calls md_def->m_clear() if m_clear is not NULL
* tp_dealloc: module_dealloc() calls md_def->m_free() is m_free is not NULL

Because of that, the implementation of these methods must check manually if 
md_state is NULL or not.

I propose to change module_traverse(), module_clear() and module_dealloc() to 
not call m_traverse(), m_clear() and m_free() if md_state is NULL and m_size > 
0.

"m_size > 0" is an heuristic to check if the module implements the "Multi-phase 
extension module initialization" API (PEP 489). For example, the _pickle module 
doesn't fully implements the PEP 489: m_size > 0, but PyInit__pickle() uses 
PyModule_Create().

See bpo-32374 which documented that "m_traverse may be called with 
m_state=NULL" (GH-5140).

--
components: Interpreter Core
messages: 363145
nosy: vstinner
priority: normal
severity: normal
status: open
title: Multi-phase extension module (PEP 489): don't call m_traverse, m_clear 
nor m_free if md_state is NULL
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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

Nope, same PR and bug is totally fine.

Putting the NEWS items in their platform-specific sections is how we normally 
do it (though to be fair, I had to go look it up).

--

___
Python tracker 

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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue39503] [security][CVE-2020-8492] Denial of service in urllib.request.AbstractBasicAuthHandler

2020-03-02 Thread Michał Górny

Change by Michał Górny :


--
nosy: +mgorny

___
Python tracker 

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



[issue39807] Python38 installed in wrong directory on Windows

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

Yep, that seems like the reason. All of that redirection is handled by the OS 
and I don't think we'd want to override it.

However, I suspect we're close to having another discussion about making the 64 
bit download the default. There are fewer actual 32-bit OS installs out there 
(though I don't have real numbers yet) and I think we're seeing more people get 
confused by the 32-bit installer than would be by an immediate error if they 
need a different one.

That said, ARM devices can only run the 32-bit version. If we start seeing 
those pick up, we may have to reconsider again.

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue38826] Regular Expression Denial of Service in urllib.request.AbstractBasicAuthHandler

2020-03-02 Thread Michał Górny

Change by Michał Górny :


--
nosy: +mgorny

___
Python tracker 

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



[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:

For the people who find this issue via a search engine:

  1) The defaults in 3.7, 3.8 and 3.9 are unchanged (you get
 the ContextVar).

  2) ./configure --without-decimal-contextvar enables the exact
 TLS context code from 3.3-3.6.  There is no new code.

  3) On Windows you need to edit PC\pyconfig.h to enable the TLS
 context.

  4) There are extensive tests for the flag in:

Modules/_decimal/tests/runall-memorydebugger.sh

--

___
Python tracker 

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



[issue39610] memoryview.__len__ should raise an exception for 0d buffers

2020-03-02 Thread Eric Wieser


Eric Wieser  added the comment:

Thanks for pointing out the docs reference, I updated the patch to reword that 
section.

There's a sentence right before the one you draw attention to which to me reads 
as another argument to change this:

> ``len(view)`` is equal to the length of :class:`~memoryview.tolist`

On Python 2.7, this gives

>>> len(view_0d)
1
>>> len(view_0d.tolist())
NotImplementedError: tolist() only supports one-dimensional objects

On Python 3.8 before my patch, this gives:

>>> len(view_0d)
1
>>> len(view_0d.tolist())
TypeError: object of type 'int' has no len()

On Python 3.8, with my patch, this gives:

>>> len(view_0d)
TypeError: 0-dim memory has no length
>>> len(view_0d.tolist())
TypeError: object of type 'int' has no len()

As I read it, only with my patch is this sentence satisfied by the 
implementation.

--

___
Python tracker 

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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 4482337decdbd0c6e2150346a68b3616bda664aa by Lidi Zheng in branch 
'master':
bpo-39764: Make Task.get_stack accept ag_frame (#18669)
https://github.com/python/cpython/commit/4482337decdbd0c6e2150346a68b3616bda664aa


--

___
Python tracker 

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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +18097
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18742

___
Python tracker 

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



[issue39050] The "Help" button in IDLE's config dialog does not work

2020-03-02 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

After this change, the arm64 buildbots are reporting reference leaks:

1:03:24 load avg: 0.95 Re-running failed tests in verbose mode
1:03:24 load avg: 0.95 Re-running test_capi in verbose mode
test_capi leaked [4, 4, 4] references, sum=12

e.g. https://buildbot.python.org/all/#/builders/563/builds/25

--
nosy: +cstratak

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread hai shi


hai shi  added the comment:

Wow, Thanks, victor, much useful infos.

>In Python 3, _PyWarnings_Init() calls PyModule_Create() which creates a module 
>but doesn't add it to sys.modules.

this operation will be executed in _bootstrap_external.

> We want the _warnings module to be ready as early as possible.

if we don't load _warnings module as soon as possible, what possible risks will 
be raise? 

> There are C functions which access the module state 
> (tstate->interp->warnings) without going through the module object, like 
> PyErr_WarnFormat().

This is important info.

--

___
Python tracker 

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



[issue39823] Disassembly - improve documentation for bytecode instruction class and set source line no. attribute for every instruction

2020-03-02 Thread S Murthy


S Murthy  added the comment:

Docstring for `Instruction` should be more precise. ATM the description of 
`starts_line` is

line started by this opcode (if any), otherwise None

I think "source line started ..." would be a bit more precise and accurate.

--

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

It'll have to be a program that cannot inherit the active console. Ffmpeg 
normally can, but running the first script with pythonw will make sure there is 
no console to inherit, and a new one will pop up for a regular Python process.

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 18738 to implement this change.

--
nosy: +Dormouse759, ncoghlan, pablogsal, petr.viktorin, shihai1991

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

Proposed PR checking if the module state is NULL:

* PR 18358: _locale module
* PR 18608: audioop module
* PR 18613: binascii

--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ok, thanks for your patience and time. I'll fix the NEWS entries right away.

--

___
Python tracker 

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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 43932dc1eaf36d75b2ee0420d8be747001315c26 by Miss Islington (bot) 
in branch '3.8':
bpo-39764: Make Task.get_stack accept ag_frame (GH-18669)
https://github.com/python/cpython/commit/43932dc1eaf36d75b2ee0420d8be747001315c26


--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

There are different kinds of extension modules:

(1) no module state (m_size <= 0): **not affected** by this change. Example: 
_asyncio which implements m_free() to clear global variables and free lists.

(2) Have a module state but PyInit_xxx() calls PyModule_Create(): 
PyModule_Create() always allocates md_state. I understand that such extension 
module is **not affected** by this change.

(3) Multi-phase extension: PyInit_xxx() function calls PyModuleDef_Init(). Such 
extension module **is affected** if m_traverse, m_clear or m_free() is not 
NULL. Example: atexit module implements m_traverse, m_clear and m_free.


PyModuleObject structure contains Python objects like md_dict (dict), md_name 
(str) or md_weaklist (list):

* module_traverse() always traverses md_dict: m_traverse() is no needed for 
that.
* module_clear() always clears md_dict: m_clear() is no needed for that.
* module_dealloc() always deallocates md_dict, md_name and md_weaklist: 
m_free() is no needed for that. 
* md_name is a string, it cannot be involved in a reference cycle.


I don't think that it's possible to extend PyModuleObject structure (as done by 
PyListObject for PyObject) to add other Python objects: md_state is designed 
for that. PyModule_Create() allocates exactly sizeof(PyModuleObject) bytes.


If an extension module has a module state, stores Python objects *outside* this 
state and uses m_traverse, m_clear and m_free to handle these objects: the GC 
will no longer be able to handle these objects before the module is executed 
with this change. If such extension module exists, I consider that it's ok to 
only handle objects stored outside the module state once the module is 
executed. The window between  and  is very short.

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread Ammar Askar


Ammar Askar  added the comment:

Just a quick update, I think this is a codecov bug as per here: 
https://community.codecov.io/t/prs-are-commented-even-with-comment-off/941

The yaml configuration doesn't show up here: 
https://codecov.io/gh/python/cpython/settings/yaml

While we wait for a response from codecov, we can fix this in the interim by 
overriding the settings at an organization level. An owner of the Python 
organization can enable this here: the organization level stuff would be here: 
https://codecov.io/account/gh/python/yaml

placing

```
comment: off
coverage:
  status:
changes: off
project: off
patch: off
```

as the config should hopefully fix this for now.

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:

I think the PR fixes the issue but I have to run longer tests still.

Threads created by PyGILState_Ensure() could have a duplicate tstate->id,
which confused the ContextVar caching machinery.

--

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18103
pull_request: https://github.com/python/cpython/pull/18748

___
Python tracker 

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



[issue39694] Incorrect dictionary unpacking when calling str.format

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Change by Stefan Krah :


--
keywords: +patch
pull_requests: +18101
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18746

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to use LTO + PGO optimizations when benchmarking Python:
https://pyperformance.readthedocs.io/usage.html#how-to-get-stable-benchmarks

Benchmarking is hard :-/

--

___
Python tracker 

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



[issue37330] open(): remove 'U' mode, deprecated since Python 3.3

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> While we are of course able to patch new versions of Samba, this will make it 
> harder to bisect back though Samba history.

I don't understand the bisect part. Would you mind to elaborate? What do you 
want to bisect?

>  It would be really great if this kind of change could be reverted or at 
> least deferred so Samba can rely on a stable language platform for it's build 
> system.

The "U" mode was deprecated since September 2012 (Python 3.3): you had 8 years 
to handle the DeprecationWarning. 8 years before actually removing a deprecated 
feature sounds like a stable language platform to me.

I'm not sure of the benefit of deferring the change. Does it mean that Sambda 
would not be updated?

Well, your comment fits exactly into bpo-39674 scope, except that revert the 
"U" mode is not scheduled yet.

--

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

Andrew Bartlett of the Samba project asked to revert the removal of the "U" 
mode:
https://bugs.python.org/issue37330#msg362362

We should consider to revert the removal, and only remove the "U" mode in 
Python 3.10.

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-03-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50 by Batuhan Taşkaya in 
branch 'master':
bpo-38870: Add docstring support to ast.unparse (GH-17760)
https://github.com/python/cpython/commit/89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50


--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Tim Peters


Tim Peters  added the comment:

After some thought, I'm sure the diagnosis is correct:  the weakref list must 
be made invisible to gc.  That is, simply don't traverse it at all.  The crash 
is exactly what's expected from traversing objects a container doesn't own 
references to.

I agree the tp_traverse docs should point out that weakref lists are special 
this way, but I think the problem is unique to them - can't think of another 
case where a container points to an object it doesn't own a reference to.

--

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18102
pull_request: https://github.com/python/cpython/pull/18747

___
Python tracker 

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



[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:

> If someone builds an interpreter with this configure flag, does it break
> compatibility with anything that code may have started to expect as of 3.7?

Yes, anything that relies on the implicit context being coroutine-safe
does not work.  The only test that expectedly breaks in the stdlib is:

   Lib/test/test_asyncio/test_context.py


Basically you can't use operators inside coroutines in the same thread
if both coroutines use a different implicit context.

You can of course replace all operators inside coroutines by the
corresponding context methods:

   # Unsafe with TLS context:
   async def foo():
   with localcontext(Context(prec=10)):
   x = Decimal(1) / 9

   # Safe, just avoid the TLS context:
   async def foo():
   c = Context(prec=10)
   x = c.divide(Decimal(1), 9)

--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

> don't know if you still need it but here is what you requested.

Thanks. That basically confirms that something is interfering with distutils. 
Skipping the check entirely should avoid it.

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Nick Moore


Nick Moore  added the comment:

Not disagreeing with you that "%b %d" timestamps with no "%Y" are excerable, 
but they're fairly common in the *nix world unfortunately.

People need to parse them, and the simple and obvious way to do this breaks 
every four years.

I like the idea of having a warning for not including %Y *and* not setting a 
default_year kwarg though.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18111
pull_request: https://github.com/python/cpython/pull/18756

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +18110
pull_request: https://github.com/python/cpython/pull/18755

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-03-02 Thread Pete Wicken


Change by Pete Wicken :


--
keywords: +patch
nosy: +Wicken
nosy_count: 5.0 -> 6.0
pull_requests: +18112
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18757

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9ddcb914f9c2debe7c1359b2450cd1573e86b91c by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse 
and tp_clear (GH-18749) (GH-18756)
https://github.com/python/cpython/commit/9ddcb914f9c2debe7c1359b2450cd1573e86b91c


--

___
Python tracker 

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



[issue39809] argparse: add max_text_width parameter to ArgumentParser

2020-03-02 Thread Luca


Luca  added the comment:

OK, I will do this for my package, but I do not believe many others will do the 
same without a `max_text_width` parameter (too much care is needed for this to 
work correctly), and as a result most packages using `argparse` will continue 
to not properly handle text width.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 by Pablo Galindo in 
branch 'master':
bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and 
tp_clear (GH-18749)
https://github.com/python/cpython/commit/0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2


--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18109
pull_request: https://github.com/python/cpython/pull/18754

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-03-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

As with the Accessor abstraction, the original idea was to support Path objects 
backed by a directory file descriptor (for use with openat() and friends).  
That idea was abandoned but it looks like the context manager stayed.  It's 
certainly not useful currently.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 69ded3944c202da972754644c0bbf7f77cc5e8ea by Miss Islington (bot) 
in branch '3.7':
bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and 
tp_clear (GH-18749)
https://github.com/python/cpython/commit/69ded3944c202da972754644c0bbf7f77cc5e8ea


--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 11.0 -> 12.0
pull_requests: +18113
pull_request: https://github.com/python/cpython/pull/18758

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:


New changeset ce3a4984089b8e0ce5422ca32d75ad057b008074 by Steve Dower in branch 
'master':
bpo-38597: Never statically link extension initialization code on Windows 
(GH-18724)
https://github.com/python/cpython/commit/ce3a4984089b8e0ce5422ca32d75ad057b008074


--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:

> On Mar 2, 2020, at 6:33 PM, Gregory P. Smith  wrote:
> 
> Change that default to any old year with a leap year (1904?)

In the 21st century, the year 2000 default makes much more sense than 1900. 
Luckily 2000 is also a leap year.

--

___
Python tracker 

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



[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-02 Thread Norbert

New submission from Norbert :

Modules whose names contain characters that are in precomposed form but can be 
decomposed in Normalization Form D can’t be found on macOS.


To reproduce:

1. Download and unzip the attached file Modules.zip. This produces a directory 
Modules with four Python source files.

2. In Terminal, go to the directory that contains Modules.

3. Run "python3 -m Modules.Import".


Expected behavior:

The following lines should be generated:
Maerchen
Märchen


Actual behavior:

The first line, “Maerchen” is generated, but then an error occurs:
Traceback (most recent call last):
 File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", 
line 193, in _run_module_as_main
   return _run_code(code, main_globals, None,
 File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", 
line 86, in _run_code
   exec(code, run_globals)
 File "/Users/business/tmp/pyimports/Modules/Import.py", line 5, in 
   from Modules.Märchen import hello2
ModuleNotFoundError: No module named 'Modules.Märchen'


Evaluation:

In the source file Modules/Import.py, the name of the module “Märchen” is 
written with the precomposed character U+00E4. The file name Märchen.py uses 
the decomposed character sequence U+0061 U+0308 instead. Macintosh file names 
commonly use a variant of Normalization Form D in file names – the old file 
system HFS enforces this, and while APFS doesn’t, the Finder still generates 
file names in this form. U+00E4 and U+0061 U+0308 are canonically equivalent, 
so they should be treated as equal in module loading.


Tested configuration:

CPython 3.8.2
macOS 10.14.6

--
components: Interpreter Core
files: Modules.zip
messages: 363224
nosy: Norbert
priority: normal
severity: normal
status: open
title: Modules with decomposable characters in module name not found on macOS
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48944/Modules.zip

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 8a5f7ad5e423b74ea612e25472e5bff3adf1ea87 by Steve Dower in branch 
'3.7':
[3.7] bpo-38597: Never statically link extension initialization code on Windows 
(GH-18724) (GH-18759)
https://github.com/python/cpython/commit/8a5f7ad5e423b74ea612e25472e5bff3adf1ea87


--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Paul Ganssle


Paul Ganssle  added the comment:

I don't think adding a default_year parameter is the right solution here.

The actual problem is that `time.strptime`, and by extension 
`datetime.strptime` has a strange and confusing interface. What should happen 
is either that `year` is set to None or some other marker of a missing value or 
datetime.strptime should raise an exception when it's being asked to construct 
something that does not contain a year.

Since there is no concept of a partial datetime, I think our best option would 
be to throw an exception, except that this has been baked into the library for 
ages and would start to throw exceptions even when the person has correctly 
handled the Feb 29th case.

I think one possible "solution" to this would be to raise a warning any time 
someone tries to use `datetime.strptime` without requesting a year to warn them 
that the thing they're doing only exists for backwards compatibility reasons. 
We could possibly eventually make that an exception, but I'm not sure it's 
totally worth a break in backwards compatibility when a warning should put 
people on notice.

--
nosy: +p-ganssle

___
Python tracker 

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



  1   2   >