[issue26405] tkinter askopenfilename doubleclick issue on windows

2016-02-23 Thread rapolas

rapolas added the comment:

Just tried this on Python 2.7.11 and the issue is not present.

--

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +skrah

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm not sure what "inconsistent" means. If the results are unstable between 
runs, it may mean the operations being measured themselves are unstable (for 
example because of hashing differences or cache aliasing effects from run to 
run).

I'd rather like benchmarks to be judged on their usefulness:
- spectral_norm really looks pointless as nobody would write scientific code in 
Python like that
- telco, AFAIU, is a widely-used benchmark for decimals (but perhaps Stefan can 
shed some light)
- regex_v8 claims to be drawn from real-world use of regular expressions by 
popular Web pages, so it sounds useful as well

(note that telco apparently loads a file in the main loop, perhaps that can be 
pulled out of the loop and into the init phase)

--
nosy: +haypo, yselivanov

___
Python tracker 

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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-23 Thread Ilja Everilä

Ilja Everilä added the comment:

After doing some reading on https://docs.python.org/dev/c-api/exceptions.html 
it seems that this is possibly "as designed" or such, since csv_writerows 
explicitly calls PyErr_SetString on receiving NULL from PyObject_GetIter.

Still, it feels like this could either let the original exception fall through 
(since it has nothing in the way of handling it) or form the chain in PY3 for 
easier debugging of the real cause.

To give this thing some context we ran in to this while passing SQLAlchemy 
Query objects to csv_writerows. The Query object is compiled during call to 
__iter__ and the current behaviour masks possible SQL errors etc.

--

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Stefan Krah

Stefan Krah added the comment:

