[issue32097] doctest does not consider \r\n a

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It considers `\r\n` as a blank line. It just doesn't consider `\r\n` as `\n` in 
a non-blank line.

If add `\r` after `some text` the test will pass. Or use NORMALIZE_WHITESPACE.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Tests
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is there a *need* to break existing code? What is the benefit and how large it 
in comparison with the necessary of rewriting every code that embeds Python 
(and supporting both ways for long time)?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Actually I tried to test if this implementation can cause a crash due to using 
deeply nested iterators (like in issue14010). For example in 
next(roundrobin(*([[]]*N + [[1]]))). But if there is such problem here, 
roundrobin() becomes unusable due to quadratic time for smaller N (tens of 
thousands).

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I agree that using binary tree would be excessively here. I just wondering if 
there is a simple way to get rid of the quadratic complexity. In any case this 
does not matter much until you work with many hundreds or thousands of 
iterables.

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
Removed message: https://bugs.python.org/msg306629

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Serhiy, I think you're focusing on an irrelevant edge case and reading too much 
into the recipe.  You could create an underlying binary tree with O(n) 
iteration and O(log n) deletion but then that completely misses the point of 
the itertools recipes and would likely be pointless in the real-world and 
likely perform worse than the current recipe in common cases unless you wrote a 
C extension for it.

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

roundrobin() has quadratic computational complexity. For example 
list(roundrobin(*([[1]]*N))). Is there a way to make it with linear complexity?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32102] Add "capture_output=True" option to subprocess.run

2017-11-20 Thread Nick Coghlan

New submission from Nick Coghlan :

I'm hesitant to suggest adding yet-another-option to any subprocess API, but 
I'm thinking it may be worth it in this case.

The idea is to make it possible to replace:

result = subprocess.run(cmd, stdout=PIPE, stderr=PIPE)

with:

result = subprocess.run(cmd, capture_output=True)

That way, it would be possible for the raw stdin/stdout/stderr parameters to be 
treated as low level implementation details most of the time, since the most 
common configurations would be:

# Use parent's stdin/stdout/stderr
result = subprocess.run(cmd) 
# Use pipe for stdin, use parent's stdout/stderr
result = subprocess.run(cmd, input=data)
# Use parent's stdin, use pipe for stdout/stderr
result = subprocess.run(cmd, capture_output=True) 
# Use pipe for stdin/stdout/stderr
result = subprocess.run(cmd, input=data, capture_output=True)

--
messages: 306627
nosy: gregory.p.smith, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Add "capture_output=True" option to subprocess.run
type: enhancement

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +4424
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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2017-11-20 Thread Felipe

Change by Felipe :


--
nosy:  -fov

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2017-11-20 Thread Steve Dower

Steve Dower  added the comment:

> Got the same issue with the 3.6 installer

You've got a different issue, but I can't tell what it is without all of the 
logs. Can you look in your %TEMP% directory for the file you attached, and then 
also include those with the same prefix?

--

___
Python tracker 

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



[issue32101] Add PYTHONDEVMODE=1 to enable the developer mode

2017-11-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Another argument against PYTHONXOPTIONS is that each implementation is free to 
decide which -X options it wants to support, and we don't really define what 
they're supposed to do with options they don't recognise.

By contrast, there's an established behaviour for unknown environment 
variables: implementations that don't support them just ignore them.

So +1 for PYTHONDEVMODE=1 from me - that also gives us more flexibility if we 
decide to add arguments to the option later.

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Tim Peters

Tim Peters  added the comment:

I agree the current recipe strikes a very nice balance among competing 
interests, and is educational on several counts.

s/pending/numactive/

# Remove the iterator we just exhausted from the cycle.
numactive -= 1
nexts = cycle(islice(nexts, numactive))

--
nosy: +tim.peters

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

IMO, George Sakkis's original version is better than the TJR's proposed 
revision which has three separate adjustments by one and adds to extraneous 
functions which aren't central to the example.  Dubslow's alternative at least 
avoids the three offsets by one; however, it has the disadvantage that meaning 
of the loop induction variable is somewhat indirect and creates its own source 
of confusion.

I agree that some algorithmic comment should be added, probably just for the 
last line.

Let's not add any of the listed alternative names to the comments.  Each one is 
either  confusing or wrong.  The word "merge" already has an established, 
different meaning as in "sort/merge".  For example,  heapq.merge('ABC', 'D', 
'EF') gives ['A', 'B', 'C', 'D', 'E', 'F'].  The word "alternate" tends to mean 
"toggle back-and-forth" in common usage.  The term "zip_flat" has no meaning to 
me, it has no hits on Google, and the closest match is a recipe on 
StackOverflow that does something different.  And "interleave" is not 
suggestive of looping back over the iterables until each is exhausted.  Also, 
we may yet use interleave() to mean something else.

In contrast, "round robin" has a well established meaning that matches what 
this recipe does. Until now, not a single reader has ever claimed to not know 
what it means.  https://en.wikipedia.org/wiki/Round-robin_scheduling

