[issue26934] android: test_faulthandler fails

2016-11-13 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
status: open -> closed

___
Python tracker 

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



[issue28629] Emit ResourceWarning when implicitly terminating a suspended frame?

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

Perhaps I shouldn’t have mentioned “del gen”. That was meant to represent the 
garbage collector running and calling gen.__del__() or equivalent. Basically 
what I was trying to say is I think there will be two classes of generators:

1. Simple generators just implementing the plain iterator protocol, where there 
is nothing to clean up. In these cases a ResourceWarning is unwanted. Example: 
generator expressions.

2. Complex generators that have special cleanup code. Ideally the user should 
either exhaust the generator or call its close() method, and a ResourceWarning 
would be useful if neither of these happen. Example: Nick’s mygen().

--

___
Python tracker 

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



[issue28629] Emit ResourceWarning when implicitly terminating a suspended frame?

2016-11-13 Thread STINNER Victor

STINNER Victor added the comment:

> del gen  # Like deleting a plain iterator; no ResourceWarning expected

Hum, wait, I'm not sure that I got the whole point of this issue.

If the generator uses "with obj:", "del gen" will not call obj.__exit__().

Do you consider that "del gen" is better to clear obj than not known
when gen and obj are destroyed?

Is there a solution to call obj.__exit__()?

--

___
Python tracker 

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



[issue28000] Build fails on AIX with _LINUX_SOURCE_COMPAT flag

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

I committed your patches for 3.5+ and 2.7.

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



[issue28016] test_fileio fails on AIX

2016-11-13 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-13 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file45480/_PyUnicode_EqualToId_v2.patch

___
Python tracker 

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



[issue28595] shlex.shlex should not augment wordchars

2016-11-13 Thread Evan

Evan added the comment:

I have some additional concerns with the changes introduced in 
http://bugs.python.org/issue1521950:

1. The fact that posix defaults to False in shlex.shlex (but not in 
shlex.split) is a huge beginner trap. If users are expecting to use this for 
"compatibility with the parsing performed by common Unix shells like bash, 
dash, and sh", they must also remember to set posix=True. The documentation for 
punctuation_chars makes no mention of this. The examples use non-POSIX mode 
parsing rules.

2. Even with posix=True, there is no mechanism to escape characters that are 
special inside double quotes, like $. This is a separate unaddressed 
incompatibility.

For 1, this could be fixed by making posix default to True if punctuation_chars 
is specified. Longer term, perhaps the default could be changed to True in all 
cases. I'm not sure what to do about 2.

(Please let me know if I should split these out into separate issues.)

--

___
Python tracker 

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



[issue27050] Demote run() below the high level APIs in subprocess docs

2016-11-13 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I still feel that having one function with various options is easier to explain 
than three separate functions with awkward names and limited use cases (e.g. no 
capturing output without checking the exit code). The tweeter you replied to 
said he didn't like subprocess.call(). If you really think the trio is a better 
starting point, though, you're the one with the power to change the docs ;-)

There's more awkwardness in the subprocess API; I suspect that what that 
tweeter wants is something built around an event loop - like Node - so you can 
handle output incrementally using events. That's not something that we can 
easily fix in subprocess, because we don't have a default event loop to attach 
subprocesses to.

--

___
Python tracker 

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



[issue28000] Build fails on AIX with _LINUX_SOURCE_COMPAT flag

2016-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7598e65a924e by Martin Panter in branch '3.5':
Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPAT
https://hg.python.org/cpython/rev/7598e65a924e

New changeset 77cb8fa47138 by Martin Panter in branch '2.7':
Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPAT
https://hg.python.org/cpython/rev/77cb8fa47138

--
nosy: +python-dev

___
Python tracker 

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



[issue28016] test_fileio fails on AIX

2016-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2ba15f05ed1 by Martin Panter in branch '3.5':
Issue #28016: Skip /dev/tty seekable() test on AIX
https://hg.python.org/cpython/rev/a2ba15f05ed1

New changeset b1f99e09bd77 by Martin Panter in branch '2.7':
Issue #28016: Skip /dev/tty seekable() test on AIX
https://hg.python.org/cpython/rev/b1f99e09bd77

--
nosy: +python-dev

___
Python tracker 

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



