[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I'd take their question as an educational opportunity.

reload(this)

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



[issue19501] Buildbot testing of 3.2 broken

2013-11-04 Thread Georg Brandl

Georg Brandl added the comment:

I haven't looked at 3.2 buildbots since the last point release.

There will be only security releases in the future, still it'd be nice to be 
able to test on different bots.

Antoine, can you fix this on the buildmaster or need I apply the patch in the 
3.2 branch?

--

___
Python tracker 

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



[issue1069092] segfault on printing deeply nested structures (2.7 only)

2013-11-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is wont fix in Python 2.

--
nosy: +benjamin.peterson
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



[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, a question about "this" has come up on multiple occasions when I teach 
Python classes.

--
assignee:  -> tim.peters

___
Python tracker 

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



[issue19501] Buildbot testing of 3.2 broken

2013-11-04 Thread Zachary Ware

New submission from Zachary Ware:

After the recent commits to 3.2, I noticed that the only non-red 3.2 buildbots 
are the Windows bots; all other 3.2 bots are failing on `make touch`, which 
doesn't exist in 3.2.

The simplest fix seems to me to be to add a fake 'touch' target to the 
Makefile, but I'm not sure where that falls on the 'security fix only' policy.

How long will we continue buildbot testing of 3.2?

--
components: Build
files: make_touch-3.2.diff
keywords: buildbot, patch
messages: 202194
nosy: georg.brandl, pitrou, zach.ware
priority: normal
severity: normal
status: open
title: Buildbot testing of 3.2 broken
versions: Python 3.2
Added file: http://bugs.python.org/file32506/make_touch-3.2.diff

___
Python tracker 

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



[issue19500] Error when connecting to FTPS servers not supporting SSL session resuming

2013-11-04 Thread Ye Wang

New submission from Ye Wang:

According to RFC4217 (Securing FTP with TLS, aka the FTPS spec), 

http://tools.ietf.org/html/rfc4217.html#section-10.2

"  It is reasonable for the server to insist that the data connection
   uses a TLS cached session.  This might be a cache of a previous data
   connection or of a cleared control connection.  If this is the reason
   for the refusal to allow the data transfer, then the '522' reply
   should indicate this.

   Note: This has an important impact on client design, but allows
   servers to minimize the cycles used during TLS negotiation by
   refusing to perform a full negotiation with a previously
   authenticated client."

It appears that vsftpd server implemented exactly that by enforcing the "SSL 
session reuse between the control and data connection".

http://scarybeastsecurity.blogspot.com/2009/02/vsftpd-210-released.html

Looking at the source of Python core library ftplib.py, there isn't any regard 
to the idea of SSL session reuse between data connection vs. control connection 
(correct me if I am wrong here. I've tried FTP_TLS.transfercmd(cmd[, rest])¶, 
didn't work). 

This issue is well documented on other FTP clients that supports FTPS, I.E. 
WinSCP: http://winscp.net/tracker/show_bug.cgi?id=668

See test log file attached. A vsftpd server with "require_ssl_reuse" set to 
true in vsftpd.conf would do the trick and can be reproduced.

--
components: Library (Lib)
files: ftplib-FTPS-bug.txt
messages: 202193
nosy: Ye.Wang
priority: normal
severity: normal
status: open
title: Error when connecting to FTPS servers not supporting SSL session resuming
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file32505/ftplib-FTPS-bug.txt

___
Python tracker 

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



[issue11096] Multiple turtle tracers

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> out of date
stage:  -> committed/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



[issue1069092] segfault on printing deeply nested structures (2.7 only)

2013-11-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Verified with fresh 2.7.6 build

--
title: segfault on printing nested sequences of None/Ellipsis -> segfault on 
printing deeply nested structures (2.7 only)

___
Python tracker 

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



[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Eric Snow

Eric Snow added the comment:

You could add the following to the bottom of this.py:

import sys
del sys.modules['this']

--
nosy: +eric.snow

___
Python tracker 

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



[issue10685] trace does not ignore --ignore-module

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +belopolsky

___
Python tracker 

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



[issue10375] 2to3 print(single argument)

2013-11-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I'll close this then, as it will never happen.

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



[issue10544] yield expression inside generator expression does nothing

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy:  -terry.reedy
versions:  -Python 3.2

___
Python tracker 

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



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

2013-11-04 Thread Neil Hooey

Neil Hooey added the comment:

Can someone review the patch and consider its inclusion?

--
nosy: +nhooey

___
Python tracker 

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



[issue10375] 2to3 print(single argument)

2013-11-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Probably, but I'm not going to do it.

2013/11/4 Terry J. Reedy :
>
> Terry J. Reedy added the comment:
>
> Benjamin, is the idea even feasible, or should this be closed?
>
> --
> versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue10375] 2to3 print(single argument)

2013-11-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Benjamin, is the idea even feasible, or should this be closed?

--
versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue19154] AttributeError: 'NoneType' in http/client.py when using select when file descriptor is closed.

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 2.7, Python 3.3

___
Python tracker 

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



[issue19397] test_pydoc fails with -S

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
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



[issue19397] test_pydoc fails with -S

2013-11-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 92022b45e60b by Terry Jan Reedy in branch '2.7':
Issue #19397: test_pydoc now works with -S (help not added to builtins).
http://hg.python.org/cpython/rev/92022b45e60b

--

___
Python tracker 

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



[issue19397] test_pydoc fails with -S

2013-11-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2c191b0b5e7a by Terry Jan Reedy in branch '3.3':
Issue #19397: test_pydoc now works with -S (help not added to builtins).
http://hg.python.org/cpython/rev/2c191b0b5e7a

--
nosy: +python-dev

___
Python tracker 

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



[issue19397] test_pydoc fails with -S

2013-11-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy
nosy: +terry.reedy

___
Python tracker 

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



[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Tim Peters

Tim Peters added the comment:

"Special cases aren't special enough to break the rules." ;-)

--
nosy: +tim.peters

___
Python tracker 

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



[issue19499] "import this" is cached in sys.modules

2013-11-04 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The "this" module doesn't import functions; instead, it prints directly to 
stdout.  Accordingly, there is no reason to cache this module in sys.modules.

Ideally, a learner should be able to type "import this" more than once in  a 
Python session.

--
components: Library (Lib)
messages: 202183
nosy: rhettinger
priority: low
severity: normal
status: open
title: "import this" is cached in sys.modules
type: enhancement
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



[issue19308] Tools/gdb/libpython.py does not support GDB linked against Python 3

2013-11-04 Thread Julian Taylor

Julian Taylor added the comment:

on further investigation I seem to have screwed up patching the files. Patching 
properly they do work. Sorry for the noise.

--

___
Python tracker 

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



[issue13637] binascii.a2b_* functions could accept unicode strings

2013-11-04 Thread Martin Panter

Martin Panter added the comment:

The a2b_qp() function also documents a byte string restriction for 3.2, and now 
3.3 also seems to support ASCII-compatible text strings. Maybe the 
documentation should reflect this also?

--
nosy: +vadmium

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-04 Thread Arnaud Faure

Arnaud Faure added the comment:

patch updated

--
Added file: http://bugs.python.org/file32504/modify_data.3.patch

___
Python tracker 

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



[issue19308] Tools/gdb/libpython.py does not support GDB linked against Python 3

2013-11-04 Thread Julian Taylor

Julian Taylor added the comment:

I tested the latest patch (python27-gdb_py3.patch) with ubuntu 13.10 gdb 
compiled against python3.3, while it fixes the syntax errors it does not fix 
the functionality.
E.g. one gets this error on breakpoints:

Python Exception  There is no member named length.: 
Breakpoint 3, PyTuple_Size (op=) at ../Objects/tupleobject.c:127

and the objects are not printed in their string representation as they should 
be with the plugin.

--
nosy: +jtaylor

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I think I figured out a better way to structure this that avoids the need for 
the output flag and is more easily expanded to whitelist additional exception 
types as safe to wrap.

I'll try to come up with a new patch tonight.

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Check out my review: http://bugs.python.org/review/19497/#ps9821

--

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-04 Thread Arnaud Faure

Arnaud Faure added the comment:

Didn't thaught about that :( 
Did my way throught the developper tutorial, got the default cpython repo, did 
the modif, run patchcheck then the tests with ./python -m test -j3.
Thanks for your patience ;)

--
Added file: http://bugs.python.org/file32503/modify_data.2.patch

___
Python tracker 

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2013-11-04 Thread Zachary Ware

Zachary Ware added the comment:

An alternative that works and also removes repeated "Warning -- os.environ was 
modified by test_*" is to import FixTk at the top of test_support, allowing the 
environment to be set up and to persist throughout all of the tests.  I'm not 
sure if this is the right way to go about the problem, though.

--
Added file: http://bugs.python.org/file32502/issue10652-2.7-alternate.diff

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip

Vinay Sajip added the comment:

> But can I pass the file owner in the config dict?

You should be able to; I'll address that in the example.

--

___
Python tracker 

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2013-11-04 Thread Zachary Ware

Zachary Ware added the comment:

Having another chance to look at this one, my previous message was incorrect; 
Terry's patch does not fix the issue for an installed Python 2.7.  The only 
change it needs to work, though, is to replace 'Tkinter' with 'FixTk' in the 
import_fresh_module call.

--
components: +Tkinter
versions:  -Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32501/issue10652-2.7.diff

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-04 Thread Guido van Rossum

New submission from Guido van Rossum:

The patch doesn't actually apply, not just because the pathnames are different, 
but because the unittests in Lib/test/test_selectors.py have a different 
structure.

--

___
Python tracker 

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



[issue19085] Add tkinter basic options tests

2013-11-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fe7aaf14b129 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/fe7aaf14b129

New changeset 47d3714dcb33 by Serhiy Storchaka in branch '3.3':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/47d3714dcb33

New changeset 713cc4908a96 by Serhiy Storchaka in branch 'default':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/713cc4908a96

--

___
Python tracker 

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



[issue19498] IDLE is behaving badly in Python 2.7.6rc1

2013-11-04 Thread Ned Deily

Ned Deily added the comment:

P.S. For users comfortable with the command line, there is an procedure 
documented here for applying the fix to 2.7.6rc1 (2.7.6 final is expected 
soon):  http://bugs.python.org/issue19484#msg202062

--

___
Python tracker 

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



[issue19497] selectors and modify()

2013-11-04 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy: +gvanrossum, neologix

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

> You are clearing the thread state of the currently executing
> thread, which doesn't sound right.

Oh, I didn't realize that PyThreadState_Clear() clears also Python thread 
locals.

Here is a new patch without PyThreadState_Clear(tstate) and with two unit tests:

- ensure that Python thread locals are not destroyed before destructors are 
called
- ensure that object destructors are called before Python thread states are 
destroyed

--
Added file: http://bugs.python.org/file32500/finalize_threads-2.patch

___
Python tracker 

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



[issue19498] IDLE is behaving badly in Python 2.7.6rc1

2013-11-04 Thread Ned Deily

Ned Deily added the comment:

This is a duplicate of Issue19426.  The fix for it will be in 2.7.6 final.

--
nosy: +ned.deily
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> Opening a file in IDLE causes a crash or hang

___
Python tracker 

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



[issue19498] IDLE is behaving badly in Python 2.7.6rc1

2013-11-04 Thread Raymond Hettinger

New submission from Raymond Hettinger:

IDLE is behaving badly in Python 2.7.6rc1 with a fresh install.

The problem occurs with a sequence of creating a new window, pasting code, and 
running the code:   Cmd-N, Cmd-V, Cmd-S, F5

The visible effect in IDLE is that a new window named "idle" is created and is 
unresponsive.  Behind the scenes, the following tracebacks occur.

-

Python 2.7.6rc1 (v2.7.6rc1:4913d0e9be30+, Oct 27 2013, 20:52:11) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

--

~/tmp $ python2.7 -m idlelib.idle
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
 line 1470, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py",
 line 222, in open
flist.open(filename)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/FileList.py",
 line 36, in open
return self.EditorWindow(self, filename, key)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py",
 line 131, in __init__
EditorWindow.__init__(self, *args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 323, in __init__
io.loadfile(filename)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py",
 line 258, in loadfile
chars = self.decode(chars)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py",
 line 296, in decode
enc = coding_spec(chars)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/IOBinding.py",
 line 129, in coding_spec
for line in lst:
NameError: global name 'lst' is not defined
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
 line 1470, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1025, in close
self._close()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py",
 line 302, in _close
EditorWindow._close(self)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1032, in _close
self.unload_extensions()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1053, in unload_extensions
for ins in self.extensions.values():
AttributeError: 'PyShellEditorWindow' object has no attribute 'extensions'
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
 line 1470, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1025, in close
self._close()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py",
 line 302, in _close
EditorWindow._close(self)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1032, in _close
self.unload_extensions()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1053, in unload_extensions
for ins in self.extensions.values():
AttributeError: 'PyShellEditorWindow' object has no attribute 'extensions'
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
 line 1470, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1025, in close
self._close()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py",
 line 302, in _close
EditorWindow._close(self)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1032, in _close
self.unload_extensions()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1053, in unload_extensions
for ins in self.extensions.values():
AttributeError: 'PyShellEditorWindow' object has no attribute 'extensions'
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
 line 1470, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/EditorWindow.py",
 line 1025, in close
self._close()
  File 
"/Library/Frameworks/Python.framework/Versions/2.7

[issue19497] selectors and modify()

2013-11-04 Thread Arnaud Faure

Changes by Arnaud Faure :


--
files: modify_data.patch
keywords: patch
nosy: Arnaud.Faure
priority: normal
severity: normal
status: open
title: selectors and modify()
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32499/modify_data.patch

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I am referring to the following part of your patch:

+/* Clear the state of the current thread */
+PyThreadState_Clear(tstate);

You are clearing the thread state of the currently executing thread, which 
doesn't sound right.

--
nosy: +neologix

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

2013/11/4 Serhiy Storchaka :
> Is it possible to write a test for this behavior?

It is possible to test it manually using warn_shutdown.py attached to
#19442. The warnings module may be used to test the change.

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

2013/11/4 Antoine Pitrou :
> I'm afraid clearing thread states is a bit too brutal. What if some 
> destructor relies on contents of the thread states (e.g. thread locals)?

When Py_Finalize() is called, only one Python thread hold the GIL.
After _Py_Finalizing=tstate is set, no other thread can hold the GIL.
If another Python tries to lock the GIL, it is "killed" by
PyEval_RestoreThread().

Is that correct? If yes, in which thread would the destructor be
called? Would it read Python thread locals without holding the GIL?

--

___
Python tracker 

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



[issue19085] Add tkinter basic options tests

2013-11-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c3fa22d04fb2 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/c3fa22d04fb2

New changeset 583347b79aa0 by Serhiy Storchaka in branch '3.3':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/583347b79aa0

New changeset fe5a829bd645 by Serhiy Storchaka in branch 'default':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/fe5a829bd645

--

___
Python tracker 

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



[issue19496] Website link

2013-11-04 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  The link is now fixed.

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> committed/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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

To find an invalid FD when select() fails with EBAD, we can use something like:
http://ufwi.org/projects/nufw/repository/revisions/b4f66edc5d4dc837f75857f8bffe9015454fdebc/entry/src/nuauth/tls_nufw.c#L408

--

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> If you are using dictConfig(), you don't need to specify a class for
> your handler: you can specify a callable which configures and returns
> a handler, and the callable could be a function which created a file
> with appropriate ownership and then returned a FileHandler or subclass
> thereof which used that file.

But can I pass the file owner in the config dict?

--

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip

Vinay Sajip added the comment:

If you are using dictConfig(), you don't need to specify a class for your 
handler: you can specify a callable which configures and returns a handler, and 
the callable could be a function which created a file with appropriate 
ownership and then returned a FileHandler or subclass thereof which used that 
file. I can update the cookbook with suitable examples, with and without using 
a mixin.

--

___
Python tracker 

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



[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2013-11-04 Thread Matej Cepl

Matej Cepl added the comment:

Also let me add from RFC 2617, end of section 2:

> A client MAY preemptively send the corresponding Authorization
> header with requests for resources in that space without
> receipt of another challenge from the server.  Similarly, when
> a client sends a request to a proxy, it may reuse a userid and
> password in the Proxy-Authorization header field without
> receiving another challenge from the proxy server. See section
> 4 for security considerations associated with Basic
> authentication.

So sending "Authorization" in the introductory request is not
only performance hack, but it is also anticipated by RFC.

--

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Instead, a mixin which redefined _open would seem to fulfil the
> requirements, and the same strategy could be used to cater for other
> requirements without any stdlib changes. 

One desireable aspect is to still be able to configure logging using 
dictConfig(). I don't know if a mixin could enable this.

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm afraid clearing thread states is a bit too brutal. What if some destructor 
relies on contents of the thread states (e.g. thread locals)?

--

___
Python tracker 

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



[issue19496] Website link

2013-11-04 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +benjamin.peterson, brian.curtin, terry.reedy, tim.golden, zach.ware

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is it possible to write a test for this behavior?

--

___
Python tracker 

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



[issue19496] Website link

2013-11-04 Thread Sergey

New submission from Sergey:

Wrong ling following to Windows help file on the Python 2.7.6 RC 1 Web page.
It is the following:
http://www.python.org/ftp/python/2.7.6/python275.chm

And should be:
http://www.python.org/ftp/python/2.7.6/python276rc1.chm

--
components: Build
messages: 202154
nosy: MolotoFF
priority: normal
severity: normal
status: open
title: Website link
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



[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2013-11-04 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I think I have already proposed something similar in past but I can't find any 
reference on the tracker (so maybe I didn't after all).
BTW I have something like this [1] in a "utils" module I use across different 
projects and I would definitively welcome an inclusion in the stdlib.

[1] a modified version of 
http://dabeaz.blogspot.it/2010/02/function-that-works-as-context-manager.html

--

___
Python tracker 

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



[issue17883] Fix buildbot testing of Tkinter

2013-11-04 Thread Zachary Ware

Zachary Ware added the comment:

The buildbots appear to be happy, no more hanging and no more testLoadWithUNC 
failure.  There is a failure in test_tcl on one bot, but it is not related to 
this issue.

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



[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2013-11-04 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, georg.brandl, giampaolo.rodola
stage:  -> needs patch
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.5

___
Python tracker 

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



[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2013-11-04 Thread Damien Moore

New submission from Damien Moore:

It would be useful if timeit had a class like `timeblock` below that would 
allow one to easily time code inside a `with` block:

import time

class timeblock:
def __init__(self,descr=''):
self.descr=descr
def __enter__(self):
self.t0=time.time()
return self
def __exit__(self, type, value, traceback):
self.t1=time.time()
self.elapsed = self.t1-self.t0
if self.descr:
print self.descr,'took',self.elapsed,'seconds'

This would be used as follows:

with timeblock('cumsum') as t:
a=0
for x in range(1000):
a+=x

and would output:
cumsum took 2.39 seconds

This is useful when trying to find bottlenecks in large programs without 
interfering with their operation, which would be harder to do with 
timeit.timeit and more verbose with time.

--
components: Library (Lib)
messages: 202151
nosy: dmoore
priority: normal
severity: normal
status: open
title: Enhancement for timeit: measure time to run blocks of code using 'with'
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Eww, sorry. That's the second time I mistook this thread for the other. I 
re-read the original description and I now think that we should follow your 
original advice.

There are two separate cases:

(1) Registering an invalid FD; this succeeds for select/poll, fails for 
epoll/kqueue.

(2) Registering a valid FD, then closing it, then calling .select(); 
this raises for select, returns a special event for poll, and is silently 
ignored for epoll/kqueue.

I agree on making all selectors do the same thing for (2), and I agree that the 
best thing is to be silent and unregister the bad FD if we can (IIUC 
epoll/kqueue don't even tell us this happened?).  We then need to make 
unregister() be silent when the FD isn't registered.  Maybe make it return True 
when it actually unregistered something and False when there's nothing?  An 
alternative would be to put the bad FD into a separate "quarantine" set so that 
it won't be used by the select() method but will still be recognized by 
unregister(). (And register() should look there too.)

This still leaves case (1), where the FD is already bad when we register it.  I 
am actually fine with sometimes raising and sometimes not; I don't want to pay 
the extra overhead of doing an fstat() or some other syscall just to verify 
that it is valid.  (Although this would make the argument about wanting to 
choose a selector class that doesn't make extra syscalls less compelling. :-)  
And neither do I want to ignore the error in register() and pretend success.

I guess we should in any case make it consistent so that if you successfully 
register() an FD you can always unregister() it without raising.

I really wish there was an event to tell us that an FD has become invalid, but 
if epoll/kqueue really don't support that, i don't think it's worth it to 
introduce that only for select/poll.  IOW let's do what those other systems you 
mention do.

--

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2013-11-04 Thread Gereon Kremer

Gereon Kremer added the comment:

I stumbled about this issue again and would really like to see it fixed.

I see the possibility to create a test case in combination with the first test 
sequence which creates a temporary mail. Would it be enough, that we just call 
IDLE in some folder, create a temporary mail in this folder and check if it 
returns?

Unfortuantely, I have not been able to write code for such a test case yet, as 
the whole test routine fails with "[PRIVACYREQUIRED] Plaintext authentication 
disallowed on non-secure (SSL/TLS) connections". This is using 3.2.3, but I 
guess it will not be any different with the current release... (as it is the 
same with 2.7.3)

--

___
Python tracker 

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



[issue19490] Problem installing matplotlib 1.3.1 with Python 2.7.6rc1 and 3.3.3rc1

2013-11-04 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19492] Report skipped distutils tests as skipped

2013-11-04 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

> Lib/distutils/tests/test_build_ext.py
...
> -ALREADY_TESTED = True
> +ALREADY_TESTED = type(self).__name__

Why this change?

> Lib/distutils/tests/test_build_ext.py
...
> +@unittest.skipIf(sys.version < '2.6',
> + 'site.USER_SITE was introduced in 2.6')
>  def test_user_site(self):
> -# site.USER_SITE was introduced in 2.6
> -if sys.version < '2.6':
> -return

This check probably could be deleted.

--
nosy: +Arfrever

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread Charles-François Natali

Charles-François Natali added the comment:

> By which you mean that you still don't agree with my proposal? Which is to
> fix it for most syscalls but not for select(), poll() and similar (anything
> that the new selectors module interfaces to).

I agree with your proposal, but that's another issue :-) (this thread
is about EBADF in selectors, not EINTR).

--

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread Guido van Rossum

Guido van Rossum added the comment:

> AFAICT, we haven't reached a consensus yet on the best way to handle
EBADF.

By which you mean that you still don't agree with my proposal? Which is to
fix it for most syscalls but not for select(), poll() and similar (anything
that the new selectors module interfaces to).

--

___
Python tracker 

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2013-11-04 Thread Stefan Krah

Stefan Krah added the comment:

STINNER Victor  wrote:
> What is this locale_t type used for the locale parameter of mbstowcs_l()?
> Are you sure that it is a string? According to this patch, it looks like a 
> structure:
> http://www.winehq.org/pipermail/wine-cvs/2010-May/067264.html

Yes, the string was mainly for benchmarking. FreeBSD seems to have thread safe
versions (xlocale.h), that take a locale_t as the extra parameter.

--

___
Python tracker 

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



[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2013-11-04 Thread Matej Cepl

New submission from Matej Cepl:

GitHub API v3 is intentionally broken (see 
http://developer.github.com/v3/auth/):

> The main difference is that the RFC requires unauthenticated requests to be 
> answered with 401 Unauthorized responses. In many places, this would disclose 
> the existence of user data. Instead, the GitHub API responds with 404 Not 
> Found. This may cause problems for HTTP libraries that assume a 401 
> Unauthorized response. The solution is to manually craft the Authorization 
> header.

Unfortunately, urllib2.HTTPBasicAuthHandler relies on the standard-conformant 
behavior. So a naive programmer (like me) who wants to program against GitHub 
API using urllib2 (and foolishly ignores this comment about the API 
non-conformance, because he thinks GitHub wouldn't be that stupid and break all 
Python applications) uses for authentication something like the example script 
on http://docs.python.org/2/howto/urllib2.html#id6, spends couple of hours 
hitting this issue, until he tries python-requests (which work) and his 
(mistaken) conclusion is that urllib2 is a piece of crap which should never be 
used again.

I am not sure how widespread is this breaking of RFC, but it seems to me that 
quite a lot (e.g., http://stackoverflow.com/a/9698319/164233 which just en 
passant expects urllib2 authentication stuff to be useless), and the question 
is whether it shouldn't be documented somehow and/or 
urllib2.HTTPBasicAuthHandler shouldn't be modified to try add Authenticate 
header first.

--
components: Library (Lib)
messages: 202144
nosy: mcepl
priority: normal
severity: normal
status: open
title: urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) 
doesn't work with GitHub API v3 and similar
versions: Python 2.6, Python 2.7, 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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 04.11.2013 14:30, STINNER Victor wrote:
> 
> It would be simpler to just drop these custom codecs (rot13, bz2, hex, etc.) 
> instead of helping to use them :-)

-1 for the same reasons I keep repeating over and over and over again :-)

The codec system was designed to work obj->obj. Python 3 limits the types
for the bytes/str helper methods, but that limitation does not extend
to the codec design.

+1 on having better error messages. In the long run, we should add
supported input/output type information to codecs, so that error
reporting and codec introspection becomes easier.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 04 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...   http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2013-11-19: Python Meeting Duesseldorf ... 15 days to go

: Try our mxODBC.Connect Python Database Interface for free ! ::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

--
nosy: +lemburg

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Sure, thanks for the review, it's really insightful regarding API design. I 
will try to contribute an example for the cookbook later this day.

--

___
Python tracker 

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



[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip

Vinay Sajip added the comment:

This issue had dropped off my radar, thanks for bringing it back into view.

I see that the patch follows Antoine's suggestion of a "chown" parameter, but 
I'm not sure that's the best way to provide this functionality. What concerns 
me about a "chown" parameter:

1. It's POSIX only, which makes me not want to add it to the API for all users 
(even though they don't need to specify it, as it's defaulted). It's not a 
really common use case, even on POSIX.
2. It makes the argument list for the rotating handlers even more unwieldy than 
it is at present. While it's not pretty now, I don't want to make it uglier.
3. If other things like this are requested in the future (e.g. "chmod" as 
mentioned in the original post), then it makes the argument lists longer and 
longer if this approach is used to satisfy those requirements.

Instead, a mixin which redefined _open would seem to fulfil the requirements, 
and the same strategy could be used to cater for other requirements without any 
stdlib changes. Of course it requires the developer to do a little bit more 
work than having the work done for them in the stdlib, but I think it's 
reasonable to meet the requirement this way as it's relatively uncommon. I 
don't mind adding an working example of this to the cookbook, making it even 
less work for developers to adopt this approach. While the _open method is 
technically private as it begins with an underscore, I have no problem letting 
subclasses override it.

Also, ISTM that your patch would fail at the shutil.chown call if the log file 
didn't already exist, which is a not uncommon scenario.

--

___
Python tracker 

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



[issue19406] PEP 453: add the ensurepip module

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm OK with an unqualified "pip install --upgrade pip" retaining pip's current 
behaviour of always writing the unqualified script versions.

However, running "pip3 install --upgrade pip" would ideally leave the "pip" and 
"easy_install" scripts alone.

For "make altinstall" compatibility, we definitely need a "--altinstall" flag 
that only installs the fully qualified versions of pip and easy_install.

Finally, there needs to be some way to explicitly request the "pip3" style 
behaviour when running via -m so we can use it from ensurepip.

--

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread Charles-François Natali

Charles-François Natali added the comment:

> What is the status of this issue?

AFAICT, we haven't reached a consensus yet on the best way to handle EBADF.

--

___
Python tracker 

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



[issue19406] PEP 453: add the ensurepip module

2013-11-04 Thread Donald Stufft

Donald Stufft added the comment:

Tweaking the Wheels won't work. The scripts are generated at install time.

We need to fix it in pip, I was waiting on answers to 
http://bugs.python.org/issue19406#msg201954 before coming up with a solution 
and making a PR request as that will influence the proposal/PR I make to pip. 
Basically we need to figure out what is considered reasonable during the 
initial ensurepip, and subsequent pip install --upgrade pip.

--

___
Python tracker 

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



[issue19406] PEP 453: add the ensurepip module

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

I created https://github.com/pypa/pip/issues/1294 for the script versioning 
issue on the pip side, as I'd prefer not to be doing the temporary directory 
dance if we don't need to.

How do we want to handle this for beta 1? Is it OK to do an initial commit that 
has the installation of non-versioned scripts as a known defect so we can make 
progress on the rest of the changes in the meantime?

Alternatively, we could perhaps tweak the embedded wheels as an interim fix 
until the problem is addressed upstream.

--

___
Python tracker 

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



[issue19492] Report skipped distutils tests as skipped

2013-11-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Vajrasky.

--
keywords: +patch
Added file: http://bugs.python.org/file32498/skip_tests_distutils.patch

___
Python tracker 

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



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-04 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue4331] Add functools.partialmethod

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Indeed, added to __all__ in http://hg.python.org/cpython/rev/ac1685661b07

--

___
Python tracker 

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



[issue19487] Correct the error of the example given in the doc of partialmethod

2013-11-04 Thread Nick Coghlan

New submission from Nick Coghlan:

Thanks for the report, this has now been fixed in 
http://hg.python.org/cpython/rev/ac1685661b07

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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

It would be simpler to just drop these custom codecs (rot13, bz2, hex, etc.) 
instead of helping to use them :-)

--
nosy: +haypo

___
Python tracker 

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

What is this locale_t type used for the locale parameter of mbstowcs_l()? Are 
you sure that it is a string? According to this patch, it looks like a 
structure:
http://www.winehq.org/pipermail/wine-cvs/2010-May/067264.html

--

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

The other thing is that this patch doesn't wrap AttributeError. I'm OK with 
that, since I believe the only codec in the standard library that currently 
throws that for a bad input type is rot_13.

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

For anyone interested, I have a patch up on issue 17828 that produces the 
following output for various codec usage errors:

>>> import codecs
>>> codecs.encode(b"hello", "bz2_codec").decode("bz2_codec")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'bz2_codec' decoder returned 'bytes' instead of 'str'; use 
codecs.decode to decode to arbitrary types

>>> "hello".encode("bz2_codec")
TypeError: 'str' does not support the buffer interface

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid input type for 'bz2_codec' codec (TypeError: 'str' does not 
support the buffer interface)

>>> "hello".encode("rot_13")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'rot_13' encoder returned 'str' instead of 'bytes'; use 
codecs.encode to encode to arbitrary types

--

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, came up with a relatively simple solution based on an internal helper 
function with an optional output flag:

>>> import codecs
>>> codecs.encode(b"hello", "bz2_codec").decode("bz2_codec")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'bz2_codec' decoder returned 'bytes' instead of 'str'; use 
codecs.decode to decode to arbitrary types

>>> "hello".encode("bz2_codec")
TypeError: 'str' does not support the buffer interface

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid input type for 'bz2_codec' codec (TypeError: 'str' does not 
support the buffer interface)

>>> "hello".encode("rot_13")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'rot_13' encoder returned 'str' instead of 'bytes'; use 
codecs.encode to encode to arbitrary types

--
Added file: 
http://bugs.python.org/file32497/issue17828_improved_codec_errors_v2.diff

___
Python tracker 

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



[issue19492] Report skipped distutils tests as skipped

2013-11-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

You forgot to upload the "proposed patch", Serhiy.

--
nosy: +vajrasky

___
Python tracker 

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2013-11-04 Thread Stefan Krah

Stefan Krah added the comment:

Yes, I saw the comments. I'm still wondering if we should just write an
mbstowcs_l() function instead.

Even then, there would still be a small chance that a C extension that
creates its own thread picks up the wrong LC_CTYPE.

--

___
Python tracker 

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



[issue18702] Report skipped tests as skipped

2013-11-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Related issues: issue19492 and issue19493.

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



[issue17828] More informative error handling when encoding and decoding

2013-11-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Updated patch. The results of this suggests to me that the input wrappers are 
likely infeasible at this point in time, but improving the errors for the wrong 
*output* type is entirely feasible. Since the main conversion we need to prompt 
is things like "binary_object.decode(binary_codec)" -> 
"codecs.decode(binary_object, binary_codec)", I suggest we limit the scope of 
this issue to that part of the problem.

>>> import codecs
>>> codecs.encode(b"hello", "bz2_codec").decode("bz2_codec")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'bz2_codec' decoder returned 'bytes' instead of 'str'; use 
codecs.decode to decode to arbitrary types
>>> "hello".encode("bz2_codec")
TypeError: 'str' does not support the buffer interface

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid input type for 'bz2_codec' codec (TypeError: 'str' does not 
support the buffer interface)
>>> "hello".encode("rot_13")
TypeError: 'rot_13' encoder returned 'str' instead of 'bytes'; use 
codecs.encode to encode to arbitrary types

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid input type for 'rot_13' codec (TypeError: 'rot_13' encoder 
returned 'str' instead of 'bytes'; use codecs.encode to encode to arbitrary 
types)

--
Added file: 
http://bugs.python.org/file32496/issue17828_improved_codec_errors.diff

___
Python tracker 

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



[issue19493] Report skipped ctypes tests as skipped

2013-11-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some skipped ctypes tests are reported as passed. Proposed patch adds explicit 
reporting them as skipped.

See also issue18702.

--
components: Tests, ctypes
files: skip_tests_ctypes.patch
keywords: patch
messages: 202124
nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Report skipped ctypes tests as skipped
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32495/skip_tests_ctypes.patch

___
Python tracker 

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



[issue19492] Report skipped distutils tests as skipped

2013-11-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some skipped distutils tests are reported as passed. Arfrever pointed out on 
some of these tests on IRC. Proposed patch adds explicit reporting them as 
skipped.

See also issue18702.

--
assignee: eric.araujo
components: Distutils, Tests
messages: 202123
nosy: eric.araujo, serhiy.storchaka, tarek
priority: normal
severity: normal
stage: patch review
status: open
title: Report skipped distutils tests as skipped
type: enhancement
versions: Python 2.7, 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



[issue19017] selectors: towards uniform EBADF handling

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

What is the status of this issue?

--

___
Python tracker 

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



[issue19480] HTMLParser fails to handle some characters in the starttag

2013-11-04 Thread R. David Murray

R. David Murray added the comment:

Then for 3.3 you are bug fixing the regex, so anyone using it ought to want the 
change, right? :)

If the same is true for 2.7, then creating an alias would probably be fine.  I 
haven't looked at the details, so I'll leave it to your judgment.  I just don't 
want the name going away in 2.7, it might be a gratuitous breaking of someone's 
code.

--

___
Python tracker 

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-04 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file32211/57ae01bf96cb.patch

___
Python tracker 

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-04 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file32478/65e72bf01246.patch

___
Python tracker 

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-04 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file32494/022955935ba3.patch

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

"You got me, Antoine! I'm working on a Python-only implementation of 
PBKDF2_HMAC. It involves XOR of two bytes in one place."

If you want super-fast code, you should probably reimplement it in C. Python is 
not designed for performances...

--

___
Python tracker 

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



[issue19480] HTMLParser fails to handle some characters in the starttag

2013-11-04 Thread Ezio Melotti

Ezio Melotti added the comment:

For 2.7 that sounds like a reasonable option, for 3.3/3.4 however I'm keeping 
the name but I change the regex groups, so it might break if someone is using 
it with groups.  In theory I could add a third name and leave that unchanged, 
but I'm not sure it's worth it.

--

___
Python tracker 

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



[issue18931] new selectors module should support devpoll on Solaris

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

@Giampaolo: Your patch doesn't apply cleanly anymore. Could you update it?

Issue #19172 has been fixed, selectors now have a get_map() method.

--

___
Python tracker 

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

@Stefan: Did you my comments on Rietveld?
http://bugs.python.org/review/7442/#ps1473

--

___
Python tracker 

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



[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread STINNER Victor

STINNER Victor added the comment:

Results of benchmarks using compare_hash-3.patch:

$ time ../benchmarks/perf.py -r -b default ./pythonorig ./pythonhash 
INFO:root:Skipping benchmark slowspitfire; not compatible with Python 3.4
INFO:root:Skipping benchmark slowpickle; not compatible with Python 3.4
INFO:root:Skipping benchmark slowunpickle; not compatible with Python 3.4
INFO:root:Skipping benchmark spambayes; not compatible with Python 3.4
Running 2to3...
Running django_v2...

Report on Linux smithers 3.9.4-200.fc18.x86_64 #1 SMP Fri May 24 20:10:49 UTC 
2013 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
Min: 6.358000 -> 6.055000: 1.05x faster
Avg: 6.407600 -> 6.179800: 1.04x faster
Significant (t=3.53)
Stddev: 0.04311 -> 0.13785: 3.1979x larger

### nbody ###
Min: 0.219029 -> 0.212477: 1.03x faster
Avg: 0.224940 -> 0.219248: 1.03x faster
Significant (t=10.13)
Stddev: 0.00373 -> 0.00420: 1.1288x larger

The following not significant results are hidden, use -v to show them:
django_v2.


At least, Python is not slower with the patch :-) I'm surprised that the 
benchmark shows a difference. nbody benchmark is focused on float numbers. I 
checked with gdb, nbody benchmark does not call any Unicode comparison function.

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2013-11-04 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



  1   2   >