[issue36743] Docs: Descript __get__ signature defined differently across the docs

2019-04-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Perhaps the datamodel docs can be clarified to note that callers are allowed to 
omit the third argument (which usually only makes sense when the second 
argument is not None). FWIW, section 3.3.2.3 already has an example of a direct 
call to a __get__ descriptor with only the *obj* argument.

--
assignee: docs@python -> rhettinger
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.9

___
Python tracker 

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



[issue36715] Dictionary initialization

2019-04-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue36715] Dictionary initialization

2019-04-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset da63b321f63b697f75e7ab2f88f55d907f56c187 by Raymond Hettinger in 
branch 'master':
bpo-36715: Add usage note for dict.fromkeys() (GH-12974)
https://github.com/python/cpython/commit/da63b321f63b697f75e7ab2f88f55d907f56c187


--
nosy: +rhettinger

___
Python tracker 

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



[issue36743] Docs: Descript __get__ signature defined differently across the docs

2019-04-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +12915
stage:  -> patch review

___
Python tracker 

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



[issue27978] [threading] Executor#shutdown with timeout

2019-04-28 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +pitrou
title: Executor#shutdown with timeout -> [threading] Executor#shutdown with 
timeout
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread Zackery Spytz


New submission from Zackery Spytz :

If the PyUnicode_AsUTF8() call happens to fail in PyObject_SetAttr(), "name" 
will be leaked.

--
components: Interpreter Core
messages: 341025
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: A possible reference leak in PyObject_SetAttr()
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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +12916
stage:  -> patch review

___
Python tracker 

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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

thanks!

--
nosy: +asvetlov
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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread miss-islington


miss-islington  added the comment:


New changeset e0dcb85b7d64153d1741698c04a6736c9669603a by Miss Islington (bot) 
(Zackery Spytz) in branch 'master':
bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)
https://github.com/python/cpython/commit/e0dcb85b7d64153d1741698c04a6736c9669603a


--
nosy: +miss-islington

___
Python tracker 

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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12917

___
Python tracker 

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



[issue23297] Clarify error when ‘tokenize.detect_encoding’ receives text

2019-04-28 Thread Berker Peksag


Berker Peksag  added the comment:

The original problem has already been solved by making 
tokenize.generate_tokens() public in issue 12486.

However, the same exception can be raised when tokenize.open() is used with 
tokenize.tokenize(), because it returns a text stream:


https://github.com/python/cpython/blob/da63b321f63b697f75e7ab2f88f55d907f56c187/Lib/tokenize.py#L396

hello.py


def say_hello():
print("Hello, World!")

say_hello()


text.py
---

import tokenize

with tokenize.open('hello.py') as f:
token_gen = tokenize.tokenize(f.readline)
for token in token_gen:
print(token)

When we pass f.readline to tokenize.tokenize(), the second call to 
detect_encoding() fails, because f.readline() returns str.

In Lib/test/test_tokenize.py, it seems like tokenize.open() is only tested to 
open a file. Its output isn't passed to tokenize.tokenize(). Most of the tests 
either pass the readline() method of open(..., 'rb') or io.BytesIO() to 
tokenize.tokenize().

I will submit a documentation PR that suggests to use 
tokenize.generate_tokens() with tokenize.open().

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue36745] A possible reference leak in PyObject_SetAttr()

2019-04-28 Thread miss-islington


miss-islington  added the comment:


New changeset 896c6357f3267fe5dc5a33979f8cf46b0a74cfee by Miss Islington (bot) 
in branch '3.7':
bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)
https://github.com/python/cpython/commit/896c6357f3267fe5dc5a33979f8cf46b0a74cfee


--

___
Python tracker 

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