FWIW, the recipe has several benefit.  1) Give a way to implement round robin 
iteration without re-inventing the wheel, 2) Demonstrate ways to use cycle() 
and islice().  3) Demonstrate useful optimization technique of factoring the 
try/except out of the for-loop, 4) Demonstrate the useful optimization 
technique of calling bound methods, and 5) Be concise (I've left longer or more 
complex recipes for the ASPN cookbook or StackOverflow).

Ideally, I would prefer to not add two extra builtin lookups (the recipe is 
sometime used on short inputs which would be affected by the extra overhead).  
Also, I prefer the visual weight to be on the central message of tight inner 
loops that exploit itertools rather than having the visual weight shift to the 
for-loop which is the least important part.

Can you a suggest a concise single line comment that would make the last line 
clearer about what it is doing?   Also, I'm open to changing the name of the 
"pending" variable but think "current_len" and "reduced_len" are not 
improvements.

--

___
Python tracker 

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



[issue32078] string result of str(bytes()) in Python3

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I'm sorry but the bug tracker is not the right place to ask such question. 
There are plenty of resources on the Internet explaining how to write code 
compatible with Python 2 and Python 3.

--

___
Python tracker 

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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

While the discussion is not done, I close this issue to focus on other more 
specific issues.

I completed the documentation and fixed warnings filters (bpo-32089). The 
option now also enables asyncio debug mode (bpo-32047).

It was proposed to add an environment variable to enable the developer mode: 
see bpo-32101 ("Add PYTHONDEVMODE=1 to enable the developer mode").

