[issue38400] Python segfaults when configured with --with-pydebug --with-trace-refs

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

Notes for myself.

the visit_decref() has been updated to display repr() of the parent object, 
rather than display the "freed" object.

Before:
---
Modules/gcmodule.c:378: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed

Fatal Python error: _PyObject_AssertFailed
Python runtime state: preinitialized

Current thread 0x7f6e2863e740 (most recent call first):

---

After:
---
Modules/gcmodule.c:378: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7fe2d1a52b40
object refcount : 1
object type : 0x740be0
object type name: dict
object repr : {'__repr__': , 
'__hash__': , '__call__': , '__lt__': , '__le__': , 
'__eq__': , '__ne__': , '__gt__': , '__ge__': , '__init__': 
, '__new__': , '__callback__': , '__doc__': None}

Fatal Python error: _PyObject_AssertFailed
Python runtime state: preinitialized

Current thread 0x7fe2dea35740 (most recent call first):

---

The problem was that the None object was seen as "freed" because 
_ob_prev=_ob_next=NULL. This object doesn't seem to be part of the list of all 
objects, sys.getobjects(). I fixed Py_None, but then I got the same assertion 
error on a different (moduledef) object. I gave up, and Pablo and me fixed 
_PyObject_IsFreed() instead.

--

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am sure this will break third-party projects. But I thing that we should not 
revert this change, as it completely matches the documentation. It is good that 
it was applied so early at development cycle.

Stefan, could you please test Cython and lxml with this?

--
nosy: +scoder

___
Python tracker 

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