[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-04-28 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
pull_requests: +12918

___
Python tracker 

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-04-28 Thread Stefan Behnel


Change by Stefan Behnel :


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

___
Python tracker 

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-04-28 Thread Stefan Behnel


Stefan Behnel  added the comment:

PR submitted, feedback welcome.

--
assignee:  -> scoder
type: behavior -> enhancement

___
Python tracker 

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



[issue36746] Create test for fcntl.lockf()

2019-04-28 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
pull_requests: +12920
stage:  -> patch review

___
Python tracker 

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



[issue36746] Create test for fcntl.lockf()

2019-04-28 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

We need to implement a test for fcntl.lockf().

--
components: Tests
messages: 341031
nosy: christian.heimes, nanjekyejoannah
priority: normal
severity: normal
status: open
title: Create test for fcntl.lockf()
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



[issue36746] Create test for fcntl.lockf()

2019-04-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I have opened a PR with this test. If you think its great, we can use the same 
test to test posix.lock(). The one I have written in more detailed than the 
current test for posix.lock().

--

___
Python tracker 

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



[issue36740] zipimporter misses namespace packages for implicit dirs

2019-04-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is a duplicate of issue 14905.

--
nosy: +eric.smith

___
Python tracker 

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



[issue36746] Create test for fcntl.lockf()

2019-04-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I have opened a PR with this test. If you think its great, we can use the same 
test to test posix.lockf(). The one I have written in more detailed than the 
current test for posix.lockf().

Correcting the above  comment.

--

___
Python tracker 

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



[issue36747] Tools/scripts/setup.py is missing

2019-04-28 Thread Xavier de Gaye


New submission from Xavier de Gaye :

The 'scriptsinstall' Makefile target runs the $(srcdir)/Tools/scripts/setup.py 
script that does not exist anymore. It has been removed by changeset 
d3f467ac7441a100eb26412424c2dd96ec3ceb67 (found after running 'cd 
Tools/scripts/ && git log --diff-filter=D --summary .'). Its content was then:

from distutils.core import setup

if __name__ == '__main__':
setup(
  scripts=[
'byteyears.py',
'checkpyc.py',
'copytime.py',
'crlf.py',
'dutree.py',
'ftpmirror.py',
'h2py.py',
'lfcr.py',
'../i18n/pygettext.py',
'logmerge.py',
'../../Lib/tabnanny.py',
'../../Lib/timeit.py',
'untabify.py',
],
  )

--
components: Build
messages: 341035
nosy: xdegaye
priority: normal
severity: normal
status: open
title: Tools/scripts/setup.py is missing
type: behavior
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



[issue36546] Add quantiles() to the statistics module

2019-04-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +12921

___
Python tracker 

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



[issue36747] Tools/scripts/setup.py is missing

2019-04-28 Thread Berker Peksag


Berker Peksag  added the comment:

IMO, it would be better if we just remove the scriptsinstall target.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue36740] zipimporter misses namespace packages for implicit dirs

2019-04-28 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> zipimport needs to support namespace packages when no 
'directory' entry exists

___
Python tracker 

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



[issue36730] Change outdated references to macOS

2019-04-28 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report! This is already reported by Ned at 
https://github.com/python/pythondotorg/issues/1254 Closing this as 'third 
party'.

--
nosy: +berker.peksag
resolution:  -> third party
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



[issue26868] Document PyModule_AddObject's behavior on error

2019-04-28 Thread Nir Soffer


Change by Nir Soffer :


--
nosy: +nirs

___
Python tracker 

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



[issue23297] Clarify error when ‘tokenize.detect_encoding’ receives text

2019-04-28 Thread Ben Finney

Ben Finney  added the comment:

On 28-Apr-2019, Berker Peksag wrote:

> The original problem has already been solved by making
> tokenize.generate_tokens() public in issue 12486.

I don't understand how that would affect the resolution of this issue.

Isn't the correct resolution here going to entail correct
implementation in ‘file.readline’?

--

___
Python tracker 

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



[issue22412] Towards an asyncio-enabled command line

2019-04-28 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

I believe https://bugs.python.org/issue34616 is related as it track async-exec 
and seem to have a couple of devs that are favorable to it.

--
nosy: +mbussonn

___
Python tracker 

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



[issue36729] Delete unused text variable on tests

2019-04-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 86f0c8215c2fdaeef58d185ff00b854a45971f84 by Serhiy Storchaka 
(Emmanuel Arias) in branch 'master':
bpo-36729: Delete unused text variable on tests. (GH-12959)
https://github.com/python/cpython/commit/86f0c8215c2fdaeef58d185ff00b854a45971f84


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-04-28 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Łukasz, are you ok if we include this one in alpha4 as we were discussing in 
the PRs? If you are happy with that I will merge it so there is early testing 
and then we can keep working on the documentation and minor details for the 
next stage. If not, please, unmark it as a release blocker.

--

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-04-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue36546] Add quantiles() to the statistics module

2019-04-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset db81ba1393af40ba920a996651e2c11943c3663c by Raymond Hettinger in 
branch 'master':
bpo-36546: More tests: type preservation and equal inputs (#13000)
https://github.com/python/cpython/commit/db81ba1393af40ba920a996651e2c11943c3663c


--

___
Python tracker 

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-04-28 Thread Stefan Behnel


Stefan Behnel  added the comment:

BTW, I found that lxml and ET differ in their behaviour when searching for '*'. 
ET takes it as meaning "any tree node", whereas lxml interprets it as "any 
Element". Since ET's parser does not create comments and processing 
instructions by default, this does not make a difference in most cases, but 
when the tree contains comments or PIs, then they will be found by '*' in ET 
but not in lxml.

At least for "{*}*", they now both return only Elements. Changing either 
behaviour for '*' is probably not a good idea at this point.

--

___
Python tracker 

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



[issue36546] Add quantiles() to the statistics module

2019-04-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +12922

___
Python tracker 

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



[issue36748] Optimize textio write buffering

2019-04-28 Thread Inada Naoki


New submission from Inada Naoki :

textio uses list of textio for internal buffering.  There are two inefficiency:

* When textio is line buffered and all written strings are line (it's very 
common), list object is allocated and freed.
* We convert texts into bytes, and call b''.join(list_of_bytes).  But when 
texts are ASCII and codecs are ASCII-compat, we can skip temporary bytes 
objects.

Attached patch is benchmark for buffered and line buffered write.

Faster (6):
- write_ascii_32k: 101 ns +- 1 ns -> 73.1 ns +- 0.4 ns: 1.39x faster (-28%)
- write_ascii_8k: 102 ns +- 1 ns -> 73.4 ns +- 0.4 ns: 1.38x faster (-28%)
- write_ascii_linebuffered: 815 ns +- 12 ns -> 731 ns +- 3 ns: 1.12x faster 
(-10%)
- write_unicode_linebuffered: 840 ns +- 11 ns -> 789 ns +- 15 ns: 1.06x faster 
(-6%)
- write_unicode_8k: 124 ns +- 1 ns -> 122 ns +- 1 ns: 1.01x faster (-1%)
- write_unicode_32k: 124 ns +- 1 ns -> 122 ns +- 1 ns: 1.01x faster (-1%)

--
components: IO
files: bm_textio.py
messages: 341044
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Optimize textio write buffering
type: performance
versions: Python 3.8
Added file: https://bugs.python.org/file48289/bm_textio.py

___
Python tracker 

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



[issue36748] Optimize textio write buffering

2019-04-28 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +12923
stage:  -> patch review

___
Python tracker 

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