Note: I also fixed subprocess._args_from_interpreter_flags: bpo-32094.

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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset bc9b6e29cb52f8da15613f9174af2f603131b56d by Victor Stinner in 
branch 'master':
bpo-32043: Rephrase -X dev documentation (#4478)
https://github.com/python/cpython/commit/bc9b6e29cb52f8da15613f9174af2f603131b56d


--

___
Python tracker 

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



[issue32101] Add PYTHONDEVMODE=1 to enable the developer mode

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I created bpo-32101: Add PYTHONDEVMODE=1 to enable the developer mode.

--

___
Python tracker 

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



[issue32101] Add PYTHONDEVMODE=1 to enable the developer mode

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

In the review of the PR 4478, Antoine Pitrou proposed to add an environment 
variable to enable the new Python "developer mode" to inherit the developer 
mode in child Python processes.

I proposed to add PYTHONDEVMODE=1. Nick Coghlan proposed PYTHONXOPTIONS=dev.

While -X is a new "catch all" for new CPython options, Python got new PYTHONxxx 
environment variables to enable new options:

* -X faulthandler: PYTHONFAULTHANDLER=1
* -X tracemalloc=N: PYTHONTRACEMALLOC=n
* -X importtime: PYTHONPROFILEIMPORTTIME=1 -- note that the names are different 
in this case, I don't know why

I have a preference for PYTHONDEVMODE=1.

If we start to use PYTHONXOPTIONS, users may want to use 
PYTHONXOPTIONS=tracemalloc, and then we have to decide which environment 
variable has the preference :-(

Moreover, tracemalloc takes an argument, whereas environment variables with a 
value containing '=' are rare and so likely to cause issues in programs not 
carefully written to handle such variables. (Environment variables are 
inherited by all processes, not only Python processes.)

--
messages: 306618
nosy: ncoghlan, pitrou, vstinner
priority: normal
severity: normal
status: open
title: Add PYTHONDEVMODE=1 to enable the developer mode
type: enhancement
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



[issue32078] string result of str(bytes()) in Python3

2017-11-20 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez  added the comment:

I got your point, missed it before, sorry.
So just for completeness.

My issue was basically about the ambiguity of the str()-constructor
and the str()-built-in-function. Therefore the len/type prints.

It works with parameters:

(3.6.2) [acue@lap001 Desktop]$ python -bb
Python 3.6.2 (default, Jul 29 2017, 14:24:56) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> str(b"abc")
Traceback (most recent call last):
  File "", line 1, in 
BytesWarning: str() on a bytes instance
>>> 
>>> 
>>> str(b"abc", "utf-8")
'abc'
>>> 
>>> type(str(b"abc",'utf-8'))

>>> 

Is there a common approach to force the use of the str()-constructor instead of
the str()-built-in function and/or the __str__()-method?

This would make the shared code of Python2/Python3 much easier, 
at least for unicode()->str().

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 25420fe290b98171e6d30edf9350292c21ef700e by Victor Stinner in 
branch 'master':
bpo-32030: Add more options to _PyCoreConfig (#4485)
https://github.com/python/cpython/commit/25420fe290b98171e6d30edf9350292c21ef700e


--

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Issue 32096 covers reverting the change to PyDecode_Locale specifically for 3.7.

We can use this issue to ask the broader question "Do we want to *deprecate* 
our previously implied support for calling PyDecode_Locale() before 
Py_Initialize()?"

If the answer is "Yes", then we need to design a transition plan to a different 
API for setting config parameters that accept "wchar_t *".

If the answer is "No", then we need to document that design constraint on the 
affected APIs.

Either way, we should also improve the way we communicate the list of C API 
methods that can be safely called before Py_Initialize.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

While they're definitely closely related, I don't think this and issue 32086 
are actually duplicates: this issue is "fix the current Py_DecodeLocale 
regression in 3.7 by reverting back to the 3.6 behaviour", while issue 32086 is 
"Should we deprecate our implied support for calling Py_DecodeLocale() before 
calling Py_Initialize()?".


The latter is certainly a valid question, but we should restore the 3.6 
behaviour while we're considering it.

--
resolution: duplicate -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Dubslow

Dubslow  added the comment:

Er, in my first message, make that "(yield from tup for tup in 
zip_longest(*iters, usefill=False))"

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Dubslow

Dubslow  added the comment:

Perhaps the loop variable could be renamed to "len_minus_1" or some such 
something which is more semantic to the algorithm.

--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Dubslow

Dubslow  added the comment:

Regarding the current bug more specifically, I think a few comments would go a 
long way to helping readers understand the code.

And also, I do think the (1, +1, -1) is less readable, simply because it 
doesn't follow the most common usage patterns of range, where your first 
version using (0,0,0) (with implicit zeroes of course) is cleaner. It's much 
more apparent how long the loop is at first glance ("loop once per iter" vs 
"loop... from what to what? oh, once per iter"). Perhaps not using reversed() 
but instead setting step=-1 would be a better case to use the off-by-1 variant.

Such a version with both proposed changes (which are independent and can be 
considered or accepted separately) looks like this:


def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
# This recipe is also called other names like "alternate", "interleave", or
# "merge". "zip_flat" would also be an accurate name.
# Algorithm: cycle around the __next__ methods of each iterable. when an
# iter runs out, remove its __next__ from the cycle.
nexts = cycle(iter(it).__next__ for it in iterables)
for reduced_len in reversed(range(len(iterables))):
try:
for next in nexts:
yield next()
except StopIteration:
nexts = cycle(islice(nexts, reduced_len))
# This skips one round of the cycle, starting the next round
# without the current iter


The last comment is probably the least valuable, though it does point out the 
slight quirk of how the last line works. I suppose this is the case for having 
the loop variable be named the actual length, but I think most Python users are 
accustomed to the last element of a list having index length-1. At any rate, I 
think the readability gain in the for statement is more than the readability 
loss in the islice().

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2017-11-20 Thread Brett Cannon

Brett Cannon  added the comment:

zipimport.py would be frozen just like importlib, so there's no bootstrapping 
issue if that's what you're asking.

--

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4422

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 09f3a8a1249308a104a89041d82fe99e6c087043 by Victor Stinner in 
branch 'master':
bpo-32089: Fix warnings filters in dev mode (#4482)
https://github.com/python/cpython/commit/09f3a8a1249308a104a89041d82fe99e6c087043


--

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Dubslow

Dubslow  added the comment:

Note that this follows a bit of discussion on python-ideas, in two threads:

https://mail.python.org/pipermail/python-ideas/2017-November/047920.html

https://mail.python.org/pipermail/python-ideas/2017-November/047989.html

I agree the zip_longest-derived solution is both easier to read/understand and 
also not really accurate, especially in extreme cases.

But, and see the second thread, I think it might just be better to add this 
funcitonality itself to itertools, under the name zip_flat -- per the second 
thread, there's a lot of confusion around the topic beyond just the suitability 
of the current recipe (including such things as lack of a clear name, 
legibility, efficiency, and brevity -- a fair number of people are looking for 
one or two liners, even if that doesn't really exist). (One alternative to 
zip_flat would be to add a second keyword argument to zip_longest that 
*doesn't* use a fillvalue, producing variable-length tuples when the supplied 
iters run out. Then the recipe and the entire conversation/topic could be 
replaced by "yield from zip_longest(*iters, usefill=False)".)

Despite that opinion, this suggested change is better than nothing.

--
nosy: +Dubslow

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-20 Thread Cheryl Sabella

Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue31672] string.Template should use re.ASCII flag

2017-11-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

@inada.naoki - I think changing this to ?a will make things more clear.  I 
submitted a PR for that, and then once it lands, we can close this issue.

--

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-20 Thread Cheryl Sabella

New submission from Cheryl Sabella :

Clicking on Path Browser in the File menu gives an error instead of opening the 
Path Browser.

--
assignee: terry.reedy
components: IDLE
messages: 306606
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: PathBrowser isn't working
type: crash
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



[issue31672] string.Template should use re.ASCII flag

2017-11-20 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests: +4420

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Terry J. Reedy

New submission from Terry J. Reedy :

The itertools roundrobin recipe has an outer loop executed a preset number of 
times.  It is currently implemented with two assignments and a while loop.
https://docs.python.org/3/library/itertools.html#itertools-recipes
These can be replaced with a for loop using a reversed range.

def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
nexts = cycle(iter(it).__next__ for it in iterables)
for current_len in reversed(range(1, len(iterables)+1)):
try:
for next in nexts:
yield next()
except StopIteration:
nexts = cycle(islice(nexts, current_len - 1))

I think this is easier to understand.  So do some other participants in the 
current python-ideas thread 'Rewriting the "roundrobin" recipe in the itertools 
documentation'.

I changed 'pending' to 'current_len' because, to me, 'pending' should be the 
set of iter_nexts and not their number.

I originally avoided the '-1' in the islice call by decrementing both range 
arguments by 1 and calling the loop variable 'reduced_len'.  But having the 
loop variable be the size of the nexts iterable in the next outer iteration 
seemed confusing and not worth the trivial efficiency gain.

An independent change would be to replace 'next' with 'iter' on the basis that 
reusing the builtin name is not good and because 'nexts' is awkward to 
pronounce.

I will produce a PR if any version is preferred to the current one.
---

The OP proposed, and some participants like, an accept-reject algorithm based 
on zip_longest.

def roundrobin(*iters):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
# Perhaps "flat_zip_nofill" is a better name, or something similar
sentinel = object()
for tup in it.zip_longest(*iters, fillvalue=sentinel):
yield from (x for x in tup if x is not sentinel)

I dislike creating tuples we don't want, with values we don't want, with an 
arbitrarily small acceptance ratio.  I also note that zip_longest is properly 
used in grouper, whereas roundrobin is the only recipe using cycle.

--
assignee: docs@python
components: Documentation
messages: 306605
nosy: docs@python, rhettinger, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Use range in itertools roundrobin recipe
type: enhancement
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



[issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Thanks for the bug report Antoine, it's now fixed!

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Attached PR 4482 fixes warnings filters:

haypo@selma$ ./python -X dev -c 'import warnings, pprint; 
pprint.pprint(warnings.filters)'
[('ignore', None, , None, 0),
 ('always', None, , None, 0),
 ('default', None, , None, 0)]

--

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +pitrou

___
Python tracker 

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



[issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()

2017-11-20 Thread hackan

New submission from hackan :

The value of `count` is hardcoded to 16 in 
https://github.com/python/cpython/blob/6a55d09573e5c35c9e4a24a6f811120b41a2a994/Lib/test/test_os.py#L1324

--
messages: 306602
nosy: hackan
priority: normal
severity: normal
status: open
title: Hardcoded value in 
Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()
type: enhancement
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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

The internal Python test runner "regrtest" already implements the feature as 
the -m MATCH option and --matchfile FILENAME option. It's implemented in 
test.support._match_file().

See bpo-31324 for a recent issue on this feature: performance issue (it's going 
to be fixed).

--
nosy: +vstinner

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2017-11-20 Thread Éric Araujo

Éric Araujo  added the comment:

The patch would need to be applied on top of the current master to make a pull 
request.  Then, the tasks outlined in that message should be addressed:

https://bugs.python.org/issue2504#msg122439

--
assignee: loewis -> 

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

If it helps, think of TestLoader as collecting tests, rather than simply 
loading Python modules.

--

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 21/11/2017 à 00:23, Jonas H. a écrit :
> 
> - The loader code really only deals with loading (i.e., finding + importing) 
> tests. Yes it expects a file pattern like "test*.py" for identifying test 
> case files. But apart from that it didn't "feel" right to put name based 
> selection there.

Take a look at TestLoader.loadTestsFromName().  It does much more than
look up test files, it can also look up individual classes or methods.

> - In py.test you'll get a console output like "5 tests passed, 1 test failed, 
> 12 tests deselected". We can't get anything similar without making bigger 
> changes to the test loader, runner, etc. code. Using skip() we at least have 
> some info on "skipped" tests, although they're technically not skipped.

I'm not sure what the point of displaying the number of "deselected"
tests is: that information doesn't sound very useful in itself.

But in any case, marking them skipped feels wrong to me.  Most often,
skipping a test is an indication that the current system is not fit to
run it (such as not enough RAM, or lacking a third-party library, or
being the wrong OS entirely).

> Are you still saying this should go to the test loader?

IMHO, yes.  Looking at your posted implementation, at least I don't
think TestSuite is the place for it.

--

___
Python tracker 

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset f39b674876d2bd47ec7fc106d673b60ff24092ca by Victor Stinner in 
branch 'master':
bpo-32094: Update subprocess for -X dev (#4480)
https://github.com/python/cpython/commit/f39b674876d2bd47ec7fc106d673b60ff24092ca


--

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.

Jonas H.  added the comment:

> > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped 
> > test cases OK?

> I think this is the wrong approach.  A test that isn't selected shouldn't be 
> skipped, it should not appear in the output at all.  Another reason for 
> putting this in TestLoader :-)

My first implementation actually was mostly the test loader. Two things made me 
change my mind and try to make the changes in the suite code:

- The loader code really only deals with loading (i.e., finding + importing) 
tests. Yes it expects a file pattern like "test*.py" for identifying test case 
files. But apart from that it didn't "feel" right to put name based selection 
there.
- In py.test you'll get a console output like "5 tests passed, 1 test failed, 
12 tests deselected". We can't get anything similar without making bigger 
changes to the test loader, runner, etc. code. Using skip() we at least have 
some info on "skipped" tests, although they're technically not skipped.

Are you still saying this should go to the test loader?

--

___
Python tracker 

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



[issue32097] doctest does not consider \r\n a

2017-11-20 Thread Bert JW Regeer

New submission from Bert JW Regeer :

doctest fails to consider `\r\n` as a blank line.

--
components: Library (Lib)
files: test.py
messages: 306595
nosy: X-Istence
priority: normal
severity: normal
status: open
title: doctest does not consider \r\n a 
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47280/test.py

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2017-11-20 Thread Jonathan Schoonhoven

Jonathan Schoonhoven  added the comment:

Is there anything I can do to help get this into the codebase and out issue 
purgatory? We're not that far off from the 10 year anniversary of this issue.

--
nosy: +Jonathan Schoonhoven

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

First, I should clarify that I'm not a unittest maintainer.  However, as far as 
I can tell, the maintainers have not been very active lately.  Also, this is a 
reasonably simple enhancement (at least conceptually), so I think can do 
without a maintainer's formal approval.

To your questions:

> 1) Is suite the correct place for this kind of feature?

At its core, TestSuite is really a glorified collection of tests.  The 
selection logic is inside the TestLoader, and indeed the TestLoader docstring 
says:

"""This class is responsible for loading tests according to various criteria 
and returning them wrapped in a TestSuite"""

So I would recommend putting this in TestLoader.

> 2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new 
> abstraction "NameMatcher"?

I think the hardcoded approach is ok.  Though to benefit readability you may 
want to use a predicate function instead.

> 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test 
> cases OK?

I think this is the wrong approach.  A test that isn't selected shouldn't be 
skipped, it should not appear in the output at all.  Another reason for putting 
this in TestLoader :-)

> 4) The try...catch statement around 'test.id()' is needed because there are 
> some unit tests (unit tests for the unittest module itself) that check for 
> some error cases/error handling in the unittest framework, and crash if we 
> try to call '.id()' on them

I'd ask the question differently: do you need to call .id() to do the matching 
at all?  Intuitively, the TestLoader probably knows about the test names 
already, even before it instantiates TestCases for them.  TestCases shouldn't 
be instantiated for tests that are not selected.

--

___
Python tracker 

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



[issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional

2017-11-20 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional

2017-11-20 Thread Yury Selivanov

New submission from Yury Selivanov :


New changeset 423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c by Yury Selivanov in 
branch 'master':
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be 
optional (#4447)
https://github.com/python/cpython/commit/423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c


--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Duplicate of bpo-32086.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> C API: Clarify which C functions are safe to be called before 
Py_Initialize()

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Decorater

Decorater  added the comment:

Ah, I see now.

--

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

> For me, it looks like Py_DecodeLocal() is still safe (according to python 
> 3.6.3 unless anything changed in it).

This issue is a regression in Python 3.7.

--

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Decorater

Decorater  added the comment:

For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 
unless anything changed in it).

--
nosy: +Decorater

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Interpreter Core
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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Decorater

Decorater  added the comment:

Interesting, on 3.6.3 on my embedded program it seems to work just fine.

Did anything change in it since then?

https://github.com/AraHaan/Els_kom_new/blob/master/PC/komextract_new.c

--
nosy: +Decorater

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Eric Snow

Change by Eric Snow :


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

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

no. I'll install what I have atm.

Too bad - as now it will have an install dependency.

re: https://bugs.python.org/issue27976#msg274628 -- seems a warning that libffi 
is not available might be useful after all.

Question: is ffi still bundled for Darwin - even in 3.7? If yes, maybe it 
should also be bundled for AIX.

In any case, just installing a libffi.a library fixed the install (i.e., make; 
make install)

--
nosy:  -zach.ware
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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Eric Snow

New submission from Eric Snow :

(see the python-dev thread [1])
(related: issue #32086)

When I consolidated the global runtime state into a single global, _PyRuntime, 
calls Py_DecodeLocale() started to break if the runtime hadn't been intialized 
yet.  This is because that function relies on PyMem_RawMalloc() and 
PyMem_RawFree(), which rely on the raw allocator having been initialized as 
part of the runtime (it used to be intialized statically).

The documentation for various "Process-wide parameters" [2] explicitly directs 
users to call Py_DecodeLocale() where necessary.  The docs for 
Py_DecodeLocale(), in turn, explicitly refer to calling PyMem_RawFree().  So 
changing the pre-runtime-init behavior of Py_DecodeLocale() and PyMem_RawFree() 
is a regression that should be fixed.

[1] https://mail.python.org/pipermail/python-dev/2017-November/150605.html
[2] https://docs.python.org/3/c-api/init.html#process-wide-parameters

--
assignee: eric.snow
messages: 306585
nosy: eric.snow, ncoghlan, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Py_DecodeLocale() fails if used before the runtime is initialized.
type: crash

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.

Jonas H.  added the comment:

Thanks Antoine. I will need some guidance as to what are the correct places to 
make these changes. I'm not quite sure about the abstractions here (runner, 
loader, suite, case, etc.)

My PoC (see GitHub link in first post) uses a TestSuite subclass. (The subclass 
is only so that it's easier to assess the general implementation approach; I 
guess it should be put into the main class instead.)

Things I'm unsure of:

1) Is suite the correct place for this kind of feature?
2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new 
abstraction "NameMatcher"?
3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test 
cases OK?
4) The try...catch statement around 'test.id()' is needed because there are 
some unit tests (unit tests for the unittest module itself) that check for some 
error cases/error handling in the unittest framework, and crash if we try to 
call '.id()' on them. Please remove the try...catch to see these errors if 
you're interested in the details. Is the check OK like that, or is this a code 
smell?

