[issue38426] declare visit_validate in Py_DEBUG macro

2019-10-09 Thread Dong-hee Na

New submission from Dong-hee Na :

I've got the warining like this.

Modules/gcmodule.c:1925:1: warning: ‘visit_validate’ defined but not used 
[-Wunused-function]
 visit_validate(PyObject *op, void *parent_raw)

This looks like only used in pydebug.
I'd like to propose declaring this function only in #ifdef Py_DEBUG.

My environment is 
CentOS Linux release 7.6.1810
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

--
assignee: corona10
components: Interpreter Core
messages: 354313
nosy: corona10, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: declare visit_validate in Py_DEBUG macro
type: enhancement
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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
stage: patch review -> 
versions: +Python 3.8

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-09 Thread Dong-hee Na

New submission from Dong-hee Na :

Python/Python-ast.c: In function ‘PyAST_obj2mod’:
Python/Python-ast.c:10253:12: warning: ‘res’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]

CentOS Linux release 7.6.1810
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

--
assignee: corona10
messages: 354312
nosy: corona10
priority: normal
severity: normal
status: open
title: Remove warning: ‘res’ may be used uninitialized in this function
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



[issue17894] Edits to descriptor howto

2019-10-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I've been working on some updates to the descriptor how-to and will likely post 
next month or so (there have been other priorities for 3.8 and I had had some 
limitations regarding posting my training material).  I'm going in a different 
direction than the patches proposed here and am going to mark this tracker 
issue as closed.  

FWIW, this entry is unique in that it is a work of individual authorship, 
originally posted on my own website.  When the analysis became a popular, I was 
asked to post it on python.org.  I will continue to maintain and improve it but 
am not open to a substantial stylistic rewrite changing it into someone else's 
style (people can use their own blog posts for that purpose).

--
resolution:  -> rejected
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



[issue38424] typing.Generator shorthand

2019-10-09 Thread Dima Tisnek


Dima Tisnek  added the comment:

Actually yes it is sufficient.

I don't know why I didn't think of that!
Perhaps some note in the docs could help other lost children of Python :P

--

___
Python tracker 

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



[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Hey, Can I take on this issue? :-)

Unfortunately, Amir already sent a patch for this.
Please take a look at another issue :)

Thank you

--

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Is Iterator[Whatever] not sufficient for you?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue17123] Add OCSP support to ssl module

2019-10-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Considering OSCP has fallen out of favor relative to CT in recent years, may be 
should simply reject this feature request.

--

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-09 Thread Dima Tisnek


New submission from Dima Tisnek :

Currently to annotate a generator, something like `Generator[str, None, None]` 
is required. Which is a bit confusing and verbose.

Can we allow shorthand, like `Generator[str]` for simple cases?

I'm not entirely certain what the semantics ought to be...
Maybe Generator[t1, t2=Any, t3=None] ?

--
components: Library (Lib)
messages: 354307
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: typing.Generator shorthand
type: enhancement

___
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-09 Thread Dima Tisnek


Dima Tisnek  added the comment:

That would be nice; someone needs to figure out what exact sqlite version 
allows safe passing of connection between threads. Ideally other caveats would 
be covered (is passing open cursors to another thread allowed?, etc...)

--
nosy: +Dima.Tisnek

___
Python tracker 

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



[issue17894] Edits to descriptor howto

2019-10-09 Thread Ammar Askar


Ammar Askar  added the comment:

Any updates on this? Some of the re-organization and simplifications here look 
pretty good overall and make the guide way more approachable.

Seeing as how this has been sitting a while and Github has an option allow 
maintainers to make edits to PRs. Raymond, would you be fine with Ned making a 
PR out of these changes to solicit your feedback and incorporate it the way you 
want?

--
nosy: +ammar2

___
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-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16273
pull_request: https://github.com/python/cpython/pull/16687

___
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-09 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the report, Bob!

--
keywords:  -newcomer friendly
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue38409] Typo in doc string for str.strip

2019-10-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset a774ac6637e8f155a28b7733a0a93d4a680584d4 by Zachary Ware in 
branch '3.7':
[3.7] bpo-38409: Fix grammar in str.strip() docstring (GH-16682) (GH-16686)
https://github.com/python/cpython/commit/a774ac6637e8f155a28b7733a0a93d4a680584d4


--

___
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-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 0baa6b3c7d9ef1d96f10939c40f8ff95aba9155b by Zachary Ware (Miss 
Islington (bot)) in branch '3.8':
bpo-38409: Fix grammar in str.strip() docstring (GH-16682) (GH-16684)
https://github.com/python/cpython/commit/0baa6b3c7d9ef1d96f10939c40f8ff95aba9155b