[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

Notes for myself.

In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug.

For example, this bug can be reproduced with this change:
---
diff --git a/Python/hamt.c b/Python/hamt.c
index 28b4e1ef6c..d7dd555d15 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -2478,8 +2478,6 @@ hamt_alloc(void)
 if (o == NULL) {
 return NULL;
 }
-o->h_count = 0;
-o->h_root = NULL;
 o->h_weakreflist = NULL;
 PyObject_GC_Track(o);
 return o;
---

Python now detects the bug in debug mode:
---
$ ./python -m test -v test_context
(...)
test_context_copy_1 (test.test_context.ContextTest) ...
Modules/gcmodule.c:1931: visit_validate: Assertion failed: PyObject_GC_Track() 
object is not valid
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7f2b17408d70
object refcount : 1
object type : 0x76bc20
object type name: hamt
object repr : 

Fatal Python error: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x7f2b25590740 (most recent call first):
  File "/home/vstinner/python/master/Lib/test/test_context.py", line 322 in 
test_context_copy_1
  File "/home/vstinner/python/master/Lib/unittest/case.py", line 616 in 
_callTestMethod
  File "/home/vstinner/python/master/Lib/unittest/case.py", line 659 in run
  (...)
  File "/home/vstinner/python/master/Lib/runpy.py", line 192 in 
_run_module_as_main
Aborted (core dumped)
---

--

___
Python tracker 

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



[issue27542] Segfault in gcmodule.c:360 visit_decref

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

> Julien: I'm working on enhancement of debug traces on visit_decref(). Are you 
> still able to reproduce the crash in 2019?

I asked him on IRC. No, he cannot reproduce the bug anymore.

--

___
Python tracker 

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



[issue27542] Segfault in gcmodule.c:360 visit_decref

2019-10-08 Thread Julien Palard


Julien Palard  added the comment:

I tried again with the same version of pip and cffi on cpython 2.7.16 (no 13, I 
have no VM atm to compile a 2.7.13) but no segfault this time.

--

___
Python tracker 

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



[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Example:

>>> from typing import NamedTuple
>>> import pickle
>>> class A:
... class B(NamedTuple):
... x: int
... 
>>> pickle.dumps(A.B)
Traceback (most recent call last):
  File "", line 1, in 
_pickle.PicklingError: Can't pickle : attribute lookup B on 
__main__ failed

--
components: Library (Lib)
messages: 354176
nosy: gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Nested subclasses of typing.NamedTuple are not pickleable
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



[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38406] Missed some public names in help(typing)

2019-10-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Special forms NoReturn, Final, Literal and class ForwardRef are not shown in 
the help() output.

--
components: Library (Lib)
messages: 354177
nosy: gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Missed some public names in help(typing)
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



[issue38406] Missed some public names in help(typing)

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I looked at wrong Python version.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

typing.SupportsXXX classes do not have docstrings and help() shows the 
docstring of the parent class instead, which is wrong ("Base class for protocol 
classes...").

--
components: Library (Lib)
messages: 354179
nosy: gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add docstrings for typing.SupportsXXX classes
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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-10-08 Thread hongweipeng


Change by hongweipeng :


--
pull_requests: +16228
pull_request: https://github.com/python/cpython/pull/16645

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2019-10-08 Thread Inada Naoki


Inada Naoki  added the comment:

On Mon, Oct 7, 2019 at 9:41 PM Mark Shannon  wrote:
>
> Mark Shannon  added the comment:
>
> Given that
> def foo(): int; str; bytes; float; int; str; bytes; float
> can be trivially be rewritten as
> def foo(): pass
> I think that benchmark is meaningless.
>

Do you mean every microbenchmark measuring single feature is meaningless?

I think it is worth enough for readers who understand what
`LOAD_GLOBAL` instruction means.
(e.g. People who using techniques like `int_ = int` before a loop.)

--

___
Python tracker 

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



[issue38408] urlparse gives no method to build a url with a port

2019-10-08 Thread James Allsopp


New submission from James Allsopp :

Hi,
I like to build my Url's using url unparse, e.g.
site_to_test = urllib.parse.urlunparse((scheme, host, page, '', '', ''))
r = requests.get(site_to_test)

However, we reach a lot of sites through SSH tunnels, as our network is heavily 
locked down, and need to specify a port. Unfortunately, we can parse a url with 
a port, and get site_to_test.port = '9097' we can't run it the other way, e.g. 
this fails.
site_to_test = urllib.parse.urlunparse((scheme, host, page, '', '', 
'',port=9097))

This should be easy to fix and there's a use case for it.
Thanks

--
components: Library (Lib)
messages: 354180
nosy: James Allsopp
priority: normal
severity: normal
status: open
title: urlparse gives no method to build a url with a port
versions: Python 3.5

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-08 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +16229
pull_request: https://github.com/python/cpython/pull/16646

___
Python tracker 

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



[issue38294] Documentation on 3.6->3.7 re.escape no longer escaping "/" or ":" should be obvious

2019-10-08 Thread Ricardo Bánffy

Change by Ricardo Bánffy :


--
pull_requests: +16230
pull_request: https://github.com/python/cpython/pull/16647

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-08 Thread M. Eric Irrgang


Change by M. Eric Irrgang :


--
pull_requests: +16231
pull_request: https://github.com/python/cpython/pull/16648

___
Python tracker 

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



[issue33714] module can set an exception in tp_clear

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset d7c387384a27f37e4e3fa7890c859212c56b45b2 by Miss Islington (bot) 
(Serhiy Storchaka) in branch 'master':
bpo-33714: Output an exception raised in module's m_clear(). (GH-16592)
https://github.com/python/cpython/commit/d7c387384a27f37e4e3fa7890c859212c56b45b2


--
nosy: +miss-islington

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

> ==6832==at 0x4D87E9: PyUnicode_Decode (unicodeobject.c:3395)

This warning is a false alarm: the GCC builtin strcmp() function seems to read 
past the NUL byte. When recompiling Python with -fno-builtin GCC option, the 
warning is gone.

The valgrind warning can be reproduced using attached valgrind_strcmp_warn.c:

On Fedora 30 with:

* gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
* valgrind-3.15.0

GCC builtin strcmp() emits a false alarm in valgrind: it reads past the NUL
byte.

$ gcc -O3 valgrind_strcmp_warn.c -o valgrind_strcmp_warn -D NDEBUG=1 -g && 
valgrind ./valgrind_strcmp_warn
(...)
==29173== Conditional jump or move depends on uninitialised value(s)
==29173==at 0x4011CB: PyUnicode_Decode.part.0 (valgrind_strcmp_warn.c:276)
==29173==by 0x4898F42: (below main) (in /usr/lib64/libc-2.29.so)
==29173==
==29173== Conditional jump or move depends on uninitialised value(s)
==29173==at 0x4011EE: PyUnicode_Decode.part.0 (valgrind_strcmp_warn.c:280)
==29173==by 0x4898F42: (below main) (in /usr/lib64/libc-2.29.so)
==29173==
==29173== Conditional jump or move depends on uninitialised value(s)
==29173==at 0x401221: PyUnicode_Decode.part.0 (valgrind_strcmp_warn.c:282)
==29173==by 0x4898F42: (below main) (in /usr/lib64/libc-2.29.so)
(...)
==29173== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

versus

$ gcc -O3 valgrind_strcmp_warn.c -o valgrind_strcmp_warn -D NDEBUG=1 
-fno-builtin -g && valgrind ./valgrind_strcmp_warn
==29217== Memcheck, a memory error detector
(...)
==29217== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

--
title: Valgrind warnings when running tokenize.py -> Valgrind warning in 
PyUnicode_Decode: false alarm with GCC builtin strcmp()
Added file: https://bugs.python.org/file48647/valgrind_strcmp_warn.c

___
Python tracker 

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



[issue33714] module can set an exception in tp_clear

2019-10-08 Thread Petr Viktorin


Petr Viktorin  added the comment:

Indeed, it can be closed.
Thanks Serhiy for the better error message!

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



[issue38368] Crash when subclassing ctypes.Union

2019-10-08 Thread Matthias Klose


Change by Matthias Klose :


--
keywords: +3.7regression -patch

___
Python tracker 

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



[issue38408] urlparse gives no method to build a url with a port

2019-10-08 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

Hi!
I'm a newbie but I'd like to work on this issue
can I work on it???

--
nosy: +Amir

___
Python tracker 

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



[issue38371] Tkinter: deprecate the split() method

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d05b000c6bcd39dba4f4b2656e45954802649562 by Serhiy Storchaka in 
branch 'master':
bpo-38371: Tkinter: deprecate the split() method. (GH-16584)
https://github.com/python/cpython/commit/d05b000c6bcd39dba4f4b2656e45954802649562


--

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16233
pull_request: https://github.com/python/cpython/pull/16650

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16232
pull_request: https://github.com/python/cpython/pull/16649

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b690a2759e62d9ee0b6ea1b20e8f7e4b2cdbf8bb by Serhiy Storchaka in 
branch 'master':
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. 
(GH-16583)
https://github.com/python/cpython/commit/b690a2759e62d9ee0b6ea1b20e8f7e4b2cdbf8bb


--

___
Python tracker 

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



[issue38371] Tkinter: deprecate the split() method

2019-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue16623] argparse help formatter does not honor non-breaking space

2019-10-08 Thread hai shi


hai shi  added the comment:

I checked the help format.
the help_lines' width in python2.7 is different python3.

The width is more likely a hardcode in 
https://github.com/python/cpython/blob/2.7/Lib/argparse.py#L165.
, so the help_lines = [u'This is a very long help string. ex: "--s3', 
u's3://my.bucket/dir1/dir2"'](when joining this help_lines it will add a '\n' 
in the middle)

Since python 3.3, the width is a dynamic value in 
https://github.com/python/cpython/blob/master/Lib/argparse.py#L170
, so the help_lines = ['This is a very long help string. ex: 
"--s3\xa0s3://my.bucket/dir1/dir2"']

--
nosy: +shihai1991

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset a1f45008f190b0d340ec0eac623f05ef98e6b4c9 by Miss Islington (bot) 
in branch '3.8':
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. 
(GH-16583)
https://github.com/python/cpython/commit/a1f45008f190b0d340ec0eac623f05ef98e6b4c9


--
nosy: +miss-islington

___
Python tracker 

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



[issue16623] argparse help formatter does not honor non-breaking space

2019-10-08 Thread hai shi


hai shi  added the comment:

oh, typo error. the help_lines' width in python2.7 is different python3.-->the 
help_lines' width in python2.7 is different with python3.x

--

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset 4f962ecfa1aadc45facc250841208f6dd2ce690f by Miss Islington (bot) 
in branch '3.7':
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. 
(GH-16583)
https://github.com/python/cpython/commit/4f962ecfa1aadc45facc250841208f6dd2ce690f


--

___
Python tracker 

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



[issue38401] Make dataclass attribute docstrings accessible

2019-10-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Note that those strings are not docstrings, per se. They're just strings, and 
aren't available in the class definition for the dataclass decorator to see. 
It's really no different from:

class X:
x: int
3

That 3 just gets evaluated and thrown away, like the strings in your example. 
To change this is beyond the scope of dataclasses, and would need to be a 
language change. I can't think of a good way to attach the string to the 
annotation before it (I'm assuming this would only work with annotations, but 
maybe you have other ideas). You might want to bring this up on python-ideas to 
get some more feedback.

--

___
Python tracker 

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



[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And with PR 16583 it is now completely fixed. I.e. it can only fail in cases 
when the regular interactive interpreter fails too.

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



[issue37879] Segfaults in C heap type subclasses

2019-10-08 Thread Petr Viktorin

Petr Viktorin  added the comment:

Thanks to Stéphane and Eddie for fixing the refleak!

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

___
Python tracker 

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



[issue38140] Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API

2019-10-08 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thank you all!

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



[issue38408] urlparse gives no method to build a url with a port

2019-10-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

One way I can think of doing this in a backward compatible way is to add 
keyword parameters to urlunparse, like:

def urlunparse(components, *, username=None, password=None, hostname=None, 
port=None):

Which would make your call:
site_to_test = urllib.parse.urlunparse((scheme, host, page, '', '', ''), 
port=9097)

I think that's a horrible interface, but it is backward compatible.

A better interface would be have all 10 URL parameters passed in as keyword 
arguments, with reasonable defaults. If you want to keep this named 
"urlunparse", you'd need to say you can't pass in both "components" and any 
other named parameter (other than maybe the 4  parameters that are unnamed in 
ParseResult).

Something like:
def urlunparse(components=None, scheme=None, netloc=None, path=None, 
params=None, query=None, fragment=None, *, username=None, password=None, 
hostname=None, port=None):

Then error if components is set and any of scheme, netloc, path, params, query, 
or fragment is also set.

We could bikeshed about which would be keyword-only, if any, all, or only some 
as I've shown here.

Another option would be to leave urlunparse alone, and add a new function 
entirely, which wouldn't have to worry about backward compatibility.

It might be worthwhile to raise this on python-ideas.

--
nosy: +eric.smith

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

The valgrind false alarm on GCC builtin strcmp() has been reported to the 
Valgrind bug tracker in 2011, with an update in 2012 and... nothing :-(
https://bugs.kde.org/show_bug.cgi?id=264936

curl worked around the issue by disabling valgrind on the impacted test:
https://lists.fedoraproject.org/pipermail/scm-commits/2011-February/567665.html

Passing "--partial-loads-ok=yes" to Valgrind has no effect... It became the 
default:
http://valgrind.org/docs/manual/mc-manual.html#opt.partial-loads-ok

--

___
Python tracker 

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



[issue36253] Use after free in ctypes test suite

2019-10-08 Thread Ben Harper


Ben Harper  added the comment:

Changes merged

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



[issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields

2019-10-08 Thread Yury Selivanov


Yury Selivanov  added the comment:

> In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug.

Awesome!!!

--

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-08 Thread Ben Harper


Ben Harper  added the comment:

The default build of python with ASAN builds successfully. Test suite and PGO 
build are currently blocked, but that can be separated if it makes more sense 
to handle them individually.

Would it make sense to add an ASAN build to the CI pipeline to make detection 
automatic going forward?

--

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-08 Thread Yury Selivanov


Change by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

> The default build of python with ASAN builds successfully. Test suite and PGO 
> build are currently blocked, but that can be separated if it makes more sense 
> to handle them individually.

Yeah, please open one issue per ASAN issue (try to group similar warnings in 
the same Python issue?).


> Would it make sense to add an ASAN build to the CI pipeline to make detection 
> automatic going forward?

Gregory maintains a clang UBSan buildbot:
https://buildbot.python.org/all/#/builders/135

Usually I prefer to setup a buildbot when most issues are fixed.

I close this issue.

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +16234
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/16651

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like Python 2.7 is not affected.

--
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8252c52e57283515ace5d4251584255dc5c60eb5 by Serhiy Storchaka in 
branch 'master':
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
https://github.com/python/cpython/commit/8252c52e57283515ace5d4251584255dc5c60eb5


--

___
Python tracker 

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



[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 13abda41003daf599587991d8291f0dacf6e9519 by Serhiy Storchaka in 
branch 'master':
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
https://github.com/python/cpython/commit/13abda41003daf599587991d8291f0dacf6e9519


--

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 03ab6b4fc6f59a4452756e7a3a46310ce30ec4b2 by Victor Stinner in 
branch 'master':
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
https://github.com/python/cpython/commit/03ab6b4fc6f59a4452756e7a3a46310ce30ec4b2


--

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16236
pull_request: https://github.com/python/cpython/pull/16653

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16235
pull_request: https://github.com/python/cpython/pull/16652

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset 364532fb4962991d278da6470c3aec4e443e533d by Miss Islington (bot) 
in branch '3.8':
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
https://github.com/python/cpython/commit/364532fb4962991d278da6470c3aec4e443e533d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16237
pull_request: https://github.com/python/cpython/pull/16654

___
Python tracker 

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



[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16238
pull_request: https://github.com/python/cpython/pull/16655

___
Python tracker 

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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16239
pull_request: https://github.com/python/cpython/pull/16656

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset 98043b4fcd80bdfa8cc2be1730fa2a4cf4950958 by Miss Islington (bot) 
in branch '3.7':
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
https://github.com/python/cpython/commit/98043b4fcd80bdfa8cc2be1730fa2a4cf4950958


--

___
Python tracker 

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



[issue38118] Valgrind warning in PyUnicode_Decode: false alarm with GCC builtin strcmp()

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the issue has been fixed in 3.7, 3.8 and master branches.

Ensure that you use Valgrind with Misc/valgrind.supp. Example:

$ echo|PYTHONMALLOC=malloc valgrind --suppressions=Misc/valgrind-python.supp 
./python Lib/tokenize.py
(...)
==12923== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)

I close the issue.

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



[issue38409] Typo in doc string for str.strip

2019-10-08 Thread Bob Dowling


New submission from Bob Dowling :

The doc string for str.strip() has a typo: the "d" at the end of "removed" is 
missing.

help(str.strip)

Currently:
Return a copy of the string with leading and trailing whitespace remove.

Should be:
Return a copy of the string with leading and trailing whitespace removed.

I have attached an offered patch.

--
components: Library (Lib)
files: str_strip.patch
keywords: patch
messages: 354209
nosy: Bob Dowling
priority: normal
severity: normal
status: open
title: Typo in doc string for str.strip
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48648/str_strip.patch

___
Python tracker 

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



[issue38409] Typo in doc string for str.strip

2019-10-08 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +newcomer friendly

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2019-10-08 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset 10b475a151dc35c8ca4047331d591130973e914d by Miss Islington (bot) 
in branch '3.8':
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
https://github.com/python/cpython/commit/10b475a151dc35c8ca4047331d591130973e914d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread miss-islington


miss-islington  added the comment:


New changeset 7162440a7247f77d22cd937143f358fd5ac85af4 by Miss Islington (bot) 
in branch '3.8':
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
https://github.com/python/cpython/commit/7162440a7247f77d22cd937143f358fd5ac85af4


--
nosy: +miss-islington

___
Python tracker 

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



[issue38379] finalizer resurrection in gc

2019-10-08 Thread Tim Peters


Change by Tim Peters :


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

___
Python tracker 

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



[issue38379] finalizer resurrection in gc

2019-10-08 Thread Tim Peters


Tim Peters  added the comment:

PR 16658 aims to repair the stats reported.

--

___
Python tracker 

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



[issue36075] python 2to3 conversion tool is generating file with extra line for every input line

2019-10-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Looks like a duplicate of #34108

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2019-10-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +steve.dower

___
Python tracker 

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



[issue38409] Typo in doc string for str.strip

2019-10-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the patch and report. CPython now accepts GitHub pull requests 
https://devguide.python.org/pullrequest/

--
nosy: +xtreak

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-10-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16242
pull_request: https://github.com/python/cpython/pull/16659

___
Python tracker 

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



[issue38207] subprocess: On Windows, Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe

2019-10-08 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38202] A fatal error in test_dictviews

2019-10-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

Can you finalize the PR 16241 by adding the unit test which @serhiy.storchaka 
suggested?

--
nosy: +corona10

___
Python tracker 

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



[issue36075] python 2to3 conversion tool is generating file with extra line for every input line

2019-10-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing as duplicate.

@sabakauser: if you update to a recent Python 3.7 (anything more recent than 
3.7.1 should be enough), you should find that this is fixed.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> 2to3 munges new lines on Windows

___
Python tracker 

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



[issue38411] SQLITE_MISUSE race condition in sqlite3 is misleadingly raised as a binding error

2019-10-08 Thread Jack Robison


New submission from Jack Robison :

There is a race condition in the sqlite3 module that is misleadingly raised as 
sqlite3.InterfaceError('Error binding parameter 0 - probably unsupported type.')

There are two issues here, one is the incorrectly raise error 
(https://bugs.python.org/issue16379), the other is the underlying SQLITE_MISUSE 
caused by the race condition. I believe this is a race between sqlite3 vs 
python garbage collection due to the releasing of the GIL. If the GIL releasing 
is removed from sqlite3, I cannot reproduce the race.

Here is a script to reproduce the error, as the number of runners or 
queries_per_executemany is increased the error happens more frequently. The 
minimal test case only needs two executemanys where each has two queries to run.





import asyncio
import sqlite3
from concurrent.futures.thread import ThreadPoolExecutor


async def misuse_sqlite(runners=2, queries_per_executemany=2):
loop = asyncio.get_event_loop()

expected_error = 'Error binding parameter 0 - probably unsupported type.'
exceptions = []
executor = ThreadPoolExecutor(1)
db = executor.submit(sqlite3.connect, ':memory:', 
isolation_level=None).result()
executor.submit(db.executescript, "create table test (id text primary 
key);")

def query_in_executor():
return asyncio.wrap_future(executor.submit(executemany))

def executemany():
try:
return db.executemany("select * from test where id=?", ((str(i),) 
for i in range(queries_per_executemany)))
except Exception as err:
exceptions.append(err)

for _ in range(runners):
loop.call_soon(query_in_executor)
await asyncio.sleep(0.01)

assert all(str(err) == expected_error and isinstance(err, 
sqlite3.InterfaceError) for err in exceptions)

executor.submit(db.close).result()
executor.shutdown()

return len(exceptions) > 0


attempts = 0

while True:
attempts += 1
if asyncio.run(misuse_sqlite()):
print('error hit on attempt', attempts)
break

--
components: Library (Lib)
messages: 354218
nosy: Jack Robison
priority: normal
severity: normal
status: open
title: SQLITE_MISUSE race condition in sqlite3 is misleadingly raised as a 
binding error
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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2019-10-08 Thread Zackery Spytz


New submission from Zackery Spytz :

_PyEval_SetAsyncGenFinalizer() and _PyEval_SetAsyncGenFirstiter() don't include 
proper error handling for their PySys_Audit() calls. This could lead to leaked 
exceptions and fatal errors.

--
components: Interpreter Core
messages: 354210
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer,Firstiter}()
type: crash
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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 10cd00a9e3c22af37c748ea5a417f6fb66601e21 by Pablo Galindo in 
branch 'master':
bpo-38395: Fix ownership in weakref.proxy methods (GH-16632)
https://github.com/python/cpython/commit/10cd00a9e3c22af37c748ea5a417f6fb66601e21


--

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2019-10-08 Thread Steve Dower

Steve Dower  added the comment:

You're right, they need either your patch or PyErr_WriteUnraisable(NULL) before 
returning.

Łukasz - this needs a fix in 3.8, but we don't have to necessarily change the 
(internal, but exposed) ABI. For 3.9, we'll fix it properly, but for 3.8 I'll 
let you make the call whether we can also add a return value to these functions.

-PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *);
+PyAPI_FUNC(int) _PyEval_SetAsyncGenFirstiter(PyObject *);
 PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void);
-PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *);
+PyAPI_FUNC(int) _PyEval_SetAsyncGenFinalizer(PyObject *);

--
keywords: +newcomer friendly
nosy: +lukasz.langa
priority: normal -> release blocker

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16244
pull_request: https://github.com/python/cpython/pull/16661

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16245
pull_request: https://github.com/python/cpython/pull/16662

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16246
pull_request: https://github.com/python/cpython/pull/16663

___
Python tracker 

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



[issue38411] SQLITE_MISUSE race condition in sqlite3 is misleadingly raised as a binding error

2019-10-08 Thread Jack Robison


Change by Jack Robison :


--
type:  -> behavior

___
Python tracker 

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



[issue38294] Documentation on 3.6->3.7 re.escape no longer escaping "/" or ":" should be obvious

2019-10-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 43f5c0c4d0a608c04c3978adb45117f3943203b7 by Serhiy Storchaka 
(Ricardo Bánffy) in branch '3.7':
[3.7] bpo-38294: Add list of no-longer-escaped chars to re.escape 
documentation. (GH-16442) (GH-16647)
https://github.com/python/cpython/commit/43f5c0c4d0a608c04c3978adb45117f3943203b7


--

___
Python tracker 

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



[issue38207] subprocess: On Windows, Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ec618af98ac250a91ee9c91f8569e6df6772758 by Victor Stinner in 
branch 'master':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/0ec618af98ac250a91ee9c91f8569e6df6772758


--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-10-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ec618af98ac250a91ee9c91f8569e6df6772758 by Victor Stinner in 
branch 'master':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/0ec618af98ac250a91ee9c91f8569e6df6772758


--

___
Python tracker 

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



[issue38412] csv.reader failed to split string with spaces and quoted delimiter

2019-10-08 Thread belegnar


New submission from belegnar :

```
>>> list(csv.reader(['param1,"param21,param22",param3']))
[['param1', 'param21,param22', 'param3']]
>>> list(csv.reader(['param1, "param21,param22", param3']))
[['param1', ' "param21', 'param22"', ' param3']]
```

version 3.7.4 on linux

--
components: Library (Lib)
messages: 354224
nosy: belegnar
priority: normal
severity: normal
status: open
title: csv.reader failed to split string with spaces and quoted delimiter
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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-10-08 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 2784e78dc3445c6dd59e915d86c336374c1fa09a by larryhastings (Jason 
R. Coombs) in branch '3.5':
[3.5] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (#16475)
https://github.com/python/cpython/commit/2784e78dc3445c6dd59e915d86c336374c1fa09a


--

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-10-08 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 2784e78dc3445c6dd59e915d86c336374c1fa09a by larryhastings (Jason 
R. Coombs) in branch '3.5':
[3.5] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (#16475)
https://github.com/python/cpython/commit/2784e78dc3445c6dd59e915d86c336374c1fa09a


--
nosy: +larry

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-10-08 Thread Larry Hastings


Change by Larry Hastings :


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



[issue1724822] provide a shlex.split alternative for Windows shell syntax

2019-10-08 Thread Eli Schwartz


Change by Eli Schwartz :


--
nosy: +eschwartz

___
Python tracker 

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



[issue31722] _io.IncrementalNewlineDecoder doesn't inherit codecs.IncrementalDecoder

2019-10-08 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue31722] _io.IncrementalNewlineDecoder doesn't inherit codecs.IncrementalDecoder

2019-10-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-08 Thread Ronan Lamy


Change by Ronan Lamy :


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

___
Python tracker 

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



[issue38307] Provide Class' end line in readmodule module

2019-10-08 Thread Aviral


Change by Aviral :


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

___
Python tracker 

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



[issue38413] Remove or change "Multithreading" section

2019-10-08 Thread Vladimir Ryabtsev


New submission from Vladimir Ryabtsev :

This is regarding the page https://docs.python.org/3.7/library/sqlite3.html.

I believe this section on the very bottom of the page has been kept here for 
pretty long time, during that both SQLite and the sqlite3 module evolved and 
improved. Now the content contradicts to the description of function 
"connect()" in the part describing "check_same_thread" parameter. The function 
description says that using connections from multiple threads is allowed with 
serialization handled by the user (and it is true), while the bottom 
"Mutithreading" section says sharing connections is not allowed.

I think we can remove "Mutithreading" section entirely unless there is 
something important to add to what already mentioned.

--
assignee: docs@python
components: Documentation
messages: 354227
nosy: Vladimir Ryabtsev, docs@python
priority: normal
severity: normal
status: open
title: Remove or change "Multithreading" section
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



[issue38307] Provide Class' end line in readmodule module

2019-10-08 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Umar Asghar


New submission from Umar Asghar :

Python does not preserve ordering in JSON format. I have tested it out but it's 
not working. Here is my code.

# Python3 code to demonstrate 
# Sort nested dictionary by key 
# using OrderedDict() + sorted() 
from collections import OrderedDict 
from operator import getitem 
import json

# initializing dictionary 
test_dict = {'Nikhil' : { 'roll' : 24, 'marks' : 17}, 
'Akshat' : {'roll' : 54, 'marks' : 12}, 
'Akash' : { 'roll' : 12, 'marks' : 15}} 

# printing original dict 
print("The original dictionary : " + str(test_dict)) 

# using OrderedDict() + sorted() 
# Sort nested dictionary by key 
res = OrderedDict(sorted(test_dict.items(), 
key = lambda x: getitem(x[1], 'marks'))) 

print("The sorted dictionary by marks is : " + str(res))
# Output
# The sorted dictionary by marks is : OrderedDict([('Akshat', {'marks': 12, 
'roll': 54}), ('Akash', {'marks': 15, 'roll': 12}), ('Nikhil', {'marks': 17, 
'roll': 24})])