Telco is a real world workload devised by Mike Cowlishaw. Some fixes
need to me made for the version in the benchmark suite; in particular,
the amount of input seems insufficient for _decimal (#26284).

I'm not a fan of weeding out real world benchmarks until our test suite
looks stable -- does Intel for example apply the techniques described
by Victor in another issue?

--

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread STINNER Victor

STINNER Victor added the comment:

I opened the issue #26275 to try to make benchmarks more reliable.

My notes to tune the Linux kernel to reduce the "noise" from the operating 
system:
http://haypo-notes.readthedocs.org/microbenchmark.html#reliable-micro-benchmarks

On the speed mailing list, it was also suggested to use the geometric mean 
rather than the minimum or the average.

--

___
Python tracker 

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



[issue26417] Default IDLE 2.7.11 configuration files are out-of-sync on OS X framework installs

2016-02-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13826ff147e4 by Ned Deily in branch '2.7':
Issue #26417: Prevent spurious errors and incorrect defaults when
https://hg.python.org/cpython/rev/13826ff147e4

--
nosy: +python-dev

___
Python tracker 

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



[issue26418] multiprocessing.pool.ThreadPool eats up memories

2016-02-23 Thread renlifeng

New submission from renlifeng:

If func creates lots objects and appends them to a list, and runs over and 
over, pool.map(func...) will eventually eat up all memories. Cleaning the list 
at the end of func does not help.

One can reproduce by running the attached file.

By contrast, after replacing ThreadPool with the theading module (see the 
commented out lines), memory usage will not grow continuously.

By the way, I used what's in Debian stretch, i.e. python 2.7.11 and 3.5.1.

--
components: Library (Lib)
files: cvtest5.py
messages: 260716
nosy: renlifeng
priority: normal
severity: normal
status: open
title: multiprocessing.pool.ThreadPool eats up memories
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file42012/cvtest5.py

___
Python tracker 

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



[issue26414] os.defpath too permissive

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Digging through the history, it has been this way since at least revision 
d5b67d2ec7ee (1994).

Removing the colon is definitely a good idea. Maybe this might be a more proper 
way to get the default PATH:

>>> os.confstr("CS_PATH")
'/bin:/usr/bin'

--
nosy: +martin.panter

___
Python tracker 

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



[issue26417] Default IDLE 2.7.11 configuration files are out-of-sync on OS X framework installs

2016-02-23 Thread Ned Deily

Ned Deily added the comment:

For 2.7.12 I've committed changes to the Mac/IDLE Makefile so that it now edits 
the defaults files in place on install just like the 3.x Makefiles do.  
Framework installs of IDLE 2.7 on OS X no longer output startup warnings and, 
since the defaults are now in sync, also now properly use the newer default 
font.  The whole approach is less than ideal since the OS X tailoring is still 
hidden away in the Mac Makefiles rather than in idlelib code.  Issue20580 
addresses the broader issue of platform-specific configuration files for IDLE.

--
nosy: +terry.reedy -ronaldoussoren
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



[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-23 Thread Stefan Krah

Changes by Stefan Krah :


--
dependencies: +Fix telco benchmark

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> On the speed mailing list, it was also suggested to use the geometric mean 
> rather than the minimum or the average.

This should be considered a bit more carefully.

First, geometric mean is only useful when you are agregating heterogenous 
numbers. Here, we are agregating homogenous numbers (results from a single 
benchmark), so the arithmetic mean should be preferred.

Second, there still is the issue of weeding out outliars (due to e.g. 
background activity). So perhaps the 20% slowest runs should be discarded.

Third, to get enough precision in the arithmetic mean, the number of individual 
runs (separate process invocations, to smoothen variabilities due to cache 
aliasing etc.) should be raised to a sufficient number. See the central limit 
theorem.

--

___
Python tracker 

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



[issue20580] IDLE should support platform-specific default config defaults

2016-02-23 Thread Ned Deily

Ned Deily added the comment:

See Issue26417 for further discussion about the OS X specific tailoring of IDLE 
config files and changes to the 2.7 Makefiles to better match the 3.x Makefiles 
to reduce the risk of inadvertent platform differences.

--
versions:  -Python 3.4

___
Python tracker 

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



[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-23 Thread Michael Foord

Michael Foord added the comment:

There have been persistent calls for an "assert_called" method over the 
lifetime of mock. In the past I've rejected them because you can easily get it 
by asserting the call count is non-zero and I want to avoid the proliferation 
of a thousand assert methods. The demand is certainly consistent, so it would 
seem that people feel there is a use case.

--

___
Python tracker 

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



[issue26376] Tkinter root window won't close if packed.

2016-02-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was running from IDLE when I said no problem on Windows, so this is OSX 
specific.  Are you running same version of python  (splash message) and tcl/tk? 
 (on IDLE, Help => About IDLE).  Does Python on OSX have equivalent of 
pythonw.exe?  If you start IDLE at terminal and then run from IDLE, do you see 
and error message in the terminal?

--

___
Python tracker 

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



[issue26409] Support latest Tcl/Tk on future versions of Mac installer

2016-02-23 Thread Ned Deily

Ned Deily added the comment:

Thanks for the suggestion.  Moving the OS X installers to using Tcl/Tk 8.6 is 
the subject of Issue15663.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Investigate providing Tcl/Tk 8.6 with OS X installers

___
Python tracker 

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



[issue26375] Python 2.7.10 and 3.4.4 hang on imaplib.IMAP4_SSL()

2016-02-23 Thread Maciej Szulik

Changes by Maciej Szulik :


--
nosy: +maciej.szulik

___
Python tracker 

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



[issue26399] CSV Injection Vulnerability

2016-02-23 Thread Maciej Szulik

Maciej Szulik added the comment:

Closing in favor of http://psf.upfronthosting.co.za/roundup/meta/issue580

--
nosy: +maciej.szulik
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

About rounding: I’m not too sure what people would expect. Obviously it is much 
easier to implement truncating to zero. But it is different to many other 
rounding cases in Python; that is why I thought to make it explicit.

>>> datetime.fromtimestamp(59.999).isoformat(timespec="microseconds")
'1970-01-01T00:01:00.00'
>>> datetime.fromtimestamp(59.99).isoformat(timespec="milliseconds")
'1970-01-01T00:00:59.999'
>>> format(59.99, ".3f")
'60.000'

--

___
Python tracker 

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



[issue26406] getaddrinfo is thread-safe on NetBSD and OpenBSD

2016-02-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52a8c1965750 by Ned Deily in branch '2.7':
Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
https://hg.python.org/cpython/rev/52a8c1965750

New changeset 419d20551d26 by Ned Deily in branch '3.5':
Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
https://hg.python.org/cpython/rev/419d20551d26

New changeset 5ffebeb3e91d by Ned Deily in branch 'default':
Issue #26406: merge from 3.5
https://hg.python.org/cpython/rev/5ffebeb3e91d

--

___
Python tracker 

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



[issue26406] getaddrinfo is thread-safe on NetBSD and OpenBSD

2016-02-23 Thread Ned Deily

Ned Deily added the comment:

Thanks for the additional patch, Jesse. Since we don't have a NetBSD buildbot 
and I don't have any NetBSD or OpenBSD systems at hand to do any testing, I'll 
take your word for the version checks.  If anyone runs into any problems 
because of these changes, feel free to re-open this issue.  Pushed for release 
in 2.7.12, 3.5.2, and 3.6.0.

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



[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-23 Thread STINNER Victor

STINNER Victor added the comment:

> In the past I've rejected them because you can easily get it by asserting the 
> call count is non-zero and I want to avoid the proliferation of a thousand 
> assert methods

Yeah, I understand that.

IMHO having to check if a function was called is a common need. Mock
has already assert_not_called() for example.

I like the detection of spelling typos for methods starting with assert_ :-)

--

___
Python tracker 

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



[issue26398] cgi.escape() Can Lead To XSS and HTML Vulnerabilities

2016-02-23 Thread Dhiraj

Dhiraj added the comment:

Even the IDLE of Python is Vulnerable to CGI.ESCAPE() Please have a look on 
attachments , I hope this would be Patch Soon.

Thank You

--
nosy: +dstufft, gregory.p.smith
type:  -> security
Added file: http://bugs.python.org/file42013/Python-IDLE-CGI-Vulnerable.png

___
Python tracker 

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



[issue26406] getaddrinfo is thread-safe on NetBSD and OpenBSD

2016-02-23 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Thank you!

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-23 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Related to #26406, a fix for NetBSD and OpenBSD.

--

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2016-02-23 Thread Sergei Lebedev

Sergei Lebedev added the comment:

Is it possible to backport this patch to 2.7?

--
nosy: +superbobry

___
Python tracker 

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



[issue26039] More flexibility in zipfile interface

2016-02-23 Thread Thomas Kluyver

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



[issue26039] More flexibility in zipfile interface

2016-02-23 Thread Dhiraj

Dhiraj added the comment:

Please ha Look on issue 11980

http://bugs.python.org/issue11980
Already have been Patched

--
nosy: +DhirajMishra

___
Python tracker 

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



[issue26420] IDEL for Python 3.5.1 for x64 Windows exits when pasted a string with non-BMP characters

2016-02-23 Thread Tatsunori Uchino

New submission from Tatsunori Uchino:

On Windows Server 2012 R2 with Update(which is compatible with Windows 8.1 
Update 1), I copied a character U+20BB7 and pasted it on IDLE.  After that, 
IDLE suddenly exited with no messages, notices, or errors.

  Then, I tried to input some non-BMP charactors by the Google Japanese IME 
other than 𠮷 such as U+1F444, U+1F468 and found that the IDLE exited as the 
same way.

  I suppose that these phenomena could be due to a failure when treating 
surrogate pairs in input or pasted strings.

--
components: IDLE
messages: 260736
nosy: Tats.U.
priority: normal
severity: normal
status: open
title: IDEL for Python 3.5.1 for x64 Windows exits when pasted a string with 
non-BMP characters
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue26420] IDEL for Python 3.5.1 for x64 Windows exits when pasted a string with non-BMP characters

2016-02-23 Thread Tatsunori Uchino

Tatsunori Uchino added the comment:

P.S.
  𠮷 is explained as U+20BB7 in UCS-4.  And the characters that is explaind as 
U+1F444(👄) and U+1F468(👨) are both what are said emojis(explains the mouth and 
man)

--

___
Python tracker 

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



[issue26421] string_richcompare invalid check Py_NotImplemented

2016-02-23 Thread yuriy_levchenko

New submission from yuriy_levchenko:

i have object with flag Py_TPFLAGS_STRING_SUBCLASS

stringobject.c (line 1192) in function string_richcompare

we have check string PyString_Check

but,

#define PyString_Check(op) \
 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_STRING_SUBCLASS)

i successful check this. But my type is not PyStringObject

Maybe need replace this check on PyString_CheckExact?

--
messages: 260738
nosy: yuriy_levchenko
priority: normal
severity: normal
status: open
title: string_richcompare invalid check Py_NotImplemented
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Yury Selivanov

Yury Selivanov added the comment:

We now have speed.python.org up, so I'd keep spectral_norm to make sure we 
don't accidentally harm the performance of int/floats operations.  It also 
helped me to discover that PyLong_AsDouble was unnecessary slow, etc.

--

___
Python tracker 

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



[issue26398] cgi.escape() Can Lead To XSS and HTML Vulnerabilities

2016-02-23 Thread Gregory P. Smith

Gregory P. Smith added the comment:

As pointed out, this is working as intended and is documented as such.  That it 
isn't what you want is why Python 3 has html.escape() instead.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> cgi.escape Can Lead To XSS Vulnerabilities
versions: +Python 2.7, 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



[issue26398] cgi.escape() Can Lead To XSS and HTML Vulnerabilities

2016-02-23 Thread Dhiraj

Changes by Dhiraj :


--
resolution: duplicate -> fixed

___
Python tracker 

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



[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-23 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I understand the problem and why this patch should be rejected.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue25136] Python doesn't find Xcode 7 stub libraries

2016-02-23 Thread Anthony Foglia

Changes by Anthony Foglia :


--
nosy: +afoglia

___
Python tracker 

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



[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9

2016-02-23 Thread Mark Dickinson

Mark Dickinson added the comment:

I've found OS X 10.10 and OS X 10.11 machines to test on. I'm able to reproduce 
on 10.10, but not on 10.11. This adds to the plausibility of the "Apple bug" 
explanation.

--

___
Python tracker 

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



[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9, 10.10

2016-02-23 Thread Mark Dickinson

Changes by Mark Dickinson :


--
title: Deadlock in thread.join on Python 2.7/Mac OS X 10.9 -> Deadlock in 
thread.join on Python 2.7/Mac OS X 10.9, 10.10

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-02-23 Thread Brett Cannon

Brett Cannon added the comment:

If you think the string conversion should go back in, Stefan, feel free to put 
it back (unless Victor wants to say why he took it out).

--
assignee:  -> skrah

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Brett Cannon

Brett Cannon added the comment:

OK, so everyone says to keep what we have.

--
resolution:  -> postponed
status: open -> closed

___
Python tracker 

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



[issue26422] printing 1e23 and up is incorrect

2016-02-23 Thread John Taylor

New submission from John Taylor:

The print statement does not display accurate results.

code:
print("%35d" % (1e21))
print("%35d" % (1e22))
print("%35d" % (1e23))
print("%35d" % (1e24))
print("%35d" % (1e25))
print("%35d" % (1e26))
print("%35d" % (1e27))
print("%35d" % (1e28))
print("%35d" % (1e29))
print("%35d" % (1e30))
print("%35d" % (1e31))

result:
 10
100
1611392
   83222784
 1905969664
14764729344
   113287555072
   583119736832
  1433150857216
119884624838656
635896294965248

Platforms:
Windows 10 x64, Python 3.5.1
Debian 8 (jessie), Python 3.5.1

--
messages: 260745
nosy: jftuga
priority: normal
severity: normal
status: open
title: printing 1e23 and up is incorrect
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution: postponed -> rejected

___
Python tracker 

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



[issue26039] More flexibility in zipfile interface

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Thanks for the pointer Dhiraj. I prefer the open(mode="w") version proposed 
here, as being more flexible. This way you could wrap the writer object in e.g. 
TextIOWrapper. The other patch requires passing in a file reader object.

Having another look at zipfile-open-w4.patch, I have some thoughts about 
locking and the writing-while-reading restriction:

The lock seems to be designed to serialize reads and writes (which operate on 
the common underlying file object). See revision 4973ccd46e32, and 
, although it would be good to 
document this, or at the minimum add a comment explaining the purpose and scope 
of the lock.

Currently, it appears that write() and writestr() acquire the lock, so I 
presume it is intended that these methods can be called multiple times 
concurrently, and also while the zip file is being read. With the patch, 
writestr() still preserves the lock usage, but write() does not because it is 
now implemented in terms of the new open(mode="w") method.

I think it would be good to clarify that the lock does _not_ protect concurrent 
writes via open(mode="w").

--

___
Python tracker 

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



[issue26422] printing 1e23 and up is incorrect

2016-02-23 Thread Eric V. Smith

Eric V. Smith added the comment:

Please see https://docs.python.org/3.5/tutorial/floatingpoint.html for a 
discussion of why this is not a bug.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-02-23 Thread STINNER Victor

STINNER Victor added the comment:

> Unfortunately, replacing io.BytesIO(data) with indexing does not make the 
> benchmark faster or more stable on my machine.

Ah, I didn't check. I expected BytesIO.read() to be slower than bytes string 
slicing.

--

___
Python tracker 

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



[issue26423] __len__() returns 32 bit int on windows leading to overflows

2016-02-23 Thread Dave Hibbitts

New submission from Dave Hibbitts:

__len__() always returns an int which on windows machines is tied to the size 
of a c long and is always 32 bits even if it's compiled for 64 bit. len() 
however returns an int for values less than sys.maxint and a long above that. 

Returning an int in __len__() causes it to return negative lengths for objects 
of size greater than sys.maxint, below you can see a quick test on how to 
reproduce it.

And here's an explanation from \u\Rhomboid on Reddit of why we believe the 
issue happens.

"You'll only see that on Windows. The issue is that, confusingly, the range of 
the Python int type is tied to the range of the C long type. On Windows long is 
always 32 bits even on x64 systems, whereas on Unix systems it's the native 
machine word size. You can confirm this by checking sys.maxint, which will be 
2**31 - 1 even with a 64 bit interpreter on Windows.

The difference in behavior of foo.__len__ vs len(foo) is that the former goes 
through an attribute lookup which goes through the slot lookup stuff, finally 
ending in Python/typeobject.c:wrap_lenfunc(). The error is casting Py_ssize_t 
to long, which truncates on Windows x64 as Py_ssize_t is a proper signed 64 bit 
integer. And then it compounds the injury by creating a Python int object with 
PyInt_FromLong(), so this is hopelessly broken. In the case of len(foo), you 
end up in Python/bltinmodule.c:builtin_len() which skips all the attribute 
lookup stuff and uses the object protocol directly, calling PyObject_Size() and 
creating a Python object of the correct type via PyInt_FromSsize_t() which 
figures out whether a Python int or long is necessary.

This is definitely a bug that should be reported. In 3.x the int/long 
distinction is gone and all integers are Python longs, but the bogus cast to a 
C long still exists in wrap_lenfunc():

return PyLong_FromLong((long)res);

That means the bug still exists even though the reason for its existence is 
gone! Oops. That needs to be updated to get rid of the cast and call 
PyLong_FromSsize_t()."

Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Jul  2 2014, 15:12:11) [MSC 
v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> a = 'a'*25
>>> a.__len__()
-1794967296
>>> len(a)
25L
>>> a = [1]*25
>>> len(a)
25L
>>> a.__len__()
-1794967296

--
components: Windows
messages: 260749
nosy: Dave Hibbitts, georg.brandl, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: __len__() returns 32 bit int on windows leading to overflows
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-23 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Oops, sorry for the silliness in the C code, thanks for reviewing. I modified 
as suggested, please find the new patch attached.

--
Added file: http://bugs.python.org/file42014/mmap_write_return_count2.patch

___
Python tracker 

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



[issue26376] Tkinter root window won't close if packed.

2016-02-23 Thread Sam Yeager

Sam Yeager added the comment:

It's almost certainly only found on OSX. I'm currently taking a Python class of 
approximately 150 students, and at least two of us independently found this 
issue on our respective Macs.

IDLE and Python are the same version (v3.4.4). The info window lists Tk as 
version 8.5.18, which matches the version ActiveTcl.

I'm not familiar with pythonw.exe as I've been using Mac.

Entering "idle 3.4" at Terminal opens IDLE as a separate app and Terminal waits 
until the app is closed. While running the script in the app, the issue 
persists.

--

___
Python tracker 

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



[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-23 Thread Eric Snow

Eric Snow added the comment:

(Note that PathFinder.invalidate_caches() loops over sys.path_importer_cache 
and invalidates the cache of each path entry finder therein.  What you're 
suggesting is clearing sys.path_importer_cache after the loop finishes.)

Hmm.  The distinction is between clearing the cache of each finder and clearing 
the caches in the import machinery, sort of.  sys.path_importer_cache 
effectively belongs to PathFinder, just like sys.path_hooks.  I expect they are 
part of sys only as a historical artifact (i.e. pre-importlib).  So I'd say 
there isn't any conceptual problem in that regard.

The point of importlib.invalidate_caches() is to allow finders to pick up 
out-of-band events.  In the case of sys.path_importer_cache, it would allow new 
entries in sys.path_hooks to have a shot and old entries to have another 
chance.  That seems reasonable.

The only caveat I see is that sys.path_importer_cache is not an "internal" 
cache (as the importlib.invalidate_caches() docs refer to them).  Furthermore, 
it has some established semantics attached:

  * a path hook will only be called once for a path entry (entries in the cache 
are fixed in place once added)
  * None is a sentinel for not-found

Consequently,someone may inject None into the cache to prevent finding a 
spec/loader. With this chance, calls to importlib.invalidate_caches() could 
cause them problems.  In this regard there may be a backward-compatibility 
issue.

Other than that, I consider clearing sys.path_importer_cache in 
PathFinder.invalidate_caches() to be a reasonable change.

--

___
Python tracker 

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



[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-23 Thread Brett Cannon

Brett Cannon added the comment:

Damn, good point about the backwards-compatibility issue. Then I think a doc 
note for importlib.invalidate_caches() saying that there is also 
sys.path_importer_cache would be good enough.

--
assignee:  -> brett.cannon
components: +Documentation -Library (Lib)
versions: +Python 3.5

___
Python tracker 

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



[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-23 Thread Brett Cannon

Brett Cannon added the comment:

Or another option is to add a keyword-only argument to 
importlib.invalidate_caches() to also clear the the cache of importers itself 
on top of the caches of the importers themselves.

--

___
Python tracker 

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



[issue22088] base64 module still ignores non-alphabet characters

2016-02-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c62526580ff0 by Martin Panter in branch '2.7':
Issue #22088: Clarify base-64 alphabets and which characters are discarded
https://hg.python.org/cpython/rev/c62526580ff0

New changeset c8933fbc9171 by Martin Panter in branch '3.5':
Issue #22088: Clarify base-64 alphabets and which characters are discarded
https://hg.python.org/cpython/rev/c8933fbc9171

New changeset 5ad27dcd5a97 by Martin Panter in branch 'default':
Issue #22088: Merge base64 docs from 3.5
https://hg.python.org/cpython/rev/5ad27dcd5a97

--

___
Python tracker 

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



[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-23 Thread Eric Snow

Eric Snow added the comment:

Re: the kw-only arg, it seems weird to accommodate the implementation of one 
meta-path finder in the signature of importlib.invalidate_caches().

Here's an alternative:

Use a different sys.path_importer_cache sentinel internally (in PathFinder) and 
never clear None when clearing the cache.

Here's another alternative:

Deprecate sys.path_importer_cache and move/alias it to an internal cache of 
PathFinder. *  Then add methods to PathFinder to cover the use cases that folks 
have for interacting with sys.path_importer_cache directly.  In this case it 
may also make sense to expose the active PathFinder instance as an importlib 
attribute, for easier access to this key finder.  Doing the same on ImportState 
will be part of my (eventual) proposal. :)

Of course, neither of those alternatives addresses the case where someone 
expects sys.path_importer_cache entries to remain fixed once in place.  
However, that's a tenuous implicit guarantee already. :)


* The same could be done with sys.path_hooks...

--

___
Python tracker 

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



[issue26423] __len__() returns 32 bit int on windows leading to overflows

2016-02-23 Thread Frazer McLean

Changes by Frazer McLean :


--
nosy: +RazerM

___
Python tracker 

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



[issue26404] socketserver context manager

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Thanks, the patch looks pretty good to me. I left some comments about minor 
things. Also, someone will need to write a What’s New entry.

--
stage:  -> patch review

___
Python tracker 

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



[issue22088] base64 module still ignores non-alphabet characters

2016-02-23 Thread Martin Panter

Changes by Martin Panter :


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



[issue26414] os.defpath too permissive

2016-02-23 Thread Shawn

Changes by Shawn :


--
nosy: +swalker

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Here is my proposed version for Python 2.

--
Added file: http://bugs.python.org/file42015/issue26385_4_py2.diff

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Patch looks okay to me. I guess it would be good to write a What’s New entry as 
well.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26372] Popen.communicate not ignoring BrokenPipeError

2016-02-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue25671] Fix venv activate.fish to maintain $status

2016-02-23 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +vinay.sajip
versions:  -Python 3.4

___
Python tracker 

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



[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 92ae4a305858 by Martin Panter in branch '2.7':
Issue #5824: Fix DatagramRequestHandler tests by binding the client socket
https://hg.python.org/cpython/rev/92ae4a305858

New changeset 0d9d8fdd9736 by Martin Panter in branch '3.5':
Issue #5824: Fix DatagramRequestHandler tests by binding the client socket
https://hg.python.org/cpython/rev/0d9d8fdd9736

New changeset 113e9c6fd64d by Martin Panter in branch 'default':
Issue #5824: Merge socketserver tests from 3.5
https://hg.python.org/cpython/rev/113e9c6fd64d

--
nosy: +python-dev

___
Python tracker 

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



[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-23 Thread Mike Kaplinskiy

Mike Kaplinskiy added the comment:

So how might I get this patch committed? :)

--

___
Python tracker 

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



[issue26376] Tkinter root window won't close if packed.

2016-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If the problem is that the window is too small to contain the close icon, this 
is not Python issue. May be this is Tk issue or end application issue.

--

___
Python tracker 

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



[issue26372] Popen.communicate not ignoring BrokenPipeError

2016-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is just the bug I reported in msg236951.

Text streams are buffered, thus setting bufsize=0 does not help if 
universal_newlines=True.

Added comments on Rietveld.

--
nosy: +serhiy.storchaka

___
Python tracker 

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