--

___
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.30 in Windows and macOS installer builds

2019-10-09 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Update: Tested on macOS 10.14.6 with make test on 2.7.17rc1, 3.7.5rc1+, 
3.8.0rc1+.

--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset a081e931505f190b5ccdff9a781e59b3f13fcc31 by Miss Islington (bot) 
(Pablo Galindo) in branch '3.7':
[3.7] bpo-38379:  don't claim objects are collected when they aren't (GH-16658) 
(GH-16685)
https://github.com/python/cpython/commit/a081e931505f190b5ccdff9a781e59b3f13fcc31


--

___
Python tracker 

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



[issue24560] codecs.StreamReader doesn't work with nonblocking streams: TypeError: can't concat bytes to NoneType

2019-10-09 Thread Fritz Reese


Fritz Reese  added the comment:

This is still an issue on Linux in both 3.4 and 3.7 even when using io.open() 
as suggested by @vstinner:

>>> import io, os, fcntl
>>> r, w = os.pipe()
>>> fcntl(r, fcntl.F_SETFL, os.O_NONBLOCK)
0
>>> stream = io.open(r, 'rt')
>>> stream
<_io.TextIOWrapper name=X mode='rt' encoding='UTF-8'>
>>> stream.buffer
<_io.BufferedReader name=X>
>>> print(repr(stream.buffer.read()))
None
>>> stream.read()
Traceback (most recent call last):
  ...
  File ".../python3.7/codecs.py"..., in decode
data = self.buffer + input
TypeError: can't concat NoneType to bytes

The error is present in at least 3.4 up to 3.7 where the underlying 
buffer.read() returns None which is not handled by the TextIOStream.

--
nosy: +Fritz Reese
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



[issue38379] finalizer resurrection in gc

2019-10-09 Thread miss-islington


miss-islington  added the comment:


New changeset 0bd9fac7a866ec886ae8f93f9c24dcda6d436929 by Miss Islington (bot) 
(Pablo Galindo) in branch '3.8':
[3.8] bpo-38379:  don't claim objects are collected when they aren't  
(GH-16658) (GH-16683)
https://github.com/python/cpython/commit/0bd9fac7a866ec886ae8f93f9c24dcda6d436929


--
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-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Tim, I have created backports for 3.8 and 3.7 (PR 16683, PR 16685). In my case 
cherry_picker ecbf35f9335b0420cb8adfda6f299d6747a16515 3.7 and cherry_picker 
ecbf35f9335b0420cb8adfda6f299d6747a16515 3.8 works after fixing merge 
conflicts. Maybe there is something going on in your git repo (maybe you didn't 
fetch from master first and that is why git log fails?).

--

___
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-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16271
pull_request: https://github.com/python/cpython/pull/16685

___
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-09 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests: +16272
pull_request: https://github.com/python/cpython/pull/16686

___
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-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 09895c27cd8ff60563a794016e8c099bc897cc74 by Zachary Ware in 
branch 'master':
bpo-38409: Fix grammar in str.strip() docstring (GH-16682)
https://github.com/python/cpython/commit/09895c27cd8ff60563a794016e8c099bc897cc74


--
nosy: +zach.ware

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16270
pull_request: https://github.com/python/cpython/pull/16684

___
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-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +16269
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/16683

___
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-09 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests: +16268
pull_request: https://github.com/python/cpython/pull/16682

___
Python tracker 

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



[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread Dema Abu Adas


Dema Abu Adas  added the comment:

Hey, Can I take on this issue? :-)

--
nosy: +de-ma

___
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-09 Thread Hansraj Das


Change by Hansraj Das :


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

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

We should not provide such an "run arbitrary python code before execing the 
ultimate child" feature in the standard library.

It is complicated, and assumes you have an ability to execute a new interpreter 
with its own slow startup time as an intermediate in the child in the first 
place.  (embedded pythons do not have that ability)

Leave that to someone to implement on top of subprocess as a thing on PyPI.

--

___
Python tracker 

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



[issue17123] Add OCSP support to ssl module

2019-10-09 Thread Daniel Kahn Gillmor


Daniel Kahn Gillmor  added the comment:

It would be great to see at least minimal OCSP stapling support (in the form of 
callbacks on the client and server sides) availabl in the ssl module, similar 
to the way that pyopenssl has added such callbacks:

https://github.com/pyca/pyopenssl/pull/580

If that was present in the ssl module, then it would let other implementations 
supply reasonable callback functionality for fetching and relaying stapled OCSP 
responses (on the server side) and validating in-band OCSP responses (on the 
client side).

--
nosy: +dkg

___
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-09 Thread Tim Peters


Tim Peters  added the comment:

I checked the stat fix into master, but GH failed to backport to 3.7 or 3.8 and 
I'm clueless.  More info in the PR.  Does someone else here know how to get a 
backport done?

--
stage: patch review -> backport needed
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



[issue38379] finalizer resurrection in gc

2019-10-09 Thread Tim Peters


Tim Peters  added the comment:


New changeset ecbf35f9335b0420cb8adfda6f299d6747a16515 by Tim Peters in branch 
'master':
bpo-38379:  don't claim objects are collected when they aren't (#16658)
https://github.com/python/cpython/commit/ecbf35f9335b0420cb8adfda6f299d6747a16515


--

___
Python tracker 

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



[issue38423] Event loop implementation docs advertise set_event_loop which doesn't work with asyncio.run

2019-10-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

Yes, docs updates sound good.

--

___
Python tracker 

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



[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread Amir Mohamadi


Change by Amir Mohamadi :


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

___
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-09 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +ghaering

___
Python tracker 

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



[issue38423] Event loop implementation docs advertise set_event_loop which doesn't work with asyncio.run

2019-10-09 Thread Hrvoje Nikšić

Change by Hrvoje Nikšić :


--
title: Event loop implementation docs advertise set_event_loop -> Event loop 
implementation docs advertise set_event_loop which doesn't work with asyncio.run

___
Python tracker 

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



[issue38423] Event loop implementation docs advertise set_event_loop

2019-10-09 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić :

The docs of SelectorEventLoop and ProactorEventLoop contain examples that call 
asyncio.set_event_loop:

  selector = selectors.SelectSelector()
  loop = asyncio.SelectorEventLoop(selector)
  asyncio.set_event_loop(loop)

But this won't have any effect on code that uses asyncio.run(), because 
asyncio.run() creates a fresh event loop. Since asyncio.run() is the 
recommended way to execute async code and is used consistently throughout the 
documentation, this might be confusing to someone who tries to e.g. use the 
proactor loop on Windows.

I propose the following:

* add a disclaimer that instantiating the event loop won't affect calls to 
asyncio.run(), and that loop.run_until_complete() must be used; and

* link to asyncio.set_event_loop_policy(), which does work with asyncio.run(), 
but doesn't allow fine-tuning the details, such as which selector to use for 
the SelectorEventLoop.

--
assignee: docs@python
components: Documentation, asyncio
messages: 354288
nosy: asvetlov, docs@python, hniksic, yselivanov
priority: normal
severity: normal
status: open
title: Event loop implementation docs advertise set_event_loop
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



[issue17254] add thai encoding aliases to encodings.aliases

2019-10-09 Thread Benjamin Wood


Benjamin Wood  added the comment:

I've created the codepage alias 874.

This is only pending is a merge into the mainline.

Thanks.

--

___
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-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Amir maybe you can update the docs to add an example of how to do this (if 
there isn't already one there).

--

___
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.30 in Windows and macOS installer builds

2019-10-09 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI: Compiled cpython 3.9 with sqlite-3.30 on macOS 10.14.6. Make test 
completes without errors.

--

___
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-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Okay, then I'll close this.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
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.30 in Windows and macOS installer builds

2019-10-09 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

bpo-38380: Update Windows builds to use SQLite 3.30.0
https://github.com/erlend-aasland/cpython/commit/e25214e6fa7a64353d9c3e16b139c41f5d62eb31

--
Added file: 
https://bugs.python.org/file48652/0002-bpo-38380-Update-Windows-builds-to-use-SQLite-3.30.0.patch

___
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.30 in Windows and macOS installer builds

2019-10-09 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

bpo-38380: Update macOS installer to use SQLite 3.30.0
https://github.com/erlend-aasland/cpython/commit/aa7d7b1a3bed9a6a73f0611d0542a3442e85b0b6

--
keywords: +patch
Added file: 
https://bugs.python.org/file48651/0001-bpo-38380-Update-macOS-installer-to-use-SQLite-3.30..patch

___
Python tracker 

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



[issue38422] Clarify docstrings of pathlib suffix(es)

2019-10-09 Thread Ram Rachum


Change by Ram Rachum :


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

___
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.30 in Windows and macOS installer builds

2019-10-09 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

I've prepared a PR for https://github.com/python/cpython-source-deps at 
https://github.com/erlend-aasland/cpython-source-deps/tree/upgrade-sqlite. 

Patches for Windows and macOS installer builds on 3.9 prepared at 
https://github.com/erlend-aasland/cpython/tree/fix-issue-38380.

If it looks ok, I'll create PR's for CPython and cpython-source-deps. I guess 
this should be backported to 3.8, 3.7 and 2.7.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue38422] Clarify docstrings of pathlib suffix(es)

2019-10-09 Thread Ram Rachum


New submission from Ram Rachum :

I'm writing a PR for this right now.

--
components: Library (Lib)
messages: 354279
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Clarify docstrings of pathlib suffix(es)
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



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

2019-10-09 Thread STINNER Victor


STINNER Victor  added the comment:

The initial issue has been fixed in branches 3.7, 3.8 and master. I close the 
issue. Thanks to everybody who help to make these changes possible and helped 
to debug regressions.

It's not perfect, regrtest has to workaround bpo-38207 bug, but at least 
regrtest should no longer runs for several hours or days.



> regrtest should kill a worker process if it runs longer than --timeout 
> seconds.

The main regrtest process now kills a worker process running longer than 
timeout seconds. In practice, it's timeout x 1.5, to give time to the 
faulthandler watchdog to kill the process.

If regrtest hits bpo-38207 bug, regrtest takes 2 min 30 sec to exit in the 
worst case.


> But it means that the main process was stuck for longer than 60 seconds!? The 
> main process is supposed to write an update "running: ..." every 30 seconds. 
> This buildbot is very slow. Maybe 30 and 60 seconds limits are too low?

I changed this timeout from 1 minute to 5 minutes.


> Calling popen.kill() + popen.stdout.close() + popen.stderr.close() from a 
> thread B does not always interrupt popen.communicate() in thread A.

I propose to continue the discussion in bpo-38207 "subprocess: On Windows, 
Popen.kill() + Popen.communicate() is blocking until all processes using the 
pipe close the pipe".

I implemented workarounds in regrtest so regrtest doesn't block *forever*: it 
only waits 30 seconds until a worker thread completes, and I added a timeout of 
2 minutes on Python exit of the main regrtest process to prevent blocking in 
threading._shutdown(), because of the blocked threads.


> I don't understand why you get 2 typeperf.exe process: only the main process 
> should spawn one. Worker processes don't need it and should not spawn it.

I didn't check on my Windows VM if I have the issue. If someone sees more than 
one typeperf.exe process, please open a separated issue.

Note: typeperf.exe is the correct spelling (typepref.exe is a typo ;-)).

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



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

2019-10-09 Thread STINNER Victor


STINNER Victor  added the comment:

regrtest now workarounds this issue using timeouts on subprocess.Popen.wait() 
and threading.Thread.join() operations: see bpo-37531.

--

___
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-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Then I find insufficient reason to change the API. Users who need this
frequently can make their own wrapper.
-- 
--Guido (mobile)

--

___
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-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, that does work:

>>> urllib.parse.urlunparse(("http", f"{host}:{port}", "/", "", "", ""))
'http://hostname:1234/'



The only problem is that your code now needs to look like

>>> port=None
>>> urllib.parse.urlunparse(("http", f"{host}{(':' + str(port)) if port else 
>>> ''}", "/", "", "", ""))
'http://hostname/'

--

___
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-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Does it work if you pass a string of the form "host:port" as the host field?

I'd rather not change this antiquated interface too much, and I don't like 
proliferating additional functions.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-09 Thread Mariatta


Mariatta  added the comment:

No decision yet. We're waiting for Julien's input. Thanks.

--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset 359a1975cbca488ccd5ea13bd7268d7e88664078 by Miss Islington (bot) 
in branch '3.8':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/359a1975cbca488ccd5ea13bd7268d7e88664078


--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset 359a1975cbca488ccd5ea13bd7268d7e88664078 by Miss Islington (bot) 
in branch '3.8':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/359a1975cbca488ccd5ea13bd7268d7e88664078


--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset 598bfa4d457d61431142ad99ecbb9bd10cf314e6 by Miss Islington (bot) 
in branch '3.7':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/598bfa4d457d61431142ad99ecbb9bd10cf314e6


--
nosy: +miss-islington

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset 598bfa4d457d61431142ad99ecbb9bd10cf314e6 by Miss Islington (bot) 
in branch '3.7':
bpo-37531: regrtest ignores output on timeout (GH-16659)
https://github.com/python/cpython/commit/598bfa4d457d61431142ad99ecbb9bd10cf314e6


--
nosy: +miss-islington

___
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-09 Thread David Kernan


Change by David Kernan :


--
pull_requests:  -16262

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread Roundup Robot


Change by Roundup Robot :


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

___
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-09 Thread David Kernan


Change by David Kernan :


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

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread David Kernan


Change by David Kernan :


--
assignee:  -> docs@python
components: +Documentation -email
nosy: +docs@python

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16258
pull_request: https://github.com/python/cpython/pull/16676

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16257
pull_request: https://github.com/python/cpython/pull/16676

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16260
pull_request: https://github.com/python/cpython/pull/16677

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16259
pull_request: https://github.com/python/cpython/pull/16677

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread David Kernan


David Kernan  added the comment:

Ah yes, thanks, this does seem pretty intentional.

I'll submit a PR for the documentation for this method for the affected version.

--

___
Python tracker 

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



[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +easy

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It looks like a documentation issue to me given the change and tests made in 
https://github.com/python/cpython/commit/875048bd4c95ae90c3e541cad681b11436ce1f3f

--
nosy: +xtreak

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +maxking

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-09 Thread Ido Michael


Ido Michael  added the comment:

So what was decided?

I can fix this issue and I can wait for a final conclusion as it wasn't clear 
from the thread.

--
nosy: +Ido Michael

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None" as the tz offset

2019-10-09 Thread David Kernan


Change by David Kernan :


--
title: email.utils.parsetime_tz does not return "None" -> 
email.utils.parsetime_tz does not return "None" as the tz offset

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None"

2019-10-09 Thread David Kernan


Change by David Kernan :


--
type:  -> behavior

___
Python tracker 

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



[issue38421] email.utils.parsetime_tz does not return "None"

2019-10-09 Thread David Kernan


New submission from David Kernan :

email.utils.parsetime_tz() is a function which attempts to parse a date, and 
returns a 10-item tuple.
The first 9 items represents a time, and the last item represents the timezone 
offset from UTC.

In Python 2, the original behavior was to return the date, and a "None" value 
when there was no timezone - this is documented here:
https://docs.python.org/3/library/email.utils.html#email.utils.parsedate_tz

In Python 3 however, the code specifically prevents "None" from being returned 
in place of a UTC offset:
https://github.com/python/cpython/blob/3.7/Lib/email/_parseaddr.py#L53-#L54

The Python 3 documentation for email.utils.parsetime_tz() - is still the same 
as the 2.7 documentation, and specifically mentions that should a timezone be 
missing from the string, the last item will be "None"

This isn't the case:

Python 3.6.8:
>>> import email.utils
>>> date_string = 'Wed, 09 Oct 2019 08:32:37'
>>> email.utils.parsedate_tz(date_string)
(2019, 10, 9, 8, 32, 37, 0, 1, -1, 0)


Python 2.7.16:
>>> import email.utils
>>> date_string = 'Wed, 09 Oct 2019 08:32:37'
>>> email.utils.parsedate_tz(date_string)
(2019, 10, 9, 8, 32, 37, 0, 1, -1, None)

---

Is this an error in code, or is it a mistake in the documentation?

--
components: email
messages: 354265
nosy: David Kernan, barry, r.david.murray
priority: normal
severity: normal
status: open
title: email.utils.parsetime_tz does not return "None"
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread hai shi


hai shi  added the comment:

Maybe the keyword need add the `easy` wrod? (i don't know the internals)
newcomer need find it in `Easy issues` ;)

--
nosy: +shihai1991

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-10-09 Thread hongweipeng


hongweipeng  added the comment:

I think we can refer to typing.py, it does not have this issue.

>>> from typing import NamedTuple
>>> A = NamedTuple('A', [('name', str), ('id', int)])
>>> class B(NamedTuple):
...   name: str
...   id: int
... 
>>> A.__module__
'__main__'
>>> B.__module__
'__main__'


It uses `nm_tpl.__module__ = sys._getframe(2).f_globals.get('__name__', 
'__main__')`.

--
nosy: +hongweipeng

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

> In [20]: harmonic_mean([math.nan, 0]) 
>   
> Out[20]: 0

That one seems excusable, for the same sort of reasons that IEEE 754 specifies 
that hypot(nan, inf) is inf rather than nan. Similarly, sumSquare and sumAbs 
from IEEE 754-2008 specify that infinities take precedence over NaNs, on the 
basis that the result doesn't change if the nan is replaced with any non-nan 
value.

--

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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-09 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



[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0b354fc2bfe1a4624551907df396ed36ea8bf4ca by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644). 
(GH-16673)
https://github.com/python/cpython/commit/0b354fc2bfe1a4624551907df396ed36ea8bf4ca


--

___
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-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 87db4d343c9609137f6e62aa3595db610a33842c by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. 
(GH-16641). (GH-16674)
https://github.com/python/cpython/commit/87db4d343c9609137f6e62aa3595db610a33842c


--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-10-09 Thread miss-islington


miss-islington  added the comment:


New changeset 056fa7f52a49a758b1ed5f5a81d8b7ce5c71cec4 by Miss Islington (bot) 
in branch '3.7':
bpo-36953: Delay removal of ABCs from collections. (GH-13409)
https://github.com/python/cpython/commit/056fa7f52a49a758b1ed5f5a81d8b7ce5c71cec4


--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-10-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16256
pull_request: https://github.com/python/cpython/pull/16675

___
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-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Ricardo!

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



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

2019-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16255
pull_request: https://github.com/python/cpython/pull/16674

___
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-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16254
pull_request: https://github.com/python/cpython/pull/16673

___
Python tracker 

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



[issue38315] Provide defaultdict variant that passes key to default_factory

2019-10-09 Thread wang xuancong


wang xuancong  added the comment:

I agree with Mark Amery.
The reason why defaultdict still exists given that everything can be achieved 
by subclassing the built-in dict is because of convenience. I suggest maybe 
Python developer can put it into low priority instead.

--
nosy: +xuancong84

___
Python tracker 

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



[issue38420] defaultdict does not support parametric lambda

2019-10-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

All versions below 3.9 are in feature freeze, so they cannot get new features.

This requested feature is already supported by subclassing ``dict`` and giving 
it a ``__missing__`` method. See issue #38315

--
nosy: +steven.daprano
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.5, Python 3.6, 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



[issue38420] defaultdict does not support parametric lambda

2019-10-09 Thread wang xuancong


New submission from wang xuancong :

A very common use of defaultdict is that if the key exist, use the 
corresponding mapped target, if the key does not exist, use the key itself. 
However, current Python 2/3 defaultdict does not support parametric lambda 
function:

>>> from collections import *
>>> aa=defaultdict(lambda t:t)
>>> aa
defaultdict( at 0x10a55c950>, {})
>>> aa[0]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: () missing 1 required positional argument: 't'
>>>

I would like to suggest that use the dict's query key as the first argument in 
the default lambda function. And use the dict itself as the 2nd argument in the 
default lambda function (e.g., if the key exist, use the mapped target, 
otherwise, use the size of the current defaultdict). I think that will make 
Python much more powerful than any other programming language. Anyone can think 
of any additional information for the default lambda function? Thanks!

--
messages: 354255
nosy: xuancong84
priority: normal
severity: normal
status: open
title: defaultdict does not support parametric lambda
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



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

2019-10-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
resolution:  -> not a bug

___
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-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

No problem, happy it helped :)

--

___
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-09 Thread belegnar


belegnar  added the comment:

Yes, https://docs.python.org/3/library/csv.html#csv.Dialect.skipinitialspace 
helps
Sorry

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



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

2019-10-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please add a description of the expected behavior? Does 
skipinitialspace help with the second input?

https://docs.python.org/3/library/csv.html#csv.Dialect.skipinitialspace

>>> import csv
>>> list(csv.reader(['param1,"param21,param22",param3']))
[['param1', 'param21,param22', 'param3']]
>>> list(csv.reader(['param1, "param21,param22", param3']))
[['param1', ' "param21', 'param22"', ' param3']]
>>> list(csv.reader(['param1, "param21,param22", param3'], 
>>> skipinitialspace=True))
[['param1', 'param21,param22', 'param3']]
>>> list(csv.reader(['param1,"param21,param22",param3'])) == 
>>> list(csv.reader(['param1, "param21,param22", param3'], 
>>> skipinitialspace=True))
True

--
nosy: +xtreak

___
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-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Dictionary preserve the insertion order starting from Python 3.7 (actually from 
3.6, but it was not guarantied). I am surprised that you got different result 
in 3.6. I cannot reproduce it.

In older Python versions you can pass object_pairs_hook=OrderedDict to 
json.loads() to preserve the insertion order. The regular dictionary cannot 
preserve it, by its structure.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
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