Thanks
Jonas

--

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Zachary Ware

Zachary Ware  added the comment:

Do you have libffi (and its development headers) installed where the compiler 
can find it?  Python 3.7 no longer bundles a copy of libffi (see #27979).

--
nosy: +zach.ware
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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

FYI: version 3.6.3 compiles and builds without this issue.

+ make install DESTDIR=/var/aixtools/python/Python/3.6.3.0 > 
.buildaix/install.out
+ mkinstallp.ksh /var/aixtools/python/Python/3.6.3.0 > .buildaix/mkinstallp.out

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

New submission from Michael Felt :

after git clone from master:
make install fails to complete with:

Important - python is not installed already.
FYI: also note - build completes successfully with 2.7.14 (will download and 
check other python3 versions)

if test "xupgrade" != "xno"  ; then  case upgrade in  upgrade) 
ensurepip="--upgrade" ;;  install|*) ensurepip="" ;;  esac;   ./python -E -m 
ensurepip  $ensurepip --root=/ ;  fi
Traceback (most recent call last):
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 193, in 
_run_module_as_main
"__main__", mod_spec)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 85, in 
_run_code
exec(code, run_globals)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__main__.py", 
line 5, in 
sys.exit(ensurepip._main())
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 204, in _main
default_pip=args.default_pip,
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 27, in _run_pip
import pip
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 
28, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", 
line 9, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 
36, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", 
line 4, in 
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ctypes/__init__.py", line 
7, in 
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: 1254-004 The error code from the last command is 1.

