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

2017-06-07 Thread Aaron Hall

Aaron Hall added the comment:

I tweaked the docs a little more this morning, but I believe I am done making 
any further changes unless so requested.

This issue doesn't say it's assigned to anyone. Is there anything else that 
needs to happen here?

--

___
Python tracker 

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



[issue30589] With forkserver, Process.exitcode does not get signal number

2017-06-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +2055

___
Python tracker 

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



[issue30589] With forkserver, Process.exitcode does not get signal number

2017-06-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review

___
Python tracker 

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



[issue30581] os.cpu_count() returns wrong number of processors on system with > 64 logical processors

2017-06-07 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Nobody has AFAIK.

--

___
Python tracker 

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



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-07 Thread Noah Levitt

New submission from Noah Levitt:

As far as I can tell, sqlite3 executescript() does not respect isolation_level. 
Is that true? If so, I think it's worth mentioning in the doc. Or maybe it 
should respect isolation_level, not sure there's any particular reason not to.

--
components: Library (Lib)
messages: 295376
nosy: Noah Levitt
priority: normal
severity: normal
status: open
title: sqlite3 executescript does not respect isolation_level?
versions: Python 2.7, Python 3.4, 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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2017-06-07 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> needs patch

___
Python tracker 

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



[issue30542] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

Attached test_unparse.py file should be copied to 
Lib/test/test_tools/test_unparse.py to run:

./python -m test -R 1:2 -m test_files test_tools

With this change, I get this output:
---
haypo@selma$ ./python -m test -R 1:2 -m test_files test_tools
Run tests sequentially
0:00:00 load avg: 0.12 [1/1] test_tools
beginning 3 repetitions
123
...
test_tools leaked [6, 19] references, sum=25
test_tools leaked [3, 5] memory blocks, sum=8
test_tools failed

1 test failed:
test_tools

Total duration: 223 ms
Tests result: FAILURE
---

--
Added file: http://bugs.python.org/file46931/test_unparse.py

___
Python tracker 

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



[issue1207613] Idle Editor: Bottom Scroll Bar