[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-13 Thread Xiang Zhang

Xiang Zhang added the comment:

> The name _PyUnicode_CompareWithIdEqual looks too long to me. What about 
> _PyUnicode_EqualToId?

+1. I think this name is more clear.

Serhiy's idea on the implementation sounds good. As for _PyUnicode_FROM_ID, I 
think it's better for another issue.

--
nosy: +xiang.zhang
Added file: http://bugs.python.org/file45479/_PyUnicode_EqualToId.patch

___
Python tracker 

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



[issue27050] Demote run() below the high level APIs in subprocess docs

2016-11-13 Thread Nick Coghlan

Nick Coghlan added the comment:

The introduction of run() and its presentation as the preferred interface has 
effectively reversed much of the progress that had been made in actually making 
the subprocess module approachable for the simplest use cases like 
https://twitter.com/fuzzychef/status/798025538237382656 (i.e. the exact case 
that "subprocess.call()" handles)

It does make sense to have run() as an intermediate tier of complexity between 
the base trio of call/check_call/check_output, and the full configurability of 
Popen, so it isn't the introduction of the API itself that's problematic, just 
the way we're currently presenting it.

--
priority: normal -> high

___
Python tracker 

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



[issue14119] Ability to adjust queue size in Executors

2016-11-13 Thread Vinay Anantharaman

Vinay Anantharaman added the comment:

I did a code reading myself and I noticed that task_done is not called as well. 
Is there a reason?

--
nosy: +Vinay Anantharaman

___
Python tracker 

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



[issue28629] Emit ResourceWarning when implicitly terminating a suspended frame?

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

This would be hard to get right, but maybe not impossible. If the frame is 
suspended, and will do special handling of GeneratorExit, a ResourceWarning 
would be nice in most cases. But if the frame will not catch any exception, 
there should be no ResourceWarning. I think this is the big difference between 
mygen() and Victor’s generator expression:

gen = (2**i for i in itertools.count())
next(gen)  # Generator suspended but won’t catch any exception
del gen  # Like deleting a plain iterator; no ResourceWarning expected

One more complication: If the frame is suspended at something like “yield from 
open(fname)”, it should trigger a ResourceWarning, because GeneratorExit would 
cause the file’s close() method to be called. But if “yield from” is calling a 
simpler generator-iterator with nothing to clean up, it should not emit a 
ResourceWarning.

--
nosy: +martin.panter

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-11-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-13 Thread Antony Lee

Changes by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue8840] truncate() semantics changed in 3.1.2

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

In general I agree with the doc strings giving the main details, and leaving 
smaller details for the reference documentation. Maybe for concrete 
implementations like BytesIO, it is not worth saying the expanded contents are 
undefined. One other way to make them shorter is to drop “as reported by 
tell()”.

diff --git a/Lib/_pyio.py b/Lib/_pyio.py
@@ -344,10 +344,12 @@
 def truncate(self, pos=None):