--
components: Build
messages: 306581
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails
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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What return commands `ifconfig`, `ifconfig -a`, `ifconfig -av`, `ip link list`, 
`arp -an`, `lanscan -ai` (if not error)?

--

___
Python tracker 

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



[issue28538] _socket module cross-compilation error on android-24

2017-11-20 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

These changes are not needed anymore now that Unified Headers are supported by 
android-ndk-r14 (see issue 29040)

--
resolution: fixed -> not a bug
stage: resolved -> patch review
status: closed -> open

___
Python tracker 

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



[issue28538] _socket module cross-compilation error on android-24

2017-11-20 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4416

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The fix was made 2015-11-09. The tag core-8-5-15 was created 2013-09-16.

I'm not well experienced with fossil and thought that 8.5.15 contains this fix, 
but now I see that this is not true. Yes, updating Tcl/Tk can help.

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

On 11/20/2017 5:22 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka  added the comment:
>
> _unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. 
> Are they still not working on AIX?
After a clone of master:
a) _unixdll_getnode is renamed to _unix_getnode
since the function _load_system_functions() still depends on 
find_library() - that always returns None, still not working.
Note also - find_library('uuid') will not work on a standard AIX - as 
the library libuuid.a does not exist, neither have I ever seen a shared 
library with the name libuuid.so.
FYI: Finally, "nm -Ae /usr/lib/libc.a | grep uuid" returns