2017-06-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Output Window definitely needs a scrollbar available on screens where it cannot 
be stretched to 160 chars or so.  Thinking about it, if one greps idlelib in a 
local install, with a url something like 
C:/users/somename/appdata/local/python/lib/idlelib/*.py, one only needs 100 
chars to pick up the idlelib file name and code, but needs the scrollbar to 
display the last 100 chars instead of the first 100 chars.

To add to msg16443: the fact that one can stretch the window much wider than 80 
chars means that omitting a scrollbar does not enforce an 80-char limit.

--

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for catching this bug SylvainDe. This is a regression caused by 
issue30534. I added "()" after the function name for unifying with other error 
messages but missed that _PyArg_NoKeywords() often is called with argument 
containing "()", e.g. _PyArg_NoKeywords("bool()", kwds).

There are two ways to solve this issue:

1. Remove "()" from all calls of _PyArg_NoKeywords(), _PyArg_NoStackKeywords() 
and _PyArg_NoPositional() and let these functions to add "()" automatically. 
This will change almost all manually calls of _PyArg_NoKeywords(). And may be 
in some cases "()" shouldn't be added.

2. Make _PyArg_NoKeywords(), _PyArg_NoStackKeywords() and _PyArg_NoPositional() 
not adding "()" automatically, but always pass a name with "()" if it is 
needed. Argument Clinic should be changed to add "()" in arguments of these 
functions. This is large patch, but mostly generated.

I don't know what the way is better.

--

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe

SylvainDe added the comment:

The issue seems to be in:

int
_PyArg_NoKeywords(const char *funcname, PyObject *kwargs)


I'm happy to submit a PR if needed.

--

___
Python tracker 

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



[issue30542] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords:  -easy (C)

___
Python tracker 

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



[issue30542] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I tagged the issue too early as "[EASY]" while it's a super complex 
bug... I'm unable to say if the issue is a real leak or not...

--
title: [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks 
references -> test_files() of test_tools.test_unparse.DirectoryTestCase leaks 
references

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe

SylvainDe added the comment:

Reproduced locally using unit tests:

+def test_varargs0_kw(self):
+msg = r"bool\(\) takes no keyword arguments"
+self.assertRaisesRegex(TypeError, msg, bool, x=2)
+


giving:

Traceback (most recent call last):
  File "/home/josay/Geekage/PythonRgr/cpython/Lib/test/test_call.py", line 136, 
in test_varargs0_kw
self.assertRaisesRegex(TypeError, msg, bool, x=2)
AssertionError: "bool\(\) takes no keyword arguments" does not match "bool()() 
takes no keyword arguments"

--

___
Python tracker 

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



[issue25514] Improve IDLE's "subprocess didn't make connection" message

2017-06-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#26413 is about fixing shadowing problem.

Current thought for this issue: add a section to IDLE doc listing known 
possible causes (message above).  Reference section in message, giving web link.

--

___
Python tracker 

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



[issue30591] textwrap: placeholder backtracking special case lacks test coverage

2017-06-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +Interpreter Core
nosy: +serhiy.storchaka
type: enhancement -> 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



[issue30591] textwrap: placeholder backtracking special case lacks test coverage

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 5edf827c8052958b9d293f75ce8d93b66c1d58da by Serhiy Storchaka 
(Jonathan Eunice) in branch 'master':
bpo-30591: Added test for textwrap backtracking. (#1988)
https://github.com/python/cpython/commit/5edf827c8052958b9d293f75ce8d93b66c1d58da


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread Nikhil Patel

Nikhil Patel added the comment:

I'd like to respectfully disagree with the suggestions/conclusions mentioned 
here. I'll explain my reasoning and conclusions below.

First the short version - I'm fairly confident the leak actually has to do 
with: 
https://github.com/python/cpython/blob/master/Lib/test/test_tools/test_unparse.py#L282


my approach:

It was initially implied that we can begin to pinpoint the leak from within the 
test_files() method in test_tools.test_unparse.DirectoryTestCase.

I ran the tests using the command:
python_d -m test -R 3:3 test_tools.test_unparse -m test_files

I had test_files() print the files selected in line 282 (and limited sample 
size to 1).

Result:
(note: i shortened printed pathnames manually after the fact, as it printed the 
absolute paths)

python_d -m test -R 3:3 test_tools.test_unparse -m test_files
Run tests sequentially
0:00:00 [1/1] test_tools.test_unparse
Testing cpython\Lib\test\test_spwd.py
beginning 6 repetitions
123456
Testing cpython\Lib\copy.py
.Testing cpython\Lib\test\test_isinstance.py
.Testing cpython\Lib\test\test_bytes.py
.Testing cpython\Lib\test\test_csv.py
.Testing cpython\Lib\test\test_dynamic.py
.Testing cpython\Lib\test\test_xml_etree.py
.
test_tools.test_unparse leaked [3, 0, 13] references, sum=16
test_tools.test_unparse leaked [6, 2, 4] memory blocks, sum=12
test_tools.test_unparse failed

1 test failed:
test_tools.test_unparse

Total duration: 4 sec
Tests result: FAILURE

Then I made a slight modification: I replaced random.sample(names,1) on line 
282 with a list containing the absolute paths to each of those files it tested 
in the run I described above. That means each of those files would be loaded, 
compiled and their tests run 6 times.

Result:

python_d -m test -R 3:3 test_tools.test_unparse -m test_files
Run tests sequentially
0:00:00 [1/1] test_tools.test_unparse
beginning 6 repetitions
123456
..
1 test OK.

Total duration: 24 sec
Tests result: SUCCESS


Conclusion:
If the same source files are being read, compiled, and their tests run - with 
different results - then I do not believe the leak can be associated with the 
self.checkRoundTrip() method or the compile() method


I don't have an in-depth explanation why this is the case. But removing the 
call to random.sample() fixes the issue, I am reasonably sure of it. 

I presume to say this because I commented out lines 280-282 and instead I made 
it instead iterate through subsets of size 50 using slicing (so names[:50] etc) 
in line 284. I went through the entire set of files, 50 at a time. All ran 
successfully.

--
nosy: +npatel

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe

New submission from SylvainDe:

Very recent "regression". Issue found because of a pet project trying to parse 
error messages using regexps : more on 
https://github.com/SylvainDe/DidYouMean-Python/issues/31 .

On recent Cron builds on Jenkins, running the following code

bool(this_doesnt_exist=2)

fails with the following error message

'bool()() takes no keyword arguments'

instead of the expected error message

'bool() takes no keyword arguments'.


Having a quick look at the recent commits, I suspect with no guarantee 
whatsoever the issue got introduced with 
https://github.com/python/cpython/commit/5eb788bf7f54a8e04429e18fc332db858edd64b6
 / http://bugs.python.org/issue30534 .

I haven't tried to reproduce the issue locally yet and add the findinds if any 
later on.

--
messages: 295366
nosy: SylvainDe
priority: normal
severity: normal
status: open
title: Bad error message 'bool()() takes no keyword arguments'
type: enhancement

___
Python tracker 

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



[issue30591] textwrap: placeholder backtracking special case lacks test coverage

2017-06-07 Thread Jonathan Eunice

Changes by Jonathan Eunice :


--
pull_requests: +2054

___
Python tracker 

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



[issue30581] os.cpu_count() returns wrong number of processors on system with > 64 logical processors

2017-06-07 Thread Chris Wilcox

Chris Wilcox added the comment:

I am going to work on this if no one else has started.

--
nosy: +crwilcox

___
Python tracker 

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



[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-06-07 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There was a bug (see issue18531). It was fixed in 3.6.

Use str.format_map() for formatting with arbitrary mapping.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
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



[issue28686] py.exe ignored PATH when using python3 shebang

2017-06-07 Thread Riccardo Polignieri

Riccardo Polignieri added the comment:

@Jens Lindgren

I know, pretty annoying right? But see previous answer by Paul here 
http://bugs.python.org/issue28686#msg287181

> The Unix ability to have 2 different versions of Python on PATH 
> and select which you use based on executable name doesn't exist 
> on Windows, and so there's no equivalent of the 
> Unix "#!/usr/bin/env pythonX[.Y]"

Now if you ask me, I would expect py.exe to handle all common types of shebang 
you may find in the wild. 
But I assume that the correct answer instead is that "#!/usr/bin/env 
pythonX[.Y]" is not a portable shebang, and you just should stop using it. If 
you happen to find such a shebang in someone else's script, file a bug report 
there.

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-06-07 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3 by Vinay Sajip (Erik 
Bray) in branch 'master':
bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559)
https://github.com/python/cpython/commit/9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3


--

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

I merged your fix. Thanks!

Let's wait for Windows buildbots. If tests pass on buildbots, the change should 
be backported to other branches impacted by the bug.

http://buildbot.python.org/all/waterfall?category=3.x.stable=3.x.unstable

--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:

Good point about not needing 3.5.

Buildbots were clean, so I merged it. Thanks Antoine!

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed
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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:


New changeset ceabf9acf03f9bbe660d856bff90ecab475ab543 by Steve Dower (Antoine 
Pietri) in branch '3.6':
bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893) 
(#1985)
https://github.com/python/cpython/commit/ceabf9acf03f9bbe660d856bff90ecab475ab543


--

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 897bba75632dfce87c355e3cd4700468357715a7 by Victor Stinner (Denis 
Osipov) in branch 'master':
bpo-30584: Fix test_os fails on non-English Windows (#1980)
https://github.com/python/cpython/commit/897bba75632dfce87c355e3cd4700468357715a7


--

___
Python tracker 

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



[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

It seems like compile() only leaks when using PyCF_ONLY_AST:

compile(source, "filename", "exec", ast.PyCF_ONLY_AST)

It's maybe a leak in the PyAST_mod2obj() function when creating dictionaries of 
created AST objects. But in ast_dealloc() of Python/Python-ast.c, I see that a 
"DECREF" (Py_CLEAR) for the dict. Maybe it's something else.

--

___
Python tracker 

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



[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

(Oops, I modified the file while uploading here. I reuploaded the correct 
bug.py.)

--
Added file: http://bugs.python.org/file46930/bug.py

___
Python tracker 

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



[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file46929/bug.py

___
Python tracker 

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



[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

I isolated the leak to attached bug.py script. Output:
---
haypo@selma$ ./python bug.py 
[ Top 10 differences ]
bug.py:40: size=6728 B (+6728 B), count=80 (+80), average=84 B
bug.py:46: size=2464 B (+2464 B), count=28 (+28), average=88 B
bug.py:43: size=2464 B (+2464 B), count=28 (+28), average=88 B
---

It seems like compiling a Python source to AST causes the leak. The Python 
source uses the following bytecodes:

 25 170 LOAD_DEREF   0 (trace)
172 LOAD_METHOD  0 (append)
174 LOAD_CONST   0 (None)
176 CALL_METHOD  1
178 POP_TOP

AST of the code:

Expr(value=Call(func=Attribute(value=Name(id='trace', ctx=Load()), 
attr='append', ctx=Load()), args=[NameConstant(value=None)], keywords=[]))

--
Added file: http://bugs.python.org/file46929/bug.py

___
Python tracker 

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



[issue30591] textwrap: placeholder backtracking special case lacks test coverage

2017-06-07 Thread Jonathan Eunice

New submission from Jonathan Eunice:

A rare case in textwrap when max_lines insufficient and textwrap needs to 
backtrack to a previous line to add the placeholder seems to lack test coverage.

This issue added as prereq for suggesting an additional test. PR imminent.

Code: Lib/textwrap.py (as is)
Test: Lib/test/test_textwrap.py (extended)

--
components: Tests
messages: 295354
nosy: jonathaneunice
priority: normal
severity: normal
status: open
title: textwrap: placeholder backtracking special case lacks test coverage
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Carmen Bianca Bakker

New submission from Carmen Bianca Bakker:

As brief as can be, the following script works in Python 3.4 and Python 3.5:

from collections import defaultdict

mydict = defaultdict(lambda: 'default')

print('{foo}'.format(**mydict))

And prints "default".

In Python 3.6, you get a KeyError for foo.

--
components: Library (Lib)
messages: 295353
nosy: carmenbianca
priority: normal
severity: normal
status: open
title: str.format no longer accepts unpacked defaultdict for default values
versions: Python 3.6

___
Python tracker 

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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2017-06-07 Thread Vikram Hegde

Changes by Vikram Hegde :


--
pull_requests: +2053

___
Python tracker 

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



[issue30586] Encode to EBCDIC doesn't take into account conversion table irregularities

2017-06-07 Thread Vladimir Filippov

Vladimir Filippov added the comment:

According to 
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT symbols [ 
and ] have other codes (instead of 0xAD and 0xBD):
0xBA0x005B  #LEFT SQUARE BRACKET
0xBB0x005D  #RIGHT SQUARE BRACKET

Looks like 
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT was 
created based on 
https://www.ibm.com/support/knowledgecenter/SSZJPZ_11.3.0/com.ibm.swg.im.iis.ds.parjob.adref.doc/topics/r_deeadvrf_ASCII_to_EBCDIC.html
But this information "This translation is not bidirectional. Some EBCDIC 
characters cannot be translated to ASCII and some conversion irregularities 
exist in the table. For more information, see Conversion table irregularities." 
was ignored. Additional, this line from CP500.TXT:
0xBB0x007C  #VERTICAL LINE
haven't any source in IBM's table.

Example from z/OS mainframe:
---
bash-4.3$ iconv -f 819 -t 1047 -T ascii.txt > ebcdic.txt
bash-4.3$ ls -T *.txt
t ISO8859-1   T=on  ascii.txt
t IBM-1047T=on  ebcdic.txt
bash-4.3$ cat ascii.txt
![]|bash-4.3$ od -h ascii.txt
0021  5B  5D  7C
04
bash-4.3$ cat ebcdic.txt
![]|bash-4.3$ od -h ebcdic.txt
005A  AD  BD  4F
04
---

--
status: pending -> open

___
Python tracker 

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



[issue30546] [EASY][Windows] test_uname_win32_ARCHITEW6432() of test_platform leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

Ok, this issue was a duplicate of bpo-30567 which was already fixed.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Leak in sys.getwindowsversion

___
Python tracker 

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



[issue30567] Leak in sys.getwindowsversion

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

The issue 30546 has been marked as a duplicate of this issue.

--
nosy: +haypo

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Antoine Pietri

Antoine Pietri added the comment:

The only backport was for 3.6 as the previous versions don't have the strict= 
parameter. PR submitted here: https://github.com/python/cpython/pull/1985

--

___
Python tracker 

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



[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2017-06-07 Thread Mikhail

Mikhail added the comment:

So, I tried the modified patch (see 
http://aldan.algebra.com/~mi/tmp/patch-issue30345) -- and now I simply get a 
different variable name in the error-message:

(gdb) py-bt
Python Exception  Variable 'func' not found.: 
Error occurred in Python command: Variable 'func' not found.

However, the older version of the patch only referenced "func_obj" in 
test_gdb.py -- not in libpython.py -- so I may have misunderstood Jeremy's 
suggestion entirely...

--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2052

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Matthieu Dartiailh

Matthieu Dartiailh added the comment:

The issue is that unicode_escape will not properly handle strings mixing
unicode character and escaped character as it assumes latin-1 compatible
characters only. For example, given the literal string 'Δ\nΔ', one
cannot encode using latin-1 and encoding it using utf-8 then using
unicode _escape produces a wrong output: 'Î\x94\nÎ\x94'. However using
codecs.escape_decode(r'Δ\nΔ'.encode('utf-8'))[0].decode('utf-8') gives
the proper output. Internally the Python parser handle this case but I
was unable to find where and this is the closest solution I found. I
guess it may be possible using error handlers but it seems much more
cumbersome.

Best regards

Matthieu

--

___
Python tracker 

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



[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-07 Thread R. David Murray

Changes by R. David Murray :


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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:


New changeset add98eb4fe41baeaa70fbd4ccc020833740609a4 by Steve Dower (Antoine 
Pietri) in branch 'master':
bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893)
https://github.com/python/cpython/commit/add98eb4fe41baeaa70fbd4ccc020833740609a4


--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:

As usual, I can easily hit merge but may not be able to get to the backport 
immediately. Someone else can feel free to cherrypick and submit the PRs and 
I'll hit merge on them.

We should also watch the buildbots for failures though before backporting. 
Particularly in this area, they should have better coverage than the PR checks.

--
stage:  -> backport needed

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is an internal function kept for compatibility. It is used only for 
decoding pickle protocol 0 data created in Python 2. Look at unicode_escape and 
raw_unicode_escape codecs for doing similar decoding to strings in Python 3.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30589] With forkserver, Process.exitcode does not get signal number

2017-06-07 Thread Antoine Pitrou

New submission from Antoine Pitrou:

The documentation for multiprocessing.exitcode says:
"""
The child’s exit code. This will be None if the process has not yet 
terminated. A negative value -N indicates that the child was terminated by 
signal N.
"""

This is true for the "fork" method, but not "forkserver" where a child 
terminated by a signal will get an exitcode of 255.  This is because forkserver 
relies on the child writing its own exit code in a pipe, which obviously 
doesn't work if it was killed (255 is simply a fallback value).

See forkserver's Popen.poll():

def poll(self, flag=os.WNOHANG):
if self.returncode is None:
from multiprocessing.connection import wait
timeout = 0 if flag == os.WNOHANG else None
if not wait([self.sentinel], timeout):
return None
try:
self.returncode = forkserver.read_unsigned(self.sentinel)
except (OSError, EOFError):
# The process ended abnormally perhaps because of a signal
self.returncode = 255
return self.returncode

--
components: Library (Lib)
messages: 295343
nosy: davin, pitrou, sbt
priority: normal
severity: normal
status: open
title: With forkserver, Process.exitcode does not get signal number
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Matthieu Dartiailh

New submission from Matthieu Dartiailh:

codecs.escape_decode does not appear in the codecs documentation. This function 
is to my knowledge the only convenient way to process the escaped characters in 
a literal string (actually found here 
https://stackoverflow.com/questions/4020539/process-escape-sequences-in-a-string-in-python).
 It is most useful when implementing a parser for a language extending python 
semantic while retaining python processing of string (cf 
https://github.com/MatthieuDartiailh/enaml).

Is there a reason for that function not being documented ?

--
assignee: docs@python
components: Documentation
messages: 295342
nosy: docs@python, mdartiailh
priority: normal
severity: normal
status: open
title: Missing documentation for codecs.escape_decode
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2017-06-07 Thread Jeremy Kloth

Jeremy Kloth added the comment:

It seems that commit 
(https://github.com/python/cpython/commit/c52572319cbd50adff85050a54122c25239a516d)
 changed the parameter name in the definition of _PyCFunction_FastCallDict().  
I believe that changing 'func_obj' to just 'func' should fix it (in 
Tools/gdb/libpython.py).

--
nosy: +jkloth

___
Python tracker 

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



[issue28686] py.exe ignored PATH when using python3 shebang

2017-06-07 Thread Jens Lindgren

Jens Lindgren added the comment:

Sorry I need to clarify.
On Linux both python and python3 works as there is a symlink created from 
python to python3 in the venv folder.
On Windows only python.exe is created. I copied it to python3.exe. Now I can 
use python3 script.py to start but py-launcher and shebang still didn't work 
with '/usr/bin/env python3'.
I expect this to work the same on Windows as it does on Linux.

--

___
Python tracker 

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



[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2017-06-07 Thread Mikhail

Mikhail added the comment:

The actual stack, which I'm trying to debug, begins like this:

#0  0xbfbfd34e in ?? ()
#1  0x2a9ec81e in ?? () from /opt/lib/qt5/libQt5WebKit.so.5
#2  0x2acf0efe in ?? () from /opt/lib/qt5/libQt5WebKit.so.5
#3  0x2acd8b74 in ?? () from /opt/lib/qt5/libQt5WebKit.so.5
#4  0x2acd5d60 in ?? () from /opt/lib/qt5/libQt5WebKit.so.5
#5  0x2acd87ae in ?? () from /opt/lib/qt5/libQt5WebKit.so.5
#6  0x2a9fe2e3 in QWebFrameAdapter::load(QNetworkRequest const&, 
QNetworkAccessManager::Operation, QByteArray const&) () from 
/opt/lib/qt5/libQt5WebKit.so.5
#7  0x2d7a18dd in QWebFrame::setUrl(QUrl const&) () from 
/opt/lib/qt5/libQt5WebKitWidgets.so.5
#8  0x2d7ad5eb in QWebView::setUrl(QUrl const&) () from 
/opt/lib/qt5/libQt5WebKitWidgets.so.5
#9  0x2d75efd4 in meth_QWebView_setUrl(_object*, _object*) ()
   from /opt/lib/python3.6/site-packages/PyQt5/QtWebKitWidgets.so
#10 0x28125151 in _PyCFunction_FastCallDict () from 
/opt/lib/libpython3.6m.so.1.0
#11 0x28125326 in _PyCFunction_FastCallKeywords () from 
/opt/lib/libpython3.6m.so.1.0
#12 0x2819a458 in ?? () from /opt/lib/libpython3.6m.so.1.0
#13 0x28193ab2 in _PyEval_EvalFrameDefault () from /opt/lib/libpython3.6m.so.1.0
#14 0x2819b790 in ?? () from /opt/lib/libpython3.6m.so.1.0
#15 0x2819a425 in ?? () from /opt/lib/libpython3.6m.so.1.0
#16 0x28193ab2 in _PyEval_EvalFrameDefault () from /opt/lib/libpython3.6m.so.1.0
[...]

Maybe, it is "too deep" into the native (not Python) code for the feature to 
work?

--

___
Python tracker 

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



[issue30014] Speedup DefaultSelectors.modify() by 2x

2017-06-07 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

OK, https://github.com/python/cpython/pull/1030 should be good to go.

--

___
Python tracker 

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



[issue12815] Coverage of smtpd.py

2017-06-07 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue28686] py.exe ignored PATH when using python3 shebang

2017-06-07 Thread Jens Lindgren

Jens Lindgren added the comment:

I just got hit by this bug and would like to add my thoughts on this.
If you are in an activated venv, no matter if you launch with command python or 
python3, it will launch the version in venv (version 3.6.1 in this case).
I expect the py-launcher and shebang to work the same way. In fact it works as 
expected on Linux and '#! /usr/bin/env pyton3' are in fact using the venv 
version.
This is a pretty major bug that needs to be fixed asap in my opinion.

--
nosy: +Jens Lindgren

___
Python tracker 

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



[issue30586] Encode to EBCDIC doesn't take into account conversion table irregularities

2017-06-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue30586] Encode to EBCDIC doesn't take into account conversion table irregularities

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The cp500 codec in Python is generated from the table 
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT .

There are several EBCDIC code pages. EBCDIC-compatible encodings supported in 
Python are: cp037, cp273, cp424, cp500, cp875, cp1026 and cp1140. Three of 
them, cp037, cp424 and cp1140, encode '!' to b'\x5A' and '|' to b'\x4F'.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30587] Mock with spec object does not ensure method call signatures

2017-06-07 Thread Claudiu Belu

New submission from Claudiu Belu:

Mock can accept a spec object / class as argument, making sure that accessing 
attributes that do not exist in the spec will cause an AttributeError to be 
raised, but there is no guarantee that the spec's methods signatures are 
respected in any way. This creates the possibility to have faulty code with 
passing unittests and assertions.

Steps to reproduce:

>>> import mock
>>>
>>> class Something(object):
... def foo(self, a, b, c, d):
... pass
...
>>>
>>> m = mock.Mock(spec=Something)
>>> m.foo()

>>> # TypeError should be raised, but it isn't.
...
>>> m.foo.assert_called_once_with()


Expected behaviour: It should have raised a TypeError, since the method 
signature is: def meth(self, a, b, c, d):

Actual behaviour: No error.

--
components: Library (Lib)
messages: 295335
nosy: cbelu
priority: normal
pull_requests: 2051
severity: normal
status: open
title: Mock with spec object does not ensure method call signatures
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30359] Annotating a function as returning an (async) context manager?

2017-06-07 Thread Nick Coghlan

Nick Coghlan added the comment:

As far as whether or not this usage fits within the guidelines at 
https://www.python.org/dev/peps/pep-0008/#function-annotations, it would 
definitely be worth bringing up in a python-dev thread before going ahead with 
it.

I think it's a good dynamic use of annotations that fits within the spirit of 
PEP 484 without requiring sphinxcontrib-trio to rely on a static typechecker 
like mypy, but others may have a different perspective.

--

___
Python tracker 

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



[issue30359] Annotating a function as returning an (async) context manager?

2017-06-07 Thread Nick Coghlan

Nick Coghlan added the comment:

Even Python 2 functions support setting arbitrary attributes, so 
contextlib2.contextmanager can always just add an __annotations__ dict to 
decorated functions if it doesn't already exist.

```
>>> def f():
... pass
... 
>>> f.__annotations__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'function' object has no attribute '__annotations__'
>>> f.__annotations__ = {}
>>> f.__annotations__
{}
```

--

___
Python tracker 

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



[issue1207613] Idle Editor: Bottom Scroll Bar

2017-06-07 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I hope you don't mind that I made a change for this.  I was working with 'Find 
in files' and couldn't see the full line, so I figured out where to add the 
scroll bar.  I only found this ticket after the fact.

If it's not appropriate, I can withdraw the PR.

--
nosy: +csabella

___
Python tracker 

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



[issue1207613] Idle Editor: Bottom Scroll Bar

2017-06-07 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2050

___
Python tracker 

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



[issue22898] segfault during shutdown attempting to log ResourceWarning

2017-06-07 Thread Xavier de Gaye

Xavier de Gaye added the comment:

With PR 1981, a ResourceWarning is printed when a RecursionError occurs while 
normalizing another exception and its traceback holds a reference to a 
non-closed file object.

For information, issue 5437 removed the MemoryError singleton for the same 
reasons as PR 1981 does.

--
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue30537] Using PyNumber_AsSsize_t in itertools.islice

2017-06-07 Thread Will Roberts

Will Roberts added the comment:

Github PR adds simple test, as well as an entry in Misc/NEWS.

--

___
Python tracker 

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



[issue30586] Encode to EBCDIC doesn't take into account conversion table irregularities

2017-06-07 Thread Vladimir Filippov

New submission from Vladimir Filippov:

These 4 symbols were encoded incorrectly to EBCDIC (codec cp500): "![]|". 
Correct table of conversation for these symbols described in 
https://www.ibm.com/support/knowledgecenter/SSZJPZ_11.3.0/com.ibm.swg.im.iis.ds.parjob.adref.doc/topics/r_deeadvrf_Conversion_Table_Irregularities.html

This code:

ascii = '![]|';
print("ASCII:  " + bytes(ascii, 'ascii').hex())
res = ascii.encode('cp500')
print ("EBCDIC: " +res.hex())

on Python 3.6.1 produce this output:

ASCII:  215b5d7c
EBCDIC: 4f4a5abb


Expected encoding (from IBM's table):
! - 5A
[ - AD
] - BD
| - 4F

Workaround: use this translation after encoding
bytes.maketrans(b'\x4F\x4A\x5A\xBB', b'\x5A\xAD\xBD\x4F')

--
components: Unicode
messages: 295329
nosy: Vladimir Filippov, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: Encode to EBCDIC doesn't take into account conversion table 
irregularities
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue22898] segfault during shutdown attempting to log ResourceWarning

2017-06-07 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests: +2049

___
Python tracker 

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



[issue12815] Coverage of smtpd.py

2017-06-07 Thread Milan Oberkirch

Changes by Milan Oberkirch :


--
nosy:  -zvyn

___
Python tracker 

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



[issue30359] Annotating a function as returning an (async) context manager?

2017-06-07 Thread Nathaniel Smith

Nathaniel Smith added the comment:

I can think of two downsides to using __annotations__ for this:

1) Obviously contextlib itself isn't going to add any kind of annotation in any 
versions before 3.7, but third-party projects might (like contextlib2, say). 
And these projects have been known to be used on Python versions that don't 
have __annotations__ support. At the moment I personally don't have to care 
about this because sphinxcontrib-trio doesn't support anything before 3.5, but 
I suspect this will eventually change. (E.g. sphinx has expressed some interest 
in having these changes upstreamed.) So this would mean that we'd still need 
some other ad hoc mechanism to use when running on old Pythons, and have to 
check for both that and the __annotations__. But that's probably doable, so eh. 
It'd be helpful if contextlib2 could join in on whatever protocol, though.

2) sphinxcontrib-trio actually interacts very poorly with __annotations__ right 
now [1]. But I mean, I need to figure out how to fix this anyway, so... not 
really your problem :-).

Neither of these downsides seems very compelling :-). So I guess contextlib 
should add some appropriate __annotations__, and *maybe* also add something 
like __returns_contextmanager__ = True if that's useful to maintain consistency 
with contextlib2 or similar?

(Wasn't there some discussion about keeping type hints out of the stdlib for 
now? is this likely to ruffle any figures on those grounds?)

[1] https://github.com/python-trio/sphinxcontrib-trio/issues/4

--

___
Python tracker 

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



[issue30537] Using PyNumber_AsSsize_t in itertools.islice

2017-06-07 Thread Sven Marnach

Sven Marnach added the comment:

The current behaviour of islice() seems inconsistent with the rest of Python.  
All other functions taking start, stop and step arguments like slice(), range() 
and itertools.count() do accept integer-like objects.  The code given as 
"roughly equivalent" in the documentation of islice() accepts integer-like 
objects, and so does regular list slicing.  In fact, the __index__() method was 
introduced in PEP 357 specifically for slicing.  In Python 2, islice() 
supported it as well.  I think the expectation that islice() in Python 3 also 
supports it is entirely reasonable, and I can't see any strong arguments for 
breaking that assumption.

--
nosy: +smarnach

___
Python tracker 

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



[issue30080] Add the --duplicate option for timeit

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, I even didn't know that "perf timeit" supports -n since it doesn't report 
the number of loops. And seems it runs the benchmark much more times, since 
even with -n1 it is slow. If the number of loops is determined automatically, 
it would do not matter.

I choose the meaning of --duplicate so that it almost not affect the total time 
of the benchmarking. Larger value just decreases the overhead of the iteration.

--

___
Python tracker 

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



[issue30546] [EASY][Windows] test_uname_win32_ARCHITEW6432() of test_platform leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

It seems like the bug was already fixed last days!

--

___
Python tracker 

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



[issue30547] [EASY][Windows] SubinterpreterTest.test_callbacks_leak() of test_atexit leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

> At the end, you should get the commit 
> 6b4be195cd8868b76eb6fbe166acc39beee8ce36.

The commit is a giant change. So let me help you, the following change is 
strange. value is replaced whereas its value is non-NULL... Maybe it's the 
regression? ;-)

diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 90f8551..03601ea 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -291,6 +291,9 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
 
 /* Install importlib as the implementation of import */
 value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod);