+"""Resize stream to at most size bytes.

Wouldn’t it be more correct to say “at most ‘pos’ bytes”?

You should avoid mentioning byte sizes for TextIOBase.truncate(); see Issue 
25849. Also applies to the StringIO subclasses.

+Position in the stream is left unchanged.  Size defaults to

I think it should be “The position in the stream . . .”, to match the other 
full sentences in these paragraphs.

--

___
Python tracker 

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



[issue23839] Clear caches after every test

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

When I run the tests with -Werror (or any other -W option), I now get

2 tests altered the execution environment:
test___all__ test_warnings

--
nosy: +martin.panter

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-11-13 Thread Joshua Jay Herman

Joshua Jay Herman added the comment:

ping

--

___
Python tracker 

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



[issue28678] tarfile extract docs inconsistent naming of parameter numeric_owner or numeric_only

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

Thanks Lewis

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28678] tarfile extract docs inconsistent naming of parameter numeric_owner or numeric_only

2016-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4aca14dbb66d by Martin Panter in branch '3.5':
Issue #28678: Fix references to numeric_owner parameter
https://hg.python.org/cpython/rev/4aca14dbb66d

New changeset 5efa1a39ee59 by Martin Panter in branch '3.6':
Issue #28678: Merge parameter name from 3.5 into 3.6
https://hg.python.org/cpython/rev/5efa1a39ee59

New changeset 817a003ecdc6 by Martin Panter in branch 'default':
Issue #28678: Merge parameter name from 3.6
https://hg.python.org/cpython/rev/817a003ecdc6

--
nosy: +python-dev

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2016-11-13 Thread Elliot Gorokhovsky

Changes by Elliot Gorokhovsky :


--
nosy: +tim.peters

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Actually I'm with Raymond -- I'm also not sure or mildly against (-0).
Given how easy it is to do without and how cumbersome using the operator
module is I don't see a great benefit. (IMO the operator module should be
the measure of *last* resort -- it is not to become part of anybody's
toolkit for common operators. But I seem to be a minority opinion here.)

--

___
Python tracker 

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



[issue24339] iso6937 encoding missing

2016-11-13 Thread Julien

Julien added the comment:

Hi John, thanks for your contribution,

Looks like your implementation is missing some codepoints, like "\t":

>>> print("\t".encode(encoding='iso6937'))  
   
[...]
UnicodeError: encoding with 'iso6937' codec failed (UnicodeError: 
Unacceptable utf-8 character)

Probably due to the "range(0x20, "…, why `0x20`?

You're having problems to decode multibytes sequences as you're not having the 
`else: … result += chr(c[0])` in this case. So typically decoding `\xc2\x20` 
will raise a `KeyError` as `\x20` is _not_ in your decoding table.

Also, please conform your contribution to the PEP8: you're missing spaces after 
comas and you're sometime indenting with 8 spaces instead of 4.

I implemented a simple checker based on glibc localedata, it show clearly your 
decoding problems step by step, and should be easily extended to check for your 
encoding function too, see attachment. It uses the ISO6937 found typically in 
the locales debian package or in an 'apt-get sourcee glibc'.

--
nosy: +sizeof
Added file: http://bugs.python.org/file45478/check_iso6937.py

___
Python tracker 

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



[issue28678] tarfile extract docs inconsistent naming of parameter numeric_owner or numeric_only

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

The offending commit is revision 6b70f16d585a. The true name is numeric_owner; 
numeric_only is wrong. The name also needs fixing in Doc/whatsnew/3.5.rst.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2016-11-13 Thread Elliot Gorokhovsky

New submission from Elliot Gorokhovsky:

When python compares two objects, there are many safety checks that have to be 
performed before the actual comparison can take place. These include checking 
the types of the two objects, as well as checking various type-specific 
properties, like character width for strings or the number of machine-words 
that represent a long. 

Obviously, the vast majority of the work done during a list.sort() is spent in 
comparisons, so even small optimizations can be important. What I noticed is 
that since we have n objects, but we're doing O(nlogn) comparisons, it pays off 
to do all the safety checks in a single pass and then select an optimized 
comparison function that leverages the information gained to avoid as many 
sort-time checks as possible. I made the following assumptions:

1. In practice, lists to be sorted are almost always type-homogeneous.
2. Most lists to be sorted consist of homogeneous elements of the following 
types:
a. Latin strings (i.e. strings whose characters are one machine-word wide)
b. Longs that fit in a single machine-word
c. Floats
d. Tuples of the above
3. The above assumptions also hold for lists constructed by taking a list of 
tuples to be sorted and extracting the first elements.
4. The vast majority of tuple comparisons never get past the first element 
(i.e. the first elements of tuples are rarely equal).

My patch adds the following routine to list.sort():
1. Go through the list and see which of the assumptions, if any, hold (except 
(4), which can't be checked in advance).
2. Replace PyObject_RichCompareBool() with an optimized compare function that 
is able to ignore some safety checks by applying the assumption we've already 
verified to be true.

There are then two questions: when none of the assumptions hold, how expensive 
is (1)? And when we do get a "hit", how much time do we save by applying (2)?

Those questions, of course, can only be answered by benchmarks. So here they 
are, computed on an isolated CPU core, on two python interpreters, both 
compiled with ./configure --with-optimizations:

# This is a runnable script. Just build the reference interpreter in python-ref 
and the patched interpreter in python-dev.

# Pathological cases (where we pay for (1) but don't get any savings from (2)): 
what kind of losses do we suffer?

# How expensive is (1) for empty lists?
python-dev/python -m perf timeit -s "l=[]" "sorted(l)" --rigorous 
python-ref/python -m perf timeit -s "l=[]" "sorted(l)" --rigorous  
# Median +- std dev: 212 ns +- 9 ns
# Median +- std dev: 216 ns +- 10 ns
# (difference is within std dev)

# How expensive is (1) for singleton lists?
python-dev/python -m perf timeit -s "l=[None]" "sorted(l)" --rigorous 
python-ref/python -m perf timeit -s "l=[None]" "sorted(l)" --rigorous
# Median +- std dev: 235 ns +- 16 ns
# Median +- std dev: 238 ns +- 15 ns
# (difference is within std dev)

# How expensive is (1) for non-type-homogeneous lists?
# (we use small lists because as n gets large, the fraction time spent in (1) 
gets smaller)
python-dev/python -m perf timeit -s "import random; l=[random.uniform(-1,1) for 
_ in range(0,10)]+[1]" "sorted(l)" --rigorous 
python-ref/python -m perf timeit -s "import random; l=[random.uniform(-1,1) for 
_ in range(0,10)]+[1]" "sorted(l)" --rigorous 
# Median +- std dev: 784 ns +- 35 ns
# Median +- std dev: 707 ns +- 51 ns
# 10% slower. While this is unfortunate, this case almost never occurs in 
practice, and the losses are certainly offset by the gains we'll see below.
# Also, note that for large lists, the difference would be *much* smaller, 
since the time spent in (1) gets smaller like 1/log(n).
# So basically, we only pay a penalty for non-type-homogeneous small lists.

# OK, now for the cases that actually occur in practice:

# What kind of gains do we get for floats?
python-dev/python -m perf timeit -s "import random; l=[random.uniform(-1,1) for 
_ in range(0,100)]" "sorted(l)" --rigorous
python-ref/python -m perf timeit -s "import random; l=[random.uniform(-1,1) for 
_ in range(0,100)]" "sorted(l)" --rigorous
# Median +- std dev: 3.63 us +- 0.20 us
# Median +- std dev: 8.81 us +- 0.37 us
# Wow! 59% faster! And if we used a large list, we would've gotten even better 
numbers.

# What kind of gains do we get for latin strings?
python-dev/python -m perf timeit -s "import random; 
l=[str(random.uniform(-1,1)) for _ in range(0,100)]" "sorted(l)" --rigorous
python-ref/python -m perf timeit -s "import random; 
l=[str(random.uniform(-1,1)) for _ in range(0,100)]" "sorted(l)" --rigorous
# Median +- std dev: 9.51 us +- 0.28 us
# Median +- std dev: 15.9 us +- 0.7 us
# 40% faster! 

# What kind of gains do we get for non-latin strings (which I imagine aren't 
that common to sort in practice anyway)
python-dev/python -m perf timeit -s "import random; 
l=[str(random.uniform(-1,1))+'\u' for _ in range(0,100)]" "sorted(l)" 
--rigorous
python-ref/python -m perf timeit -s 

[issue28646] Using a read-only buffer.

2016-11-13 Thread Martin Panter

Martin Panter added the comment:

Issue 11427 has some discussion about this. It seems one concern was to make it 
hard to modify the buffer of a bytes object (which is supposed to be 
immutable). But I agree there should be an easy way to access read-only buffers 
in ctypes. Perhaps that could be by relaxing from_buffer(), or perhaps by some 
safer or more explicit API.

See also Issue 11429, complaining about scattered support of writable buffers 
elsewhere, and using bytes objects with an offset.

--
nosy: +martin.panter
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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Maybe then it makes sense to apply this to 3.7? It looks like most people are 
in favour of this (also on python-ideas), only Raymond is not sure/mildly 
against.

--

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2639afcedaad by Xavier de Gaye in branch '3.6':
Issue #26934: Handle _ANDROID_API_LEVEL is None on Windows
https://hg.python.org/cpython/rev/2639afcedaad

New changeset 4012e28539c4 by Xavier de Gaye in branch 'default':
Issue #26934: Merge 3.6
https://hg.python.org/cpython/rev/4012e28539c4

--

___
Python tracker 

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



[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-13 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Tests in test_asyncio fail on Android when bind() on a unix socket raises 
PermissionError for a non-root user. See the attached test_asyncio.log. See 
also issue 28683 and its patch(es).

--
components: Tests, asyncio
files: test_asyncio.log
messages: 280714
nosy: giampaolo.rodola, gvanrossum, haypo, xdegaye, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: [asyncio] bind() on a unix socket raises PermissionError on Android for 
a non-root user
type: behavior
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45476/test_asyncio.log

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-11-13 Thread SilentGhost

SilentGhost added the comment:

Buildbots fail since _ANDROID_API_LEVEL could end up being None

--
nosy: +SilentGhost
status: closed -> open

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-11-13 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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



[issue26934] android: test_faulthandler fails

2016-11-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New changeset f37ac1a003f3 in branch 3.6.
New changeset 892f13827219 in branch default.

--

___
Python tracker 

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



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-11-13 Thread Julien

Julien added the comment:

`daemon` flag cannot be changed after thread is started, the documentation is 
right and the code of the daemon setter is actually:

if self._started.is_set():
raise RuntimeError("cannot set daemon status of active thread")

But still it looks like a code review problem: all your daemonic threads should 
be created as daemonic.

Breaking the `daemon` semantics looks like a bug magnet: any future uses of 
non-daemonic threads (by an "experienced" developer of your team, specifically 
needing a non-daemon thread for a specific task) will behave as a deamon thread 
and the specific task may not be correctly executed (like, logging an 
exception?).

--
nosy: +sizeof

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 66aac9676a28 by Xavier de Gaye in branch 'default':
Issue #26934: Fix test_faulthandler on Android where raise() exits with 0,
https://hg.python.org/cpython/rev/66aac9676a28

--
nosy: +python-dev

___
Python tracker 

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



[issue28683] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-13 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Tests in test_socket and test_asyncore fail on Android when bind() on a unix 
socket raises PermissionError for a non-root user. This occurs also in 
test_asyncio and this is logged in a separate issue as asyncio has its own 
project.

Patch attached.

--
assignee: xdegaye
components: Tests
files: bind_unix_socket.patch
keywords: patch
messages: 280709
nosy: xdegaye
priority: normal
severity: normal
stage: patch review
status: open
title: bind() on a unix socket raises PermissionError on Android for a non-root 
user
type: behavior
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45475/bind_unix_socket.patch

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2016-11-13 Thread Viorel Tabara

Viorel Tabara added the comment:

David, that sounds clear enough to me, thanks. However, English isn't my first 
language so I can't comment on the grammatical subtleties.

--

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ned Deily

Ned Deily added the comment:

I don't think this is appropriate for 3.6 now.  We're a little more than 4 
weeks from the final release - way past the feature code cut-off - and, from 
the comments here, there is no longer a total consensus that this feature 
should go back in at all after being pulled and largely forgotten about for a 
year.

--
assignee: ned.deily -> 
priority: release blocker -> normal
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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

operator_subscript_norefleak_v2.patch LGTM. Waiting for Ned's decision about 
3.6.

--
assignee:  -> ned.deily
priority: normal -> release blocker
stage: patch review -> commit review
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



[issue28681] About function renaming in the tutorial

2016-11-13 Thread R. David Murray

R. David Murray added the comment:

I would rewrite that paragraph as follows:

   A function definition associates the function name with
   the function object in the current symbol table.  The
   interpreter recognizes the object pointed to by that
   name as a user-defined function.  Other names can also
   point to that same function object and can then also
   be used as a function.

You will note that I've dropped the mention of renaming entirely, since the 
function does know it's __name__, and introducing that topic at this point in 
the tutorial would be confusing and unnecessary.  (NB: one could also say 
"referenced" and "reference" rather than "pointed to" and "point to"; I'm not 
sure which is more in line with the rest of the tutorial).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-13 Thread Elvis Pranskevichus

Elvis Pranskevichus added the comment:

Patch with updates attached.  Thanks for the feedback guys!

--
Added file: 
http://bugs.python.org/file45474/0001-Issue-28635-what-s-new-in-3.6-add-a-few-more-notes-o.patch

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Serhiy, thank you for review! Here is a corrected patch.

--
Added file: 
http://bugs.python.org/file45473/operator_subscript_norefleak_v2.patch

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2016-11-13 Thread R. David Murray

R. David Murray added the comment:

"instance parent class" is not terminology used in our docs as far as I 
remember.  "instance's class" would be more in line with the other docs.  That 
would solve the pronoun reference problem more succinctly, I think.

How about this version, which also improves the awkward phrasing, but without 
using em-dashes:

"When a non-data attribute of an instance is referenced, the instance's class 
is searched."

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2016-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This issue is not just about readability or performance. It is about 
correctness, since none of callers check for failure of 
_PyUnicode_CompareWithId.

I just came to the same problem from other side (replacing 
PyUnicode_CompareWithASCII with PyUnicode_EqualToASCII or 
_PyUnicode_CompareWithId). Josh's idea in general LGTM, but there are few 
details:

1. None of callers check for failure of new functions as well. In boolean 
context the failure is interpreted as true. What is even worse, an exception is 
set, and this can cause a crash in debug build.

If we don't want to rewrite all the uses of _PyUnicode_CompareWithId by adding 
the code for checking return value for error, we should make new function never 
failing. _PyUnicode_CompareWithId can fail if the first argument is not valid 
string or if there is no memory for allocating a Unicode object for identifier. 
I think it is better to return false value in these circumstances.

If the first argument is not string, it isn't equal to an identifier. If it is 
an invalid string, it can't be equal too. If there is no memory for allocating 
a Unicode object for identifier, we should fallback to comparing the raw 
content (like in PyUnicode_CompareWithASCII).

2. It may be worth to replace _PyUnicode_FromId with the macro:

#define _PyUnicode_FROM_ID(id) ((id)->object ? (id)->object : 
_PyUnicode_FromId(id))

Or rename _PyUnicode_FromId to _PyUnicode_FromIdInternal and _PyUnicode_FROM_ID 
to _PyUnicode_FromId? This would save us from rewriting a lot of code that uses 
_PyUnicode_FromId.

3. The name _PyUnicode_CompareWithIdEqual looks too long to me. What about 
_PyUnicode_EqualToId?

4. Pointers could be checked for equality before checking 
PyUnicode_CHECK_INTERNED(left). The former check is much cheaper than the 
latter.

--
components: +Interpreter Core, Unicode
nosy: +ezio.melotti, serhiy.storchaka
type:  -> behavior
versions: +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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

The patch is small and it was initially applied before 3.6b1, I think we should 
ask Ned (added to nosy) if this is OK to apply the fixed version?

--
nosy: +ned.deily

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Guido van Rossum

Guido van Rossum added the comment:

So we now have the refleak fixed. Can we apply the patch? Or is it too late for 
3.6?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue28635] Update What's New for 3.6

2016-11-13 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Thank you Yury and Elvis for working on this!

I have few more suggestions for What's New:

* collections.abc.Reversible (http://bugs.python.org/issue25987).

* various ABCs in collections.abc now have means for explicit 
"anti-registration" by setting a corresponding attribute to None 
(http://bugs.python.org/issue25958, 
https://docs.python.org/3.6/reference/datamodel.html#special-method-names).

* implementation improvements (such as caching of generic types) in typing 
module give up to 30x seep-up and reduce memory footprint.

* typing.py now supports generic type aliases 
(https://github.com/python/typing/pull/195 and 
https://github.com/python/typing/pull/308, see mypy docs for usage examples).

* typing.py supports PEP 526 syntax for typed NamedTuple 
(https://github.com/python/typing/pull/282).

(I see that there are already several items about typing, so please feel free 
to keep only the most important changes.)

--
nosy: +levkivskyi

___
Python tracker 

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



[issue28679] CGIHTTPServer displays raw python code when the url contains '/' after '?'

2016-11-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
stage:  -> resolved

___
Python tracker 

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



[issue28679] CGIHTTPServer displays raw python code when the url contains '/' after '?'

2016-11-13 Thread Yudai Fujiwara

Yudai Fujiwara added the comment:

I've just installed 2.7.11 and the bug seems to be fixed.
Thank you for your accurate solution!

Closed.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue28679] CGIHTTPServer displays raw python code when the url contains '/' after '?'

2016-11-13 Thread Xiang Zhang

Xiang Zhang added the comment:

I think this is a bug in 2.7.5 and has already been fixed. I'd suggest you get 
a more recent version of 2.7. :-)

--

___
Python tracker 

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



[issue28632] configparser does not close files in read

2016-11-13 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> resolved

___
Python tracker 

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



[issue28679] CGIHTTPServer displays raw python code when the url contains '/' after '?'

2016-11-13 Thread Yudai Fujiwara

Yudai Fujiwara added the comment:

Thanks for your reply. I uploaded server.py.
I'm using python 2.7.5 to run server.py on CentOS 7.
Both server.py and index.py are located in /var/www/html.

$ ls -lh
-rwxr-xr-x. 1 root root 189 11月 13 11:21 index.py
-rw-r--r--. 1 root root 239 11月 13 21:04 server.py

This is the response from the server when it works correctly:
$ ncat 192.168.3.5 8000
GET /index.py?value=data HTTP/1.1

HTTP/1.0 200 Script output follows
Server: SimpleHTTP/0.6 Python/2.7.5
Date: Sun, 13 Nov 2016 12:18:49 GMT
Content-type: text/html

value = data

And this is the response when the bug occurs:
$ ncat 192.168.3.5
GET /index.py?/ HTTP/1.1

HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.5
Date: Sun, 13 Nov 2016 12:06:42 GMT
Content-type: text/plain
Content-Length: 189
Last-Modified: Sun, 13 Nov 2016 02:21:11 GMT

#!/usr/bin/env python
# coding: utf-8
import cgi

form = cgi.FieldStorage()

print("Content-type: text/html")
print("")
print("value = {0}".format( form.getvalue('value', 'None') )

The server.py is running on the terminal and it seems to be working perfectly:
$ python server.py
192.168.3.5 - - [13/Nov/2016 21:18:49] "GET /index.py?value=data HTTP/1.1" 200 -
192.168.3.5 - - [13/Nov/2016 21:20:42] "GET /index.py?/ HTTP/1.1" 200 -

Maybe the configuration in server.py is wrong?

--
Added file: http://bugs.python.org/file45472/server.py

___
Python tracker 

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



[issue28679] CGIHTTPServer displays raw python code when the url contains '/' after '?'

2016-11-13 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry Yudai, I cannot reproduce this. Both '/index.py?value=data' and 
'/index.py?/' outputs 'value = None' with your index.py.

--
nosy: +martin.panter, xiang.zhang

___
Python tracker 

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



[issue28632] configparser does not close files in read

2016-11-13 Thread Petr

Petr added the comment:

Thanks for your comments, I am myself quite puzzled how is it possible that the 
file is not closed after having been read. I suspect this to be an OS problem, 
therefore I am closing the bug for now.

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

___
Python tracker 

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



[issue28651] Make objects with empty __slots__ GC types

2016-11-13 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Here is a new patch that does not cause refleaks, I just replaced empty 
__slots__ with a __setattr__: it looks like __slots__ are not needed here to 
save memory (there is only a singleton instance), they were used just to create 
an immutable object.

--
Added file: http://bugs.python.org/file45471/operator_subscript_norefleak.patch

___
Python tracker 

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



[issue11437] IDLE crash on startup with typo in config-keys.cfg

2016-11-13 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



[issue28681] About function renaming in the tutorial

2016-11-13 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> And this is aliasing:
>  g = f

Is it only aliasing if you know that f is a function? I don't mean that 
as a rhetorical question -- I'm asking if we're comfortable with the 
idea of saying that g is an alias when f is (say) a float.

--

___
Python tracker 

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



[issue28682] Bytes support in os.fwalk()

2016-11-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

os.walk() supports string and bytes paths, but os.fwalk() always supported only 
string paths. Proposed patch adds support of bytes paths in os.fwalk().

--
components: Library (Lib)
files: fwalk-bytes.patch
keywords: patch
messages: 280690
nosy: larry, loewis, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Bytes support in os.fwalk()
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45470/fwalk-bytes.patch

___
Python tracker 

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



[issue27998] Bytes paths now are supported in os.scandir() on Windows

2016-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch documents bytes paths support on Windows.

--
keywords: +patch
nosy: +Elvis.Pranskevichus, yselivanov
stage: needs patch -> patch review
Added file: http://bugs.python.org/file45469/doc-scandir-bytes.patch

___
Python tracker 

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