root@x071:[/root]nm -Ae /usr/lib/libc.a | grep uuid
/usr/lib/libc.a[shr.o]: ._gen_localhost_uuid t 3248320
/usr/lib/libc.a[shr.o]: ._gen_localhost_uuid@AF22_8 t 3256928
/usr/lib/libc.a[shr.o]: .uuid__get_os_time   T 3234208
/usr/lib/libc.a[shr.o]: .uuid__uemul T 3236064
/usr/lib/libc.a[shr.o]: .uuid_compare    T 3237088
/usr/lib/libc.a[shr.o]: .uuid_copy   T 3236224
/usr/lib/libc.a[shr.o]: .uuid_create T 3240480
/usr/lib/libc.a[shr.o]: .uuid_create_nil T 3240160
/usr/lib/libc.a[shr.o]: .uuid_create_os  T 3256608
/usr/lib/libc.a[shr.o]: .uuid_disk   T 3252448
/usr/lib/libc.a[shr.o]: .uuid_equal  T 3238336
/usr/lib/libc.a[shr.o]: .uuid_equal_nc   T 3248384
/usr/lib/libc.a[shr.o]: .uuid_for_key    T 3249504
/usr/lib/libc.a[shr.o]: .uuid_from_string    T 3238944
/usr/lib/libc.a[shr.o]: .uuid_from_string_nc T 3248960
/usr/lib/libc.a[shr.o]: .uuid_get_address    t 3234720
/usr/lib/libc.a[shr.o]: .uuid_hash   T 3236384
/usr/lib/libc.a[shr.o]: .uuid_is_nil T 3237984
/usr/lib/libc.a[shr.o]: .uuid_is_nil_nc  T 3249408
/usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc T 3248512
/usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc@AF23_10 t 3257184
/usr/lib/libc.a[shr.o]: .uuid_localhost  T 3254208
/usr/lib/libc.a[shr.o]: .uuid_os_md5 t 3245248
/usr/lib/libc.a[shr.o]: .uuid_os_sha1    t 3245376
/usr/lib/libc.a[shr.o]: .uuid_to_string  T 3239648
/usr/lib/libc.a[shr.o]: .uuid_to_string_nc   T 3248608
/usr/lib/libc.a[shr.o]: _uuid_rmutex B  548664 12
/usr/lib/libc.a[shr.o]: _uuid_rmutex d  512480 4
/usr/lib/libc.a[shr.o]: getosuuid    U   -
/usr/lib/libc.a[shr.o]: setosuuid    U   -
/usr/lib/libc.a[shr.o]: uuid_c_version   D  503544 4
/usr/lib/libc.a[shr.o]: uuid_compare D  498436 12
/usr/lib/libc.a[shr.o]: uuid_copy    D  498412 12
/usr/lib/libc.a[shr.o]: uuid_create  D  498508 12
/usr/lib/libc.a[shr.o]: uuid_create_nil  D  498496 12
/usr/lib/libc.a[shr.o]: uuid_create_os   D  498616 12
/usr/lib/libc.a[shr.o]: uuid_disk    D  498592 12
/usr/lib/libc.a[shr.o]: uuid_equal   D  498460 12
/usr/lib/libc.a[shr.o]: uuid_equal_nc    D  498520 12
/usr/lib/libc.a[shr.o]: uuid_for_key D  498580 12
/usr/lib/libc.a[shr.o]: uuid_from_string D  498472 12
/usr/lib/libc.a[shr.o]: uuid_from_string_nc  D  498556 12
/usr/lib/libc.a[shr.o]: uuid_g_nil_uuid  D  432472 16
/usr/lib/libc.a[shr.o]: uuid_g_nil_uuid  d  512476 4
/usr/lib/libc.a[shr.o]: uuid_hash    D  498424 12
/usr/lib/libc.a[shr.o]: uuid_is_nil  D  498448 12
/usr/lib/libc.a[shr.o]: uuid_is_nil_nc   D  498568 12
/usr/lib/libc.a[shr.o]: uuid_is_valid_string_nc D 498532  12
/usr/lib/libc.a[shr.o]: uuid_localhost   D  498604 12
/usr/lib/libc.a[shr.o]: uuid_to_string   D  498484 12
/usr/lib/libc.a[shr.o]: uuid_to_string_nc    D  498544 12