res = json.dumps(res)

# print result 
print("The sorted dictionary by marks is : (json)")
print(json.loads(res)) 
# Output
# The sorted dictionary by marks is : 
# {'Akash': {'marks': 15, 'roll': 12}, 'Akshat': {'marks': 12, 'roll': 54}, 
'Nikhil': {'marks': 17, 'roll': 24}}
Does anyone suggest any solution for it?

It's different than a simple dictionary. It only targets the nested dictionary 
ordering. Please don't mark it a duplication of simple dictionary ordering with 
JSON. thanks

--
messages: 354228
nosy: Umar Asghar
priority: normal
severity: normal
status: open
title: Ordering a nested dictionary in python with json format

___
Python tracker 

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



[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Umar Asghar


Umar Asghar  added the comment:

I guess it exists in all Python versions. I have tested in both Python 2 and 
Python 3.

Python 2.7.15+ (default, Jul  9 2019, 16:51:35) 
[GCC 7.4.0] on linux2

Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux

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



[issue38109] Missing constants in Lib/stat.py

2019-10-08 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Umar Asghar


Change by Umar Asghar :


Added file: https://bugs.python.org/file48649/test.py

___
Python tracker 

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



[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Umar Asghar


Umar Asghar  added the comment:

I have recently attached the file, please review it as a code reference.

--

___
Python tracker 

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



[issue38409] Typo in doc string for str.strip

2019-10-08 Thread Hansraj Das


Change by Hansraj Das :


--
nosy: +hansrajdas

___
Python tracker 

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



[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Umar Asghar


Change by Umar Asghar :


--
versions: +Python 2.7 -Python 3.9

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 526ef856dd598fd3cefdfadeb18ede7a8e57aa41 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
https://github.com/python/cpython/commit/526ef856dd598fd3cefdfadeb18ede7a8e57aa41


--

___
Python tracker 

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



  1   2   >