[issue25270] codecs.escape_encode systemerror on empty byte string

2015-10-01 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 01.10.2015 04:35, Martin Panter wrote:
> For the record, because I was curious: Function codecs.escape_encode() is not 
> documented, and barely tested. It was used for the documented “string_escape” 
> codec in Python 2, but this codec was removed for Python 3 in revision 
> bc90fc9b70b7. The function was apparently added to support pickling, but I 
> don’t see any evidence that it was ever used. Only the decode counterpart was 
> used. I wonder if the encode function could be removed at some point.

It's a codec, so either we remove both functions or leave both
functions in. It's still used in pickletools and serves a useful
purpose there (to unescape embedded escapes in byte streams).

--

___
Python tracker 

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



[issue25270] codecs.escape_encode systemerror on empty byte string

2015-10-01 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 30.09.2015 15:11, Serhiy Storchaka wrote:
> May be better to test a condition "size > 0" before calling 
> _PyBytes_Resize(), as in many other case where _PyBytes_Resize() is used.
> 
> Or accept shared objects in _PyBytes_Resize() if new size is equal to old 
> size. This will allow to getrid of additional tests before calling 
> _PyBytes_Resize().

Agreed. It would be good to make _PyBytes_Resize() more robust for
shared objects.

--

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Attached patch raises a ValueError if the current recursion depth is higher 
than the new "low-water mark". The low-water mark is the value computed by 
_Py_MakeEndRecCheck() in Py_LeaveRecursiveCall() to decide if we can reset the 
overflowed field of the thread state to 0.

Example of error with the patch:

$ ./python -c 'import sys; sys.setrecursionlimit(2)'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: cannot set recursion limit to 2: the minimum recursion limit is 1 
at the recursion depth 1

--
keywords: +patch
title: "./python -m test test_sys": Fatal Python error: Cannot recover from 
stack overflow -> sys.setrecursionlimit() must fail if the current recursion 
depth is higher than the new low-water mark
Added file: http://bugs.python.org/file40640/sys_setrecursionlimit.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-10-01 Thread Robin Roth

Robin Roth added the comment:

This bug is still present and annoying.
For me it appeared when running ismount on a nfs-mounted directory, when the 
user who runs python has no read permission inside the directory. Therefore the 
lstat on /mntdir/.. fails.
Attached a patch that fixes this by running abspath on the path.

Symlinks will also work because they are checked/excluded before the part of 
the code where the patch is in.

msg222528 is not related to the original bug and should be opened separately.

--
keywords: +patch
nosy: +Robin Roth
Added file: http://bugs.python.org/file40641/ismount-permission.patch

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 835085cc28cd by Victor Stinner in branch '3.5':
Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
https://hg.python.org/cpython/rev/835085cc28cd

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 202c827f86df by Victor Stinner in branch '2.7':
Issue #25003: os.urandom() doesn't use getentropy() on Solaris because
https://hg.python.org/cpython/rev/202c827f86df

New changeset 83dc79eeaf7f by Victor Stinner in branch '3.4':
Issue #25003: os.urandom() doesn't use getentropy() on Solaris because
https://hg.python.org/cpython/rev/83dc79eeaf7f

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I pushed fixes for Python 2.7, 3.4, 3.5 and 3.6.

Summary for Solaris:

- Python 2.7, 3.4: read from /dev/urandom (use a private file descriptor)
- Python 3.5, 3.6: use the getrandom() function on Solaris 11.3 and newer (no 
file descriptor), or fallback on reading from /dev/urandom (use a private file 
descriptor)

getentropy() is no more used on Solaris.

@John Beck: It would be great if you could run test_os on the development 
branches 2.7, 3.4, 3.5 and default (3.6).

--

___
Python tracker 

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