i.e., there is nothing with uuid_generate in it.

_arp_getnode()
AIX does not return any value for itself.
Neither does Centos, (so I expect RHEL will also not), and my old 
debians do not either.

So, after summary - these three functions still do nothing/do not work 
on AIX 6.1 or AIX 7.1 (cannot test AIX 7.2).

And - as before, netstat -ia - when looking at ':', still returns

01:00:5e:00:00:01

for every interface.

>
> --
> nosy: +serhiy.storchaka
> versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Zachary Ware

Zachary Ware  added the comment:

> Ah, this is Cygwin!

Hmm, no; Cygwin isn't installed on ware-win81-release.

When was the fix made?  2.7 on Windows currently uses 8.5.15, we can bump it up 
to latest 8.5 if that will help.

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ah, this is Cygwin!

This is a Tk bug 
(https://core.tcl.tk/tk/tktview?name=5ee8af61e5ef8e233158a43459624f4ecf58a6fe). 
It was fixed, but not completely. The fix doesn't work on Cygwin.

--

___
Python tracker 

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread Antoine Pitrou

New submission from Antoine Pitrou :

`subprocess._args_from_interpreter_flags()` is used to control the flags passed 
to child Python processes, for example launched by multiprocessing.  
Unfortunately, not all flags are actually recognized by this function:

$ ./python -X dev
Python 3.7.0a2+ (heads/master:895862a, Nov 20 2017, 19:15:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._xoptions
{'dev': True}
>>> import subprocess
>>> subprocess._args_from_interpreter_flags()
['-Wdefault']

--
components: Library (Lib)
messages: 306574
nosy: barry, davin, pitrou, vstinner
priority: normal
severity: normal
status: open
title: _args_from_interpreter_flags() doesn't keep -X options
type: enhancement
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



[issue31897] Unexpected exceptions in plistlib.loads

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Opened issue32072 for infinite recursion and related issues.

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



[issue12276] 3.x ignores sys.tracebacklimit=0

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Bugs in PyTraceBack_Print()

___
Python tracker 

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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 895862aa01793a26e74512befb0c66a1da2587d6 by Łukasz Langa (Victor 
Stinner) in branch 'master':
bpo-32088: Display Deprecation in debug mode (#4474)
https://github.com/python/cpython/commit/895862aa01793a26e74512befb0c66a1da2587d6


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4415

___
Python tracker 

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



[issue32025] Add time.thread_time()

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I opened bpo-32093 for macOS. I close this one.

Nice enhancement, I already like this new clock ;-)

--
components: +FreeBSD -Library (Lib)
nosy: +koobs
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



[issue32093] macOS: implement time.thread_time() using thread_info()

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

bpo-32025 added time.thread_time() function. On macOS, CLOCK_THREAD_CPUTIME_ID 
is not available. I propose to add a macOS implementation using thread_info(): 
return the sum of user and system times.

--
components: macOS
messages: 306569
nosy: ned.deily, pitrou, ronaldoussoren, vstinner
priority: normal
severity: normal
status: open
title: macOS: implement time.thread_time() using thread_info()
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



[issue32022] Python crashes with mutually recursive code

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I don't think that we can fix this issue. I suggest to close it as WONTFIX.


> sys.setrecursionlimit(3000)

While Python does its best to catch stack overflow, the C implementation of 
CPython can exhaust the stack memory (8 MB in Linux?) and then crash with a 
"stack overflow".

I suggest to rewrite your algorithm to reduce the maximum stack depth.

Or maybe try to find a way to extend the maximum size of the stack (is it 
possible without rebuilding Python?). See for example RLIMIT_STACK of the 
resource module on Unix.


> On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: 
> maximum recursion depth exceeded.

The exact memory usage depends on the Python version and maybe compiler flags. 
We reduce the stack usage in Python 3.7, search for "Stack consumption" in:

https://vstinner.github.io/contrib-cpython-2017q1.html

--

___
Python tracker 

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



[issue32078] string result of str(bytes()) in Python3

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Calling str(bytes) is wrong in Python 3:

$ python3 -bb
Python 3.6.2 (default, Oct  2 2017, 16:51:32) 
>>> str(b'abc')
BytesWarning: str() on a bytes instance

Just don't do that :-)

Use repr(bytes) if you want the b'...' format:

>>> repr(b'abc')
"b'abc'"

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



[issue32050] Fix -x option documentation

2017-11-20 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I don't know either.  Once of the Windows experts should review and revise.

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

_unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. 
Are they still not working on AIX?

--
nosy: +serhiy.storchaka
versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 60a376cf0023d1070329d0e861a5596637ff3275 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-32050: Fix -x option documentation (GH-4475) (#4477)
https://github.com/python/cpython/commit/60a376cf0023d1070329d0e861a5596637ff3275


--

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I removed the note from the documentation since it was outdated.

Serhiy, Terry: Do you want to work on a patch to rephrase the "DOS specific 
hack only" sentence?

> @py -3 -x %0 %* & exit /b

I'm not a BATCH expert, so I don't know if this command works on all Windows 
version, or even on MS-DOS. So I'm not confident to propose such doc change 
myself, sorry.

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

+531  elif sys.platform.startswith("aix"):
  +532  getters = [_netstat_getnode]

LGTM. Do you want to write this a pull request?

--
nosy: +vstinner

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ned.deily
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



[issue32050] Fix -x option documentation

2017-11-20 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4414

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c5a2071586f735d2a61d1756e7011cfbb6ce86c9 by Victor Stinner in 
branch 'master':
bpo-32050: Fix -x option documentation (#4475)
https://github.com/python/cpython/commit/c5a2071586f735d2a61d1756e7011cfbb6ce86c9


--

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


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

___
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-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


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

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Claudiu Belu  added the comment:

Currently, the autospec=True argument can be passed to mock.patch, but when 
trying to make assertions on the call and its arguments, it can fail, as it 
expects an instance / class instance reference as the first argument (self / 
cls arguments are not consumed when autospec-ing).

Steps to reproduce:

ubuntu@ubuntu:/opt/stack/cpython$ ./python
Python 3.7.0a2+ (heads/mock-add-autospec:51a9270, Nov 20 2017, 06:48:44)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest import mock
from unittest.test.testmock import testmock

with mock.patch.object(testmock.Something, 'meth', autospec=True):
smth = testmock.Something()
smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, 
mock.sentinel.d)
smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, 
mock.sentinel.c, mock.sentinel.d)

>>> >>> >>> ... ... ... ... 
Traceback (most recent call last):
  File "", line 4, in 
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 196, in 
assert_called_once_with
return mock.assert_called_once_with(*args, **kwargs)
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 856, in 
assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 845, in 
assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, 
sentinel.d)
Actual call: meth(, sentinel.a, sentinel.b, sentinel.c, sentinel.d)

Expected result: no AssertionError.

--

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Eric Snow

Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


--
components: +Library (Lib)

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


--
type:  -> behavior

___
Python tracker 

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



  1   2   >