+if (value != NULL)
+value = PyObject_CallMethod(importlib,
+"_install_external_importers", "");
 if (value == NULL) {
 PyErr_Print();
 Py_FatalError("Py_Initialize: importlib install failed");


Stéphane Wirtel (matrixise): "this issue can be executed on Linux, I think I am 
going to work on this one."

Would you like to work on a patch?

--

___
Python tracker 

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



[issue30547] [EASY][Windows] SubinterpreterTest.test_callbacks_leak() of test_atexit leaks references

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

The failing unit test was added by:

commit 2d350fd8af29eada0c3f264a91df6ab4af4a05fd
Author: Antoine Pitrou 
Date:   Thu Aug 1 20:56:12 2013 +0200

Issue #18619: Fix atexit leaking callbacks registered from 
sub-interpreters, and make it GC-aware.


Using git bisect, I found that the leak was introduced by:

commit 6b4be195cd8868b76eb6fbe166acc39beee8ce36
Author: Eric Snow 
Date:   Mon May 22 21:36:03 2017 -0700

bpo-22257: Small changes for PEP 432. (#1728)

PEP 432 specifies a number of large changes to interpreter startup code, 
including exposing a cleaner C-API. The major changes depend on a number of 
smaller changes. This patch includes all those smaller changes.


To run a git bisection, start with an old commit, 1 month ago: 
5d7a8d0c13737fd531b722ad76c505ef47aac96a (May, 1). Spoiler: the test doesn't 
leak at this bisection.

git bisect reset
git bisect start

git checkout master
make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# test fails
git bisect bad  # bad=test fails (ref leak)

git checkout 5d7a8d0c13737fd531b722ad76c505ef47aac96a
make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# test pass
git bisect good  # good=test pass (no leak)

make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# git bisect good or bad depending on the test result

# ... continue until git bisect finds the commit ...

At the end, you should get the commit 6b4be195cd8868b76eb6fbe166acc39beee8ce36.


@Eric Snow: Please don't fix the bug, please explain how to fix it ;-)

--
nosy: +eric.snow

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

Denis Osipov added the comment:

Using the numeric SID instead of localized name in test_access_denied works for 
me (I've made PR).

--

___
Python tracker 

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



[issue30500] [security] urllib connects to a wrong host

2017-06-07 Thread STINNER Victor

Changes by STINNER Victor :


--
title: urllib connects to a wrong host -> [security] urllib connects to a wrong 
host

___
Python tracker 

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



[issue30585] [security][3.3] Backport smtplib fix for TLS stripping vulnerability, CVE-2016-0772

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

PEP 398: Python 3.3 Release Schedule

Python 3.3 branch end of support is expected to be at 2017-09-29, in 4 months.

--
assignee:  -> georg.brandl

___
Python tracker 

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



[issue30585] [security][3.3] Backport smtplib fix for TLS stripping vulnerability, CVE-2016-0772

2017-06-07 Thread STINNER Victor

New submission from STINNER Victor:

Attached pull request backports a fix for this security vulnerability:
http://python-security.readthedocs.io/vuln/cve-2016-0772_smtplib_tls_stripping.html

"A vulnerability in smtplib allowing MITM attacker to perform a startTLS 
stripping attack. smtplib does not seem to raise an exception when the remote 
end (SMTP server) is capable of negotiating starttls but fails to respond with 
220 (ok) to an explicit call of SMTP.starttls(). This may allow a malicious 
MITM to perform a startTLS stripping attack if the client code does not 
explicitly check the response code for startTLS."

Reported by: Tin (Team Oststrom)

Python 2.7, 3.4, 3.5 and 3.6 are already safe.

--
messages: 295319
nosy: georg.brandl, haypo
priority: release blocker
pull_requests: 2047
severity: normal
status: open
title: [security][3.3] Backport smtplib fix for TLS stripping vulnerability, 
CVE-2016-0772
type: security
versions: Python 3.3

___
Python tracker 

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



[issue30500] urllib connects to a wrong host

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

> I think the best behavior is to do what popular web browsers do. Chrome and 
> Firefox, for example, parses this is host 127.0.0.1, path /, fragment 
> #@evil.com.

I agree that in case of doubt, it's better to follow the implementation of most 
popular web browser which indirectly define the "standard".

--
nosy: +haypo

___
Python tracker 

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



[issue30080] Add the --duplicate option for timeit

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

About the command line interface, I would expect that "timeit -n 10 --duplicate 
10 STMT" would run STMT 100 times. I chose this behaviour in perf timeit:
http://perf.readthedocs.io/en/latest/cli.html#timeit-cmd


Current behaviour chosen by Serhiy, -n3 --duplicate=3 runs STMT 3 times:

$ ./python -m timeit --duplicate=3 -r 1 -n 3 'print("bla")'
bla
bla
bla
3 loops, best of 1: 21.8 usec per loop

--

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread STINNER Victor

STINNER Victor added the comment:

> exit status 1332.

On the Internet, I found:

1332No mapping between account names and security IDs was done.

The unit test:

@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
def test_access_denied(self):
# Default to FindFirstFile WIN32_FIND_DATA when access is
# denied. See issue 28075.
# os.environ['TEMP'] should be located on a volume that
# supports file ACLs.
fname = os.path.join(os.environ['TEMP'], self.fname)
self.addCleanup(support.unlink, fname)
create_file(fname, b'ABC')
# Deny the right to [S]YNCHRONIZE on the file to
# force CreateFile to fail with ERROR_ACCESS_DENIED.
DETACHED_PROCESS = 8
subprocess.check_call(
['icacls.exe', fname, '/deny', 'Users:(S)'],
creationflags=DETACHED_PROCESS
)
result = os.stat(fname)
self.assertNotEqual(result.st_size, 0)

--
nosy: +haypo

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

Changes by Denis Osipov :


--
pull_requests: +2046

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-07 Thread Denis Osipov

New submission from Denis Osipov:

test_os fails on non-English (Russian) Windows 7 Home Extended 6.1.7601 x64

==
ERROR: test_access_denied (test.test_os.StatAttributeTests)
--
Traceback (most recent call last):
  File "C:\repos\cpython\lib\test\test_os.py", line 476, in test_access_denied
creationflags=DETACHED_PROCESS
  File "C:\repos\cpython\lib\subprocess.py", line 293, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['icacls.exe', 'C:\\Users\\User\

\AppData\\Local\\Temp\\@test_6804_tmp', '/deny', 'Users:(S)']' returned 
non-zero 

exit status 1332.

--
Ran 250 tests in 5.120s

FAILED (errors=1, skipped=92)
test_os failed

1 test failed:
test_os

Total duration: 5 sec
Tests result: FAILURE

There is no group BUILTIN\Users on my Windows. There is BUILTIN\Пользователи 
instead.

--
components: Tests
messages: 295315
nosy: denis-osipov
priority: normal
severity: normal
status: open
title: test_os fails on non-English (Russian) Windows
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