[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Xiang Zhang

Xiang Zhang added the comment:

I can reproduce this action on Ubuntu.

The forged readline.py in python's execution directory can steal the
permission of python and do something dangerous.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Oh, the default handler for errror handlers uses a loop to check for non-ASCII 
characters. It can be replaced with PyUnicode_IS_ASCII(str) which has a 
complexity O(1). Done in new patch.

--
Added file: http://bugs.python.org/file40647/utf8_encoder_errors-3.patch

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread STINNER Victor

New submission from STINNER Victor:

The AMD64 Windows7 SP1 3.x buildbot randomly fails. Tests take a lot of time. I 
don't know if it's a slow hardware/VM, or if the system is very busy. By the 
way, regrtest is run with -j4 (run 4 tests in parallel).

Example of errors:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/6773/steps/test/logs/stdio
---
...
[396/399] test_long -- running: test_lib2to3 (102 sec), test_strptime (54 sec)
[397/399] test_source_encoding -- running: test_lib2to3 (102 sec), 
test_strptime (54 sec)
running: test_lib2to3 (162 sec), test_strptime (114 sec)
[398/399] test_lib2to3 (205 sec) -- running: test_strptime (159 sec)

command timed out: 3900 seconds without output, attempting to kill
program finished with exit code 1
elapsedTime=4929.577000
---


http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/6783/steps/test/logs/stdio
---
...
[392/399] test_wait3 -- running: test_tools (247 sec), test_strptime (770 sec)
[393/399] test_httplib -- running: test_tools (253 sec), test_strptime (776 sec)
[394/399] test_strtod -- running: test_tools (254 sec), test_strptime (777 sec)
[395/399] test_fork1 -- running: test_tools (255 sec), test_strptime (777 sec)
[396/399] test_xmlrpc -- running: test_tools (263 sec), test_strptime (785 sec)
[397/399] test_multiprocessing_main_handling -- running: test_tools (271 sec), 
test_strptime (794 sec)
running: test_tools (331 sec), test_strptime (854 sec)
[398/399] test_tools (337 sec) -- running: test_strptime (861 sec)

command timed out: 3900 seconds without output, attempting to kill
program finished with exit code 1
elapsedTime=5068.979000
---

--
components: Windows
messages: 252025
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot
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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy wrote:
> This message looks confusing to me. 2 > 1, isn't?
> The dependency of min_limit from new_limit is not monotonic: (...)

Ok, now I'm confused too :-)

First of all, I propose to change the exception type to RecursionError because 
it's really strange to get a ValueError depending on the current recursion 
depth.

I would prefer to have an hardcoded minimum limit instead of a minimum 
depending on the current recursion depth, but I'm not sure that it's 
technically possible according to current constraints in CPython.

Updated patch (version 3) doesn't mention the computed "minimum limit" in the 
error message since it's hard to compute it for the user (and even for me :-)). 
For the user, it's hard to estimate (or compute) the current recursion depth.

Updated example:

$ ./python -c 'import sys; sys.setrecursionlimit(0)'
Traceback (most recent call last):
  File "", line 1, in 
ValueError: recursion limit must be greater or equal than 1

$ ./python -c 'import sys; sys.setrecursionlimit(1)'
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: cannot set recursion limit to 1 at the recursion depth 1: the 
limit is too low

$ ./python -c 'import sys; sys.setrecursionlimit(2)'
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: cannot set recursion limit to 2 at the recursion depth 1: the 
limit is too low

$ ./python -c 'import sys; sys.setrecursionlimit(3)'

(A limit of 3 is valid.)

--
Added file: http://bugs.python.org/file40643/sys_setrecursionlimit-3.patch

___
Python tracker 

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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Oh, there is a bug in utf8_encoder() (not in my patch!), newpos was not used 
after calling the error handler. It's now fixed in the new patch.

--
Added file: http://bugs.python.org/file40646/utf8_encoder_errors-2.patch

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

> The dependency of min_limit from new_limit is not monotonic: (...)

Right, _Py_MakeEndRecCheck() is not monotonic.

Let me try to make it monotonic:

def f1(x): return x * 3 // 4
def f2(x): return x - 50

f1() > f2() for x <= 196
f1() == f2() for x in 198..200
f1() < f2() for x > 201

So I propose to switch between f1() and f2() at x>200 for 
_Py_MakeEndRecCheck(). It gives:

recursion depth => low-water mark

25 => 18
...
50 => 37
...
75 => 56
...
100 => 75
...
125 => 93
...
150 => 112
...
175 => 131
...
198 => 148 -- use f1 (x*3/4)
199 => 149
200 => 150 
201 => 151 -- switch to f2 (x-50)
202 => 152
203 => 153

Attached end_rec_check.patch makes _Py_MakeEndRecCheck() monotonic.

--
Added file: http://bugs.python.org/file40644/end_rec_check.patch

___
Python tracker 

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



[issue25123] Logging Documentation - dictConfig disable_existing_loggers

2015-10-01 Thread Vinay Sajip

Vinay Sajip added the comment:

This is mentioned in the documentation for dictConfig - see the bottom of the 
section at 
https://docs.python.org/2.7/library/logging.config.html#dictionary-schema-details

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



[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread Berker Peksag

Berker Peksag added the comment:

LGTM

> Alternative: Add a new sys.implementation.debug_build flag.

According to the sys.implementation documentation and PEP 421, we can only add 
a private attribute without writing a PEP. But I find 
sys.implementation._debug_build too long and ``from sys import implementation; 
implementation._debug_build``(or ``from sys import implementation as i; 
i._debug_build``) is also not easy to write. So I'm +1 to sys.debug_build.

I left two trivial review comments on Rietveld.

--
nosy: +berker.peksag
stage: patch review -> commit review

___
Python tracker 

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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file40645/bench.py

___
Python tracker 

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



[issue25277] test_eintr hangs on randomly on "AMD64 FreeBSD 9.x 3.x"

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10efb1797e7b by Victor Stinner in branch 'default':
Issue #25277: Set a timeout of 10 minutes in test_eintr using faulthandler to
https://hg.python.org/cpython/rev/10efb1797e7b

--
nosy: +python-dev

___
Python tracker 

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



[issue25185] Inconsistency between venv and site

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d927c6cae05f by Vinay Sajip in branch '3.4':
Closes #25185: Use UTF-8 encoding when reading pyvenv.cfg.
https://hg.python.org/cpython/rev/d927c6cae05f

New changeset eaf9220bdee3 by Vinay Sajip in branch '3.5':
Closes #25185: merged fix from 3.4.
https://hg.python.org/cpython/rev/eaf9220bdee3

New changeset 69dd42cef190 by Vinay Sajip in branch 'default':
Closes #25185: merged fix from 3.5.
https://hg.python.org/cpython/rev/69dd42cef190

--
nosy: +python-dev
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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Benchmark results. Sorry for the very long output.

There are some (corner?) cases where the patched Python is a little bit slower. 
I consider that it's ok since it's *much* faster in the other cases.

What do you think?


Common platform:
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)
Bits: int=32, long=64, long long=64, size_t=64, void*=64
CPU model: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Python unicode implementation: PEP 393
Timer: time.perf_counter
SCM: hg revision=10efb1797e7b+ tag=tip branch=default date="2015-10-01 13:16 
+0200"
Platform: Linux-4.1.6-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
CFLAGS: -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes

Platform of campaign before:
Date: 2015-10-01 13:30:07
Timer precision: 61 ns
Python version: 3.6.0a0 (default:10efb1797e7b, Oct 1 2015, 13:30:06) [GCC 5.1.1 
20150618 (Red Hat 5.1.1-4)]

Platform of campaign after:
Timer precision: 63 ns
Date: 2015-10-01 13:54:14
Python version: 3.6.0a0 (default:10efb1797e7b+, Oct 1 2015, 13:53:51) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]

--+-+
ignore: "\udcff" * length |  before |   after
--+-+
length=10**1  | 3.16 us (*) |   279 ns (-91%)
length=10**3  |  241 us (*) | 1.08 us (-100%)
length=10**2  | 23.9 us (*) |   346 ns (-99%)
length=10**4  | 2.39 ms (*) | 6.48 us (-100%)
--+-+
Total | 2.66 ms (*) | 8.19 us (-100%)
--+-+

+-+---
ignore: "a" * length + "\udcff" |  before |  after
+-+---
length=10**1| 1.12 us (*) |  295 ns (-74%)
length=10**3|  2.2 us (*) | 1.57 us (-29%)
length=10**2| 1.21 us (*) |  408 ns (-66%)
length=10**4| 10.4 us (*) | 12.3 us (+18%)
+-+---
Total   |   15 us (*) |14.6 us
+-+---

+-+---
ignore: ("a" * 99 + "\udcff" * 99) * length |  before |  after
+-+---
length=10**1|  238 us (*) | 2.46 us (-99%)
length=10**3| 23.7 ms (*) |  234 us (-99%)
length=10**2| 2.38 ms (*) | 20.8 us (-99%)
length=10**4|  238 ms (*) | 2.56 ms (-99%)
+-+---
Total   |  265 ms (*) | 2.82 ms (-99%)
+-+---

---+-+
ignore: ("\udcff" * 99 + "a") * length |  before |   after
---+-+
length=10**1   |  239 us (*) |  1.29 us (-99%)
length=10**3   | 23.8 ms (*) | 80.9 us (-100%)
length=10**2   |  2.4 ms (*) | 8.44 us (-100%)
length=10**4   |  236 ms (*) |  839 us (-100%)
---+-+
Total  |  263 ms (*) |  930 us (-100%)
---+-+

+-+---
ignore: "\udcff" + "a" * length |  before |  after
+-+---
length=10**1| 1.09 us (*) |  297 ns (-73%)
length=10**3| 2.19 us (*) | 1.58 us (-28%)
length=10**2| 1.19 us (*) |  409 ns (-66%)
length=10**4| 10.5 us (*) | 12.3 us (+17%)
+-+---
Total   | 14.9 us (*) |14.6 us
+-+---

---+-+
replace: "\udcff" * length |  before |   after
---+-+
length=10**1   | 3.47 us (*) |   317 ns (-91%)
length=10**3   |  263 us (*) | 1.07 us (-100%)
length=10**2   | 26.4 us (*) |   383 ns (-99%)
length=10**4   | 2.65 ms (*) | 6.75 us (-100%)
---+-+

[issue23749] asyncio missing wrap_socket (starttls)

2015-10-01 Thread Mathieu Sornay

Changes by Mathieu Sornay :


--
nosy: +msornay

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2015-10-01 Thread R. David Murray

R. David Murray added the comment:

This issue was reported again in issue 25288.

To summarize: the cwd should only be used for imports *after* the command 
prompt is displayed, and readline is imported *before* the prompt is displayed 
but currently is imported from the cwd.  This should be fixed.

--

___
Python tracker 

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



[issue25290] csv.reader: minor docstring typo

2015-10-01 Thread Johannes Niediek

New submission from Johannes Niediek:

docstring ends with colon, should be fullstop.

--
components: Library (Lib)
files: csvreader_docstring.txt
messages: 252030
nosy: wasserverein
priority: normal
severity: normal
status: open
title: csv.reader: minor docstring typo
type: enhancement
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file40648/csvreader_docstring.txt

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2015-10-01 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> needs patch
versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread Jeremy Kloth

Jeremy Kloth added the comment:

The system is a dedicated Quad CPU @2.66GHz with 8GB RAM and running the tests 
on an SSD.  I doubt it is the hardware.

Please note, it is the only 64-bit Windows buildbot AND the only multi-core 
Windows buildbot.  So it catches lots of things that most others do not.

Last chance I had to find the missing test, it was test__locale.

Also note that 3.5 is passing just fine, so it is something particular to the 
3.x branch.

--
nosy: +jkloth

___
Python tracker 

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



[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread R. David Murray

R. David Murray added the comment:

Well, so much for my memory :(.

The actual discussion was in issue 12238, where *my* conclusion was that this 
should be fixed (readline should be special cased), but the issue is still open.

Patches welcome :)

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Readline module loading in interactive mode

___
Python tracker 

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



[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread R. David Murray

R. David Murray added the comment:

This is not a bug, this is the way python works.  When running in interactive 
mode (only) the current directory is first on the path.

Now, should this behavior be changed?  I think we've discussed this before and 
decided not to change it (for backward compatibility reasons), but I think 
there was dissent and that increasing emphasis on security since that 
discussion might argue for a different outcome.  It's a python-dev mailing list 
level issue, in any case.

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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-10-01 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

By the way, I'm surprised how slow is this buildbot. On Linux, running the 
whole test suite (399 tests) takes less than 5 minutes with -j4 on my PC (Intel 
i7-2600 @ 3.40GHz with 12 GB of RAM).

Is Python much slower on Windows? Or the buildbot CPU is *much* slower than 
mine?

--

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread Zachary Ware

Zachary Ware added the comment:

I was curious, so I checked:

C:\Users\Zachary\code\hg.python.org\3.5>python.bat -m test.pystone
Running Debug|x64 interpreter...
Pystone(1.2) time for 5 passes = 1.14142
This machine benchmarks at 43805 pystones/second

C:\Users\Zachary\code\hg.python.org\3.5>python.bat -m test.pystone
Running Release|x64 interpreter...
Pystone(1.2) time for 5 passes = 0.421115
This machine benchmarks at 118732 pystones/second

C:\Users\Zachary\code\hg.python.org\3.5>python.bat -m test.pystone
Running PGUpdate|x64 interpreter...
Pystone(1.2) time for 5 passes = 0.281218
This machine benchmarks at 177798 pystones/second

These were run on a Windows 8.1 Virtualbox VM on a Mac.  For reference, here's 
the results for the host machine using python3.5.0 from python.org:

$ python3 -m test.pystone
Pystone(1.2) time for 5 passes = 0.413982
This machine benchmarks at 120778 pystones/second

--

___
Python tracker 

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



[issue25276] test_decimal sometimes crash on PPC64 AIX 3.x

2015-10-01 Thread Stefan Krah

Stefan Krah added the comment:

Usually these segfaults are toolchain bugs (I've had at least 8,
including gcc, suncc, libc...).


Just a couple of observations:

  - The bot builds with -DCONFIG_32=1 -DANSI=1 despite being PPC64.

  - When we had an AIX snakebite machine, the xlc compile worked on
AIX (using about 50 obscure command line arguments).

  - In the default build, libmpdec functions use a lot of stack
memory (for optimization while avoiding alloca). But there are
no recursive tests, so a stack overflow would seem unlikely.

--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

On Linux, I also run the Python test suite with Python compiled in
debug mode. I'm forcing the -O0 flag to disable *all* compilation
optimization. All assertions are kept, etc.

Maybe the slowness comes from CRT checks, maybe.

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-10-01 Thread John Beck

John Beck added the comment:

Confirmed that test_os runs cleanly on Solaris 12, for each of:
* 2.7.10 (plus your patch from 98454:202c827f86df)
* 3.4.3 (plus your patch from 98455:83dc79eeaf7f)
* 3.5.0 (plus your patch from 98452:835085cc28cd)
* 3.6 (tip)

--

___
Python tracker 

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



[issue15663] Investigate providing Tcl/Tk 8.6 with OS X installers

2015-10-01 Thread Ronald Oussoren

Ronald Oussoren added the comment:

W.r.t. install_name_tool: macholib (PyPI project) contains functionality to do 
this work in pure python.   

I do not propose to include macholib in the stdlib, it is too special purpose 
and not everyone that has provided patches is a CPython contributor (although 
the majority of the work was done by Bob Ippolito)

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Thanks! I close the issue, it's now fixed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25289] test_strptime hangs sometimes on AMD64 Windows7 SP1 3.x buildbot

2015-10-01 Thread Zachary Ware

Zachary Ware added the comment:

Jeremy Kloth wrote:
> Please note, it is the only 64-bit Windows buildbot

That's not true anymore; in fact, all but David Bolen's XP and Windows 7 bots 
are 64-bit.  Yours is the one one in the 'stable' set, but that classification 
is a bit out of date for the whole set.  Current 64-bit Windows bots are yours, 
David Bolen's Windows8 and Windows10 bots, and my Windows8.1 Non-Debug bot.

> AND the only multi-core Windows buildbot.

This is still true, though.

Victor Stinner wrote:
> Is Python much slower on Windows?

I think the test suite is significantly slower on Windows; I'm not certain 
about Python itself.  It routinely takes well over 20 minutes on my Windows 
machines.  The fact that the bot in question compiles in Debug configuration 
may also be playing into it; Debug config links with the debug CRT, which 
enables a bunch of extra checks at the CRT level.

--

___
Python tracker 

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



[issue23447] Import fails when doing a circular import involving an `import *`

2015-10-01 Thread Steven Barker

Steven Barker added the comment:

Thanks for looking at the issue Brett.

I think you're right that your patch has incorrect semantics, since it doesn't 
save the value to the provided namespace if it had to go through the special 
path to find the name. I think my patch got that part right (though I 
definitely missed one PyUnicode_Check).

I've just noticed that our patches may not always do the right thing in all 
error situations. They may return -1 without setting an exception (or perhaps 
passing on a strange one from an internal call) if there's something weird 
going on like `__name__` not existing or not being a string.

I'm attaching a new version of my patch that moves the PyErr_Format call down 
to the later check for `value == NULL`. This handles both the basic case where 
nothing strange goes on but the requested name is not found, and the weird 
cases where unexpected stuff goes wrong. It will replace any errors raised by 
the earlier code with an ImportError. I think an ImportError is the appropriate 
exception for most error cases, but perhaps some internal errors should not be 
overwritten and more complicated error logic is needed.

I also notice that the code in the "import_from" function (from which I 
borrowed heavily for my patch) was changed in one of the 3.5rc patches to have 
new error handling (it raises ImportError more often I think). I don't see an 
obvious way to copy its new error logic to import_all_from, but my C coding 
skills are rather rusty so I could be missing an easy approach.

--
Added file: http://bugs.python.org/file40649/23447_4.diff

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-01 Thread John Gray

John Gray added the comment:

See Issue14576 which is the same underlying issue.

--
nosy: +John Gray

___
Python tracker 

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



[issue22413] Bizarre StringIO(newline="\r\n") translation

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't see a reason to deprecate anything. Can you write up in one paragraph 
how StringIO's newline flag differs from the one to TextIOWrapper? (What 
happens to the initial value is a separate issue AFAIC.)

--

___
Python tracker 

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



[issue14576] IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows

2015-10-01 Thread John Gray

John Gray added the comment:

I hit this issue with an "H:" homedrive that is on a network share, and then in 
Windows is using "offline files" to keep a local copy.   .idlerc was not cached 
so IDLE worked when online/connected to my work network but not when I was 
offline. 

The temporary workaround was to mark .idlerc as "available offline" when 
connected.  I wanted to document this in case others hit this scenario.  

I also noticed that there is a .idlerc directory created in my local user 
directory c:\users\[username\.idlerc.  This one has the recent-files.lst in it. 
 So IDLE is creating two copies of .idlerc - one in the 
environment-variable-defined (and roaming) home directory, and one in the 
default local user directory.   I would suggest that as this bug is 
investigated, you keep track of both instances of .idlerc.

--
nosy: +John Gray

___
Python tracker 

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



[issue14576] IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows

2015-10-01 Thread John Gray

John Gray added the comment:

For the h: drive issue mentioned above:  This was on Python 2.7.10.

--

___
Python tracker 

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



[issue25272] asyncio tests are getting noisy

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Or call gc.collect() in that TestCase.setUp()?

--

___
Python tracker 

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



[issue25291] ssl socket gets into broken state when client exits during handshake

2015-10-01 Thread Oleg

Oleg added the comment:

when i run the server in one terminal and the client in another

the server output wold be:

Serving on ('127.0.0.1', 8443)
my transport None
my backlog len 2
my backlog size 4200

that output proves that it is trying to write into socket, 
while there is no transport!

see attached example server+client mini apps.

--
title: better Exception message for certain task termination scenario -> ssl 
socket gets into broken state when client exits during handshake
type: enhancement -> 
Added file: http://bugs.python.org/file40651/example_files.tar.gz

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-01 Thread Vinay Sajip

Changes by Vinay Sajip :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25291] ssl socket gets into broken state when client exits during handshake

2015-10-01 Thread Oleg

Oleg added the comment:

Please disregard previous comment!(or delete it),
i wanted to create new issue instead!

--

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252050

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you fix the issue title or do you want me to fix it? And did you also add a 
file you meant to go to a different issue? (Maybe link to the new issue and I 
can figure it out.)

--

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-01 Thread Zachary Ware

Zachary Ware added the comment:

Thanks, Vinay!

--
stage: needs patch -> resolved
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

_Py_MakeEndRecCheck() was changed in issue5392 (noised Antoine as a committer). 
There are many ways to make it monotonic.

#define _Py_MakeEndRecCheck(x) \
(--(x) < ((_Py_CheckRecursionLimit > 200) \
? (_Py_CheckRecursionLimit - 25) \
: (3 * (_Py_CheckRecursionLimit >> 2

#define _Py_MakeEndRecCheck(x) \
(--(x) < ((_Py_CheckRecursionLimit > 100) \
? (_Py_CheckRecursionLimit - 50) \
: (_Py_CheckRecursionLimit >> 1)))

Since the formula is so complex, it would be worth to extract common part from 
_Py_MakeEndRecCheck() and sys_setrecursionlimit(). Otherwise the code can 
become desynchronized.

The error message still looks confusing to me. May be short it to "limit is too 
low"? Noised David as grammar expert.

Why not have an hardcoded minimum limit? Current recursion depth and therefore 
minimal recursion limit are implementation defined and can depend on a way how 
the module is executed (run a script, import a module, run with runpy or IDLE, 
etc). May be interpret the limit relatively to current recursion depth?

--
nosy: +pitrou, r.david.murray

___
Python tracker 

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



[issue24884] Add method reopenFile() in WatchedFileHandler class

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6d61b057c375 by Vinay Sajip in branch 'default':
Closes #24884: refactored WatchedFileHandler file reopening into a separate 
method, based on a suggestion and patch by Marian Horban.
https://hg.python.org/cpython/rev/6d61b057c375

--
nosy: +python-dev
resolution:  -> fixed
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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Oleg

Changes by Oleg :


--
title: ssl socket gets into broken state when client exits during handshake -> 
better Exception message for certain task termination scenario

___
Python tracker 

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



[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

> I don't like this. The sys module is one of most used module, but it has too 
> many members, and adding yet one makes the situation worse.

Hum, what is the problem of adding a symbol? How does it make the module less 
usable?

> Checking for debug mode is not often needed, and mainly in tests.

My patch changes distutils, sysconfig and warnings modules, I agree that other 
changes are only in tests.

>  Current way ``hasattr(sys, 'gettotalrefcount')`` works good.

For me it looks more like an hack than a reliable check.

> You also can check ``'d' in sys.abiflags`` if it looks cleaner to you.

For me, it doesn't look correct to have various ways to check if python was 
compiled in debug mode. It doesn't look portable neither. I prefer to use a 
flag which works on any version of Python (>= 3.6) and any implementation of 
Python.

I don't think that PyPy wants to implement sys.gettotalrefcount() for example, 
but PyPy may want to mimick CPython when it's compiled in debug mode. For 
example, display warnings by default in debug mode.

--

___
Python tracker 

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



[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

I just pushed my patch to optimize the UTF-8 encoder with error handlers: see 
the issue #25267. It's up to 70 times as fast. The patch was based on Serhiy's 
work: faster_surrogates_hadling.patch attached to this issue.

--

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Oleg

New submission from Oleg:

the weird condition in the code 
causes the task to end with double exception, hard
to understand what really had happened. 

 
producing output like that:


|i am task..
|i keep working
|Exception in callback Task._step()
|handle: 
|Traceback (most recent call last):
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/tasks.py", line 239, 
in _step
|result = coro.send(value)
|StopIteration
|
|During handling of the above exception, another exception occurred:
|
|Traceback (most recent call last):
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/events.py", line 
125, in _run
|self._callback(*self._args)
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/tasks.py", line 241, 
in _step
|self.set_result(exc.value)
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/futures.py", line 
335, in set_result
|raise InvalidStateError('{}: {!r}'.format(self._state, self))
|asyncio.futures.InvalidStateError: FINISHED:  exception=RuntimeError('something 
bad',)>


it would be good to improve that shutdown procedure 
to pinpoint real reason why and when it got into broken state.

additional info can be found here:
https://groups.google.com/forum/#!topic/python-tulip/-EcYtJXDvSo

--
components: asyncio
files: test_aio_exception.py
messages: 252049
nosy: gvanrossum, haypo, ovex, yselivanov
priority: normal
severity: normal
status: open
title: better Exception message for certain task termination scenario
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file40650/test_aio_exception.py

___
Python tracker 

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



[issue25292] ssl socket gets into broken state when client exits during handshake

2015-10-01 Thread Oleg

New submission from Oleg:

when i run the server in one terminal and the client in another

the server output wold be:

Serving on ('127.0.0.1', 8443)
my transport None
my backlog len 2
my backlog size 4200

that output proves that it is trying to write into socket, 
while there is no transport!

see attached example server+client mini apps.

--
components: asyncio
files: example_files.tar.gz
messages: 252052
nosy: gvanrossum, haypo, ovex, yselivanov
priority: normal
severity: normal
status: open
title: ssl socket gets into broken state when client exits during handshake
versions: Python 3.5
Added file: http://bugs.python.org/file40652/example_files.tar.gz

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252051

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


Removed file: http://bugs.python.org/file40651/example_files.tar.gz

___
Python tracker 

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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b5357b38366 by Victor Stinner in branch 'default':
Issue #25267: The UTF-8 encoder is now up to 75 times as fast for error
https://hg.python.org/cpython/rev/2b5357b38366

--
nosy: +python-dev

___
Python tracker 

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



[issue25097] test_logging may fail with 'Access is denied' when pywin32 is installed

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 72c57c120c19 by Vinay Sajip in branch '3.4':
Fixes #25097: Windows test is skipped if there are insufficient privileges, 
rather than failing.
https://hg.python.org/cpython/rev/72c57c120c19

New changeset b54528d8d8c3 by Vinay Sajip in branch '3.5':
Fixes #25097: Merged fi from 3.4.
https://hg.python.org/cpython/rev/b54528d8d8c3

New changeset 757baaedc043 by Vinay Sajip in branch 'default':
Fixes #25097: Merged fix from 3.5.
https://hg.python.org/cpython/rev/757baaedc043

--
nosy: +python-dev

___
Python tracker 

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



[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't like this. The sys module is one of most used module, but it has too 
many members, and adding yet one makes the situation worse.

>>> len(dir(sys))
81

Checking for debug mode is not often needed, and mainly in tests. Current way 
``hasattr(sys, 'gettotalrefcount')`` works good. You also can check ``'d' in 
sys.abiflags`` if it looks cleaner to you. Or add a member to test.support.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

(OK, issue should be all cleaned up. :-)

--

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252053

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

The overflowed flag was introduced 8 years ago (near the release of Python 3.0) 
by the following changeset:

changeset:   42013:cd125fe83051
user:Martin v. Löwis 
date:Sun Jun 10 09:51:05 2007 +
files:   Include/ceval.h Include/pystate.h Include/stringobject.h 
Include/unicodeobject.h Lib/test/test_frozen.py Lib/test/test_new.py 
Lib/test/test
description:
Make identifiers str (not str8) objects throughout.
This affects the parser, various object implementations,
and all places that put identifiers into C string literals.

In testing, a number of crashes occurred as code would
fail when the recursion limit was reached (such as the
Unicode interning dictionary having key/value pairs where
key is not value). To solve these, I added an overflowed
flag, which allows for 50 more recursions after the
limit was reached and the exception was raised, and
a recursion_critical flag, which indicates that recursion
absolutely must be allowed, i.e. that a certain call
must not cause a stack overflow exception.

There are still some places where both str and str8 are
accepted as identifiers; these should eventually be
removed.

--

___
Python tracker 

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



[issue10485] http.server fails when query string contains addition '?' characters

2015-10-01 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> CGIRequestHandler behave incorrectly with query component 
consisting mutliple ?

___
Python tracker 

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



[issue25125] "Edit with IDLE" does not work for shortcuts

2015-10-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In #23546, I requested a separate 'Edit with IDLE x.y' (I mis-said 'Open') on 
the context menu for each installed version.  I said I would be OK with one 
'Edit with IDLE' entry and a submenu, as proposed by someone else.  I agree 
that this will be better in the long run.  In the meanwhile, I have 'Edit with 
IDLE' which happens to be connected to 3.4 and 'Edit with IDLE >' with a 
submenu with 3.5, and no option to edit with 2.7.

Thijs: The editor is basically the same in the most recent 2.7, 3.4, and 3.5 
versions. So it does not matter much which Python version is used to *edit*.  
But it does matter which Python version is used to *run* the file with F5. And 
there are bug fixes in the next 3.4 version that will make editing easier for 
some people.  And there will be even more changes coming in future 2.7 and 3.5 
releases.

Perhaps the submenu should give the full x.y.z release number, as Idle can have 
new or changed features in micro releases.

--

___
Python tracker 

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



[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my optimization.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue23546] Windows, 'Edit with IDLE', and multiple installed versions

2015-10-01 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower
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



[issue14576] IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows

2015-10-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

John, thank you for the additional information.  2 copies of .idlerc is 
definitely bad.

--
versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue25125] "Edit with IDLE" does not work for shortcuts

2015-10-01 Thread Steve Dower

Steve Dower added the comment:

Terry (nosied) made the request for the context menu in issue 23546, so if you 
want it removed you'll need to convince him.

Personally I prefer the context menu, but I typically replace the default file 
association with one that's better for me anyway so I'm not really bothered 
either way.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-01 Thread Antony Lee

New submission from Antony Lee:

http://bugs.python.org/issue21423 and http://bugs.python.org/issue24980 suggest 
adding an initializer/on_new_thread argument to {Thread,Process}PoolExecutor.  
I would like to suggest a more unified API, that would allow not only handling 
initialization, but also finalization, by adding a {thread,process}_class 
attribute / constructor argument to {Thread,Process}PoolExecutor, so that one 
could do:

class MyThread(Thread):
def run(self):
initialize()
try: super().run()
finally: finalize()

with ThreadPoolExecutor(thread_class=MyThread): ...

Thoughts?

--
components: Library (Lib)
messages: 252067
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Hooking Thread/Process instantiation in concurrent.futures.
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



[issue25165] Windows uninstallation should not remove launcher if other versions remain

2015-10-01 Thread Steve Dower

Changes by Steve Dower :


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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

sys_setrecursionlimit-4.patch:

- enhance documentation and comments
- combined with end_rec_check.patch: make the lower-water mark monotonic
- add _Py_RecursionLimitLowerWaterMark() macro used by _Py_MakeEndRecCheck() 
and sys.setrecursionlimit()

--
Added file: http://bugs.python.org/file40653/sys_setrecursionlimit-4.patch

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

> _Py_MakeEndRecCheck() was changed in issue5392 (noised Antoine as a 
> committer).

Oh, I didn't know this issue. If I am right, it's a duplicate of this issue, 
even if it was a little bit different because the lower-water mark was computed 
differently.

> There are many ways to make it monotonic.

Since I don't understand well this issue, I prefer to keep the formula 
unchanged for low limit (smaller than 100, or smaller than 200 with my patch) 
to keep the 3/4 ratio.

> Since the formula is so complex, it would be worth to extract common part 
> from _Py_MakeEndRecCheck() and sys_setrecursionlimit(). Otherwise the code 
> can become desynchronized.

Right, it's now done in my new patch.

> The error message still looks confusing to me. May be short it to "limit is 
> too low"? Noised David as grammar expert.

I prefer to really explain the fact that the RecursionError is raised depending 
on the current recursion depth. Otherwise, I'm quite sure that someone will 
complain that "too low" have different values on the same PC but on two 
different applications.

> Why not have an hardcoded minimum limit? Current recursion depth and 
> therefore minimal recursion limit are implementation defined and can depend 
> on a way how the module is executed (run a script, import a module, run with 
> runpy or IDLE, etc).

I'm not sure that you understood correctly the issue. The root cause is that 
you cannot call sys.setrecursionlimit(X) at recursion depth Y. There is no 
constant "minimum limit": it depends on the recusion depth because of how 
Python handles recursion error (the overflowed flag).

An alternative would be to remove completly the overflowed flag with its fatal 
error. It was introduced during large refactoring of Python, maybe the bug 
cannot occur anymore?

Again, since I don't know the whole history of how Python handles recursion 
error, I prefer the conservative approach of changing the minimum amount of 
code.

> May be interpret the limit relatively to current recursion depth?

Hum, I dislike this idea. I prefer to keep an absolute value. Otherwise, it 
would make Python more surprising.

--

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

> An alternative would be to remove completly the overflowed flag with its 
> fatal error. It was introduced during large refactoring of Python, maybe the 
> bug cannot occur anymore?

By the way, it doesn't exist in Python 2 at all. Try attached 
double_recursion_error.py program.


$ python2 double_recursion_error.py 
first recursion error
second recursion error


$ python3 double_recursion_error.py 
first recursion error
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x7f80a6985700 (most recent call first):
  File "double_recursion_error.py", line 5 in f
  File "double_recursion_error.py", line 5 in f
  File "double_recursion_error.py", line 5 in f
  File "double_recursion_error.py", line 5 in f
  ...
Abandon (core dumped)

--

___
Python tracker 

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



[issue10487] http.server doesn't process Status header from CGI scripts

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

Issue 13893 was closed as a duplicate of this issue. There are patches and 
modified code there that may be worth looking at though.

--
nosy: +martin.panter
superseder: Make CGIHTTPServer capable of redirects (and status other than 200) 
-> 

___
Python tracker 

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



[issue25165] Windows uninstallation should not remove launcher if other versions remain

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2d30dfa46a7 by Steve Dower in branch '3.5':
Issue #25165: Windows uninstallation should not remove launcher if other 
versions remain
https://hg.python.org/cpython/rev/a2d30dfa46a7

--
nosy: +python-dev

___
Python tracker 

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



[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

FYI the sys module has 5 more symbols when CPython is compiled in debug mode:

* getobjects()
* gettotalrefcount()
* last_traceback, last_type, last_value

--

___
Python tracker 

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



[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

>> You also can check ``'d' in sys.abiflags`` if it looks cleaner to you.

> For me, it doesn't look correct to have various ways to check if python was 
> compiled in debug mode. It doesn't look portable neither. (...)

Oops, I didn't notice that sys.abiflags is not available on Windows!

It's the same issue with 2 solutions to this question:

http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter

* Checking for '_d.pyd' in imp.get_suffixes() => specific to Windows
* sys.executable.endswith("_d.exe") => again, specific to Windows :-(

That's part of my rationale in my first message, we need a portable and 
reliable flag to check if Python was compiled in debug mode.

By the way, the StackOverflow question comes from an user who is probably not 
writing a test, but an application. It means that the flag is also helpful to 
final users.

--

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2015-10-01 Thread Eric Snow

Changes 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



[issue25272] asyncio tests are getting noisy

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

> Executing  coro= /media/disk/home/proj/python/cpython/Lib/test/test_asyncio/test_pep492.py:146>
>  result=None created at 
> /media/disk/home/proj/python/cpython/Lib/asyncio/base_events.py:323> took 
> 0.177 seconds

This one is trivial to fix: set loop.slow_callback_duration to 1.0
(second) or more in TestCase.set_event_loop() of asyncio.test_utils.

--

___
Python tracker 

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



[issue25171] does not build on OpenBSD with no value defined for PY_GETENTROPY

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Remi for your fix, the compilation succeeded on the buildbot. Sorry for 
the regression.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25286] views are not sequences

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

If changing the glossary heading, make sure it is kept in alphabetical order 
and incoming links still work (e.g. look for `view` and ). And maybe 
“dictionary view” (full spelling, and singular) would be a more accurate 
heading.

The text changes look good however.

--
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue25287] test_crypt fails on OpenBSD

2015-10-01 Thread STINNER Victor

New submission from STINNER Victor:

It looks like crypt.crypt('', crypt.METHOD_CRYPT) returns None. This method 
must be excluded from crypt.methods. Attached patch should fix the issue, but I 
didn't try it on OpenBSD.

Python 3.4-3.6 is affect, Python 2.7 is not affect (crypt.methods was 
introduced in Python 3).

http://buildbot.python.org/all/builders/x86%20OpenBSD%203.5/builds/186/steps/test/logs/stdio

test_saltedcrypt (test.test_crypt.CryptTestCase) ... ERROR

==
ERROR: test_saltedcrypt (test.test_crypt.CryptTestCase)
--
Traceback (most recent call last):
  File 
"/home/python-builds/3.5.borja-openbsd-x86/build/Lib/test/test_crypt.py", line 
23, in test_saltedcrypt
self.assertEqual(len(pw), method.total_size)
TypeError: object of type 'NoneType' has no len()

--

--
files: crypt_openbsd.patch
keywords: patch
messages: 251998
nosy: haypo
priority: normal
severity: normal
status: open
title: test_crypt fails on OpenBSD
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40639/crypt_openbsd.patch

___
Python tracker 

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



[issue25284] Spec for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation

2015-10-01 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed in 9a10055e12fa d7d18ef3e05c 1465b18ef4fc

--
nosy: +asvetlov
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.4, Python 3.6

___
Python tracker 

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



[issue25287] test_crypt fails on OpenBSD

2015-10-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +rpointel

___
Python tracker 

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



[issue25274] "./python -m test test_sys": Fatal Python error: Cannot recover from stack overflow

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 60c4fd84ef92 by Victor Stinner in branch '3.4':
Issue #25274: test_recursionlimit_recovery() of test_sys now checks
https://hg.python.org/cpython/rev/60c4fd84ef92

New changeset 898a9a959927 by Victor Stinner in branch '3.5':
(Merge 3.4) Issue #25274: test_recursionlimit_recovery() of test_sys now checks
https://hg.python.org/cpython/rev/898a9a959927

New changeset bae0912dd160 by Victor Stinner in branch 'default':
(Merge 3.5) Issue #25274: test_recursionlimit_recovery() of test_sys now checks
https://hg.python.org/cpython/rev/bae0912dd160

--

___
Python tracker 

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



[issue25286] views are not sequences

2015-10-01 Thread Akira Li

Akira Li added the comment:

Thank you for `view`,  hint. I did look for :term:`view` that was
obviously not enough.

The new patch contains the renamed entry in the correct place. All `view`, 
`
occurrences dictionary view are updated now.

--
Added file: http://bugs.python.org/file40654/dict-views-glossary-2.patch

___
Python tracker 

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



[issue14566] run_cgi reverts to using unnormalized path

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

This was also reported in Issue 19435. The combination changes for Issue 19435 
+ Issue 21323 looks essentially like the proposed change here.

Issue 14567 remains about the double processing of paths.

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Directory traversal attack for CGIHTTPRequestHandler

___
Python tracker 

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



[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Hiroki Kiyohara

Hiroki Kiyohara added the comment:

I see. Thank you very much, guys.

--

___
Python tracker 

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



[issue25276] test_decimal sometimes crash on PPC64 AIX 3.x

2015-10-01 Thread David Edelsohn

David Edelsohn added the comment:

The system has 128GB of memory.  The process limits are set to unlimited for 
data.  AIX defaults to 32 bit, although all processors are 64 bit, so the 
buildbot runs as 32 bit.  What does low free memory in the buildbot mean?

I'm surprised that Python requires a huge amount of memory for the tests.  It's 
possible that Python needs to be built with special options to allow additional 
malloc space (-bmaxdata:0xN000).

--

___
Python tracker 

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



[issue14565] Allow multilevel subdirectories in cgi_directories

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

This smells like a new feature to me, because it is clearly not supported by 
the existing code. If you wanted to fix the existing released versions of 
Python, I think it would be better to clarify the documentation.

--
nosy: +martin.panter
title: is_cgi doesn't function as documented for cgi_directories -> Allow 
multilevel subdirectories in cgi_directories
type: behavior -> enhancement
versions: +Python 3.6 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor

STINNER Victor added the comment:

sys_setrecursionlimit-2.patch: fix error message, exchange the last 2 
PyErr_Format() parameters.

--
Added file: http://bugs.python.org/file40642/sys_setrecursionlimit-2.patch

___
Python tracker 

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



[issue14567] http.server query string handling is incorrect and inefficient

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

I think the decision on how to parse the “path” attribute has to be left up to 
each request handler implementation, rather than being done blindly in 
BaseHTTPRequestHandler.parse_request(). The reason is there are various forms 
of HTTP request target that don’t actually have a path:

OPTIONS *  # Asterisk form
OPTIONS http://example.net  # Absolute form with no path nor query
CONNECT example.net:443  # Authority form

I agree that the current situation is far from ideal, and a function or method 
to parse a URL path should be very useful. Functions urlparse() and urlsplit() 
can already help with splitting off the query.

Currently there is double percent-decoding going on in the CGI server. “GET 
/cgi-bin/%2574est.py” decodes to “test.py”, when it should only decode as 
“%74est.py”. This is probably a side-effect of fixing Issue 14566 and related 
bugs.

Also, see Issue 5714 about making this function a public API.

--
nosy: +martin.panter
stage:  -> needs patch
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-10-01 Thread Martin Panter

Martin Panter added the comment:

The patch looks like it will fix this particular bug without much negative 
impact. However there are plenty of other problems with this module’s URL 
handling, see Issue 14567. I think the translate_path(), _url_collapse_path(), 
is_cgi(), run_cgi(), etc functions all need a good rewrite.

Anyway it might be worth going ahead and committing this straight away, whether 
or not anyone is motivated to fix the wider issue later on.

--

___
Python tracker 

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



[issue25280] Message can be formatted twice in importlib

2015-10-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Brett for your review.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25280] Message can be formatted twice in importlib

2015-10-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset da42b38f7470 by Serhiy Storchaka in branch '3.4':
Issue #25280: Import trace messages emitted in verbose (-v) mode are no
https://hg.python.org/cpython/rev/da42b38f7470

New changeset 10c13441bf8d by Serhiy Storchaka in branch '3.5':
Issue #25280: Import trace messages emitted in verbose (-v) mode are no
https://hg.python.org/cpython/rev/10c13441bf8d

New changeset e377d568928b by Serhiy Storchaka in branch 'default':
Issue #25280: Import trace messages emitted in verbose (-v) mode are no
https://hg.python.org/cpython/rev/e377d568928b

--
nosy: +python-dev

___
Python tracker 

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



[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> ValueError: cannot set recursion limit to 2: the minimum recursion limit is 1 
> at the recursion depth 1

This message looks confusing to me. 2 > 1, isn't?

The dependency of min_limit from new_limit is not monotonic:

new_limit = 99 => min_limit = 74
new_limit = 100 => min_limit = 75
new_limit = 101 => min_limit = 51

--

___
Python tracker 

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



[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Hiroki Kiyohara

New submission from Hiroki Kiyohara:

Running `python` interpreter will import `readline.py` file in current 
directory.
It causes unexpected code execution.

This problem is reported by 'Japan Vulnerability Notes' as a bug on
Windows version Python http://jvn.jp/jp/JVN49503705/

It says that when we run Windows version python will import `readline.pyd` file 
in current directory. And it may run unexpected codes with permission assigned 
to python.exe.

The line causing this problem may be...
https://github.com/python/cpython/blob/2.7/Lib/code.py#L303


Should it be considered as vulnerability of python (or Windows version python)?

--
messages: 252012
nosy: Hiroki Kiyohara
priority: normal
severity: normal
status: open
title: readline.py file in current directory caused unexpected code execution.
type: security
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue21995] Idle: pseudofiles have no buffer attribute.

2015-10-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yet one example of test stream that has no buffer - stdprinter used as 
sys.stderr on early stage of Python startup.

--

___
Python tracker 

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