[issue14315] zipfile.ZipFile() unable to open zip File

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6dd5e9556a60 by Gregory P. Smith in branch '2.7':
Fix issue #14315: The zipfile module now ignores extra fields in the central
http://hg.python.org/cpython/rev/6dd5e9556a60

New changeset 33843896ce4e by Gregory P. Smith in branch '3.4':
Fix issue #14315: The zipfile module now ignores extra fields in the central
http://hg.python.org/cpython/rev/33843896ce4e

New changeset 89be1419472c by Gregory P. Smith in branch 'default':
Fix issue #14315: The zipfile module now ignores extra fields in the central
http://hg.python.org/cpython/rev/89be1419472c

--
nosy: +python-dev

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



[issue14315] zipfile.ZipFile() unable to open zip File with a short extra header

2014-05-30 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This was never an enhancement.  zipfile was failing to properly deal with real 
world data that other zip file tools on the planet were perfectly happy to deal 
with.  That's a bug.  Fixed.

 Practicality beats purity.
 Be lenient in what you accept.

The zipfile module is not meant to be a zip standard validation tool.

The other discussions in this bug about adding actual features such as a 
strict mode flag could be done but should really go in feature requests of 
their own.  The zipfile module is... not a wonderful body of code 
(understatement).  Example: It is still quite possible to get non 
zipfile.BadZipFile exceptions such as struct.error based on various 
arrangements of input data.

--
assignee:  - gregory.p.smith
nosy: +gregory.p.smith
resolution:  - fixed
stage: test needed - resolved
status: open - closed
title: zipfile.ZipFile() unable to open zip File - zipfile.ZipFile() unable to 
open zip File with a short extra header
type: enhancement - behavior
versions: +Python 2.7, Python 3.4, Python 3.5 -Python 3.3

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



[issue21611] int() docstring - unclear what number is

2014-05-30 Thread Dmitry Andreychuk

New submission from Dmitry Andreychuk:

https://docs.python.org/3.4/library/functions.html?highlight=int#int

The docstring for int() function has these sentences:
If x is a number, return x.__int__().
If x is not a number or if base is given...

Unfortunately the docstring doesn't describe how the function decides if x is a 
number or not.

After searching and experimenting I came to conclusion that it is the presence 
of x.__int__() method makes int() treat x as a number. But I'm not sure it's a 
precise requirement or just something that happens to work with current 
implementation.

I think there should be a precise definition of what is considered to be a 
number there.

--
assignee: docs@python
components: Documentation
messages: 219379
nosy: and, docs@python
priority: normal
severity: normal
status: open
title: int() docstring - unclear what number is
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f5521f5dec4a by Raymond Hettinger in branch 'default':
Issue #13742:  Add key and reverse parameters to heapq.merge()
http://hg.python.org/cpython/rev/f5521f5dec4a

--
nosy: +python-dev

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2014-05-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-05-30 Thread Sunny K

Sunny K added the comment:

Hi Stefan,

There is a comment at the top in structseq.c

/* Fields with this name have only a field index, not a field name.
   They are only allowed for indices  n_visible_fields. */
char *PyStructSequence_UnnamedField = unnamed field;

This is the definition of os.stat_result in posixmodule.c:

static PyStructSequence_Field stat_result_fields[] = {
{st_mode,protection bits},
{st_ino, inode},
{st_dev, device},
{st_nlink,   number of hard links},
{st_uid, user ID of owner},
{st_gid, group ID of owner},
{st_size,total size, in bytes},
/* The NULL is replaced with PyStructSequence_UnnamedField later. */
{NULL,   integer time of last access},
{NULL,   integer time of last modification},
{NULL,   integer time of last change},
{st_atime,   time of last access},
{st_mtime,   time of last modification},
{st_ctime,   time of last change},
{st_atime_ns,   time of last access in nanoseconds},
{st_mtime_ns,   time of last modification in nanoseconds},
{st_ctime_ns,   time of last change in nanoseconds},
  ...


By visible i mean the values present in the repr of the object and by-extension 
accessible by position.

I talked about my problems with os.stat_result in points 3 and 4 of msg202333 
i.e repr of os.stat_result takes the first three keys from the attribute-access 
only fields (the invisible part) and uses them for the last three values in the 
displayed structseq.

With my current patch, _fields for os.stat_result only has 7 values:

 x = os.stat('.')
 x._fields
('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid', 'st_size')


Is this what you expect?

--

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-05-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
versions: +Python 3.5 -Python 3.4

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



[issue19048] itertools.tee doesn't have a __sizeof__ method

2014-05-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - rejected
status: open - closed

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



[issue19662] smtpd.py should not decode utf-8

2014-05-30 Thread Maciej Szulik

Maciej Szulik added the comment:

I've included Leslie's comments in rst file. The 3rd version is attached in 
issue19662_v3.patch.

--
Added file: http://bugs.python.org/file35409/issue19662_v3.patch

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



[issue1185124] pydoc doesn't find all module doc strings

2014-05-30 Thread Sunny K

Changes by Sunny K sunfin...@gmail.com:


Removed file: http://bugs.python.org/file31844/myfirst.patch

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



[issue1185124] pydoc doesn't find all module doc strings

2014-05-30 Thread Sunny K

Sunny K added the comment:

Hi Victor, can you give this another look?

--
versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3

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



[issue21571] Python build should check CPATH, C_INCLUDE_PATH for module dependencies

2014-05-30 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'm pretty sure that I wrote the code Ned refers to, and that's indeed only 
targeting darwin to avoid breaking other platforms. That code could easily be 
made actively globally though, the only reason I didn't do so at the time is we 
were still getting used to the fact that MacOS used the same build 
infrastructure as other major platforms and hence were overly cautious.

Note that this doesn't do the same thing as Jan requests: GCC[1] and clang[2] 
can add additional directories to their header file search path using 
environment variables. 

For Python's setup.py file the following are important:

* C_INCLUDE_PATH: a list of directories that are handled as if they are present 
at the end of the list of -isystem options (that is, system include files at a 
lower priority that the user provided ones)

* CPATH: simular, but for the '-I' option

* LIBRARY_PATH: similar, but for the '-L' option

All of them have a syntax similar to $PATH.

A patch to add support for these variables (and enables the handling of -I and 
-L for other platforms than darwin) should be easy enough, but I agree with Ned 
that this would be a new feature because it could break existing build systems 
(that is, building Python with this patch could result in a different build 
than without the patch due to the build picking up more or different external 
libraries).

Jan: are you willing to write such a patch? And if so, are you willing to sign 
a contributor agreement?

[1]: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
[2]: http://clang.llvm.org/doxygen/Tools_8cpp_source.html

--
nosy: +ronaldoussoren

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



[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2014-05-30 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Isn't Modules/Setup used for builtin modules?

The proposed configure flags are easier to find because similar flags are used 
by other projects using autoconf. 

Note that on OSX you could use CFLAGS=-I/path/to/ssl/include 
LDFLAGS=-L/path/to/ssl/lib, because setup.py contains code to add directories 
from those flags to its search path for headers and libraries, but only for OSX 
because I was overly cautious when adding that code.

--
nosy: +ronaldoussoren

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



[issue21552] String length overflow in Tkinter

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 59468bd68789 by Serhiy Storchaka in branch '2.7':
Issue #21552: Fixed possible integer overflow of too long string lengths in
http://hg.python.org/cpython/rev/59468bd68789

New changeset a90cddfd9e47 by Serhiy Storchaka in branch '3.4':
Issue #21552: Fixed possible integer overflow of too long string lengths in
http://hg.python.org/cpython/rev/a90cddfd9e47

New changeset 5b80af12ccb7 by Serhiy Storchaka in branch 'default':
Issue #21552: Fixed possible integer overflow of too long string lengths in
http://hg.python.org/cpython/rev/5b80af12ccb7

New changeset 8c96af2fba28 by Serhiy Storchaka in branch '2.7':
Fixed possible integer overflow in getint, getdouble and getboolean too (issue 
#21552).
http://hg.python.org/cpython/rev/8c96af2fba28

--
nosy: +python-dev

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



[issue21592] Make statistics.median run in linear time

2014-05-30 Thread Thomas Dybdahl Ahle

Thomas Dybdahl Ahle added the comment:

If you have a good, realistic test set, we can try testing quick-select vs 
sorting. If it's still not good, I can also reimplement it in C.

--

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Brett Cannon

Brett Cannon added the comment:

Giving Eric is polymorphic first argument to types.ModuleType() is going to be 
tricky thanks to the fact that it is not hard-coded anywhere in the C code nor 
documented that the first argument must be a string (the only way it might come 
up is from PyModule_GetName() and even then that's not required to work as you 
would expect). And since we purposefully kept specs type-agnostic, you can't do 
a type check for a SimpleNamespace.

I think the only way for it to work is by attribute check (e.g. is 'name' or 
'loader' defined on the object, regardless of value).

--

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Brett Cannon

Brett Cannon added the comment:

Another issue with the polymorphic argument is that the module type is one of 
those rare things written in C with keyword parameter support, so renaming the 
'name' argument to 'name_or_spec' could potentially break code.

--

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



[issue21608] logging.handlers.HTTPHandler.setFormatter() has no effect

2014-05-30 Thread Bikram Zesto II

Bikram Zesto II added the comment:

I see what you are saying about implementation kludginess and will likely 
subclass just to get my app done.

On the other hand, I think the POLA(stonishment) violation of ignoring 
format-related configuration of the Handler (even tho it is a subclass) matters 
too :-)

Was not thinking a Formatter should be put _into_ mapLogRecord. More like idly 
wondering if mapLogRecord could be implemented as a Formatter. If this sounds 
like a non-kludge you would be interested in I can work on that. Added benefit 
being that users could override without subclassing.

Maybe this is more like a documentation issue (since there is no indication 
that HTTPHandler does not/cannot use a Formatter like other of Handlers?

--
keywords: +patch
status: pending - open
Added file: http://bugs.python.org/file35410/logging.handlers.txt.patch

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



[issue21610] load_module not closing opened files

2014-05-30 Thread Brett Cannon

Brett Cannon added the comment:

I don't have a Python 2.7 repo handy but the patch LGTM.

--
nosy: +brett.cannon

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



[issue21612] IDLE should should not open multiple instances of one file

2014-05-30 Thread irdb

New submission from irdb:

Currently users can open multiple instances of one file in IDLE. Sometimes this 
leads to confusion and may cause loss of data. I'm not aware of any benefits of 
this behavior and I think it's better to be prevented by IDLE.

Here are the steps to recreate the situation:
1. Create a file named xyz.py
2. Right-click on the file and open it with IDLE
3. Add some text
4. Goto 2.
5. Save and close both open IDLE windows.
(Your work on the first saved file will be lost.)

--
components: IDLE
messages: 219392
nosy: irdb
priority: normal
severity: normal
status: open
title: IDLE should should not open multiple instances of one file

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



[issue21612] IDLE should not open multiple instances of one file

2014-05-30 Thread irdb

Changes by irdb dalba.w...@gmail.com:


--
title: IDLE should should not open multiple instances of one file - IDLE 
should not open multiple instances of one file

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



[issue21613] Installer for mac doesn't store the installation location

2014-05-30 Thread Artem Ustinov

New submission from Artem Ustinov:

I'm trying to automate the Python uninstallation on mac but I've found that the 
actual installation location is not stored for Python packages.
That location is required since the pkgutil keeps track of installed files (if 
you run $ pkgutil --files org.python.Python.PythonFramework-3.4) but doesn't 
store the absolute paths for that files.


1. Run $ pkgutil --pkgs=.*Python.*3\.4
Here's the expected output
org.python.Python.PythonApplications-3.4
org.python.Python.PythonDocumentation-3.4
org.python.Python.PythonFramework-3.4
org.python.Python.PythonInstallPip-3.4
org.python.Python.PythonProfileChanges-3.4
org.python.Python.PythonUnixTools-3.4

2. Run $ pkgutil --pkg-info org.python.Python.PythonFramework-3.4
Here's the output
package-id: org.python.Python.PythonFramework-3.4
version: 3.4.1
volume: /
location: (null)
install-time: 1401373546

Actual Result: The location property is (null)
Expected Result: The location property should be 
'/Library/Frameworks/Python.framework'

--
assignee: ronaldoussoren
components: Installation, Macintosh
messages: 219393
nosy: ronaldoussoren, ustinov
priority: normal
severity: normal
status: open
title: Installer for mac doesn't store the installation location
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue21477] Idle: improve idle_test.htest

2014-05-30 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com:


Added file: http://bugs.python.org/file35411/htest-docstring-34.diff

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



[issue21613] Installer for mac doesn't store the installation location

2014-05-30 Thread Ronald Oussoren

Ronald Oussoren added the comment:

According to the manpage pkgutil is used with flat packages. The Python 
installer users older bundle-style packages.

--
nosy: +ned.deily

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



[issue21477] Idle: improve idle_test.htest

2014-05-30 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com:


Added file: http://bugs.python.org/file35412/htest-docstring-27.diff

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



[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread R. David Murray

R. David Murray added the comment:

I think the code should be using 'detach' after passing the fp to parser.parse, 
instead of using 'with'.

--
versions: +Python 3.5 -Python 3.3

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



[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-30 Thread Steve Dower

Steve Dower added the comment:

I can commit it, though I don't know how it'll affect Benjamin's release branch?

(Obviously the build will be fine either way - I had the patch applied for 
2.7.7rc1.)

--

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Eric Snow

Eric Snow added the comment:

Yeah, it just looks too complicated to take the ModuleType signature approach, 
as much as I prefer it. :)  I appreciate you taking a look though.

--

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



[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the simple patch based on David Murray's thought.

--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file35413/bytes_parser_dont_close_file.patch

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



[issue21608] logging.handlers.HTTPHandler.setFormatter() has no effect

2014-05-30 Thread Vinay Sajip

Vinay Sajip added the comment:

As far as POLA is concerned, IMO serializing to the HTTP request format isn't 
really a text formatting operation in the same way as for most other handlers. 
The point is, even if you could have a Formatter handle the operation, you 
can't usefully share this Formatter with other handlers (which you refer to in 
your initial post), unless you really want to have format lines such as 
a=bc=de=f output to console or file, say - which is unlikely to be a common 
requirement.

I don't expect to make any changes in this area - as I mentioned earlier, 
because (a) backward compatibility and (b) IMO it will surprise more people 
than the current approach (IIRC no one else has raised this or a similar issue 
in the 10+ years that logging has been in Python).

BTW, I am happy to update the documentation for HTTPHandler to indicate that it 
can't sensibly use a Formatter. I'll do this soon, and that change will close 
this issue.

--

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Brett Cannon

Brett Cannon added the comment:

And another complication is the compatibility hack to set loader when 
submodule_search_locations is set but loader is not since _NamespaceLoader is 
not exposed in C without importlib which gets us back into the whole question 
of whether types should function entirely in isolation from other subsystems of 
Python.

--

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



[issue13212] json library is decoding/encoding when it should not

2014-05-30 Thread Chris Rebert

Chris Rebert added the comment:

Okay, so can this issue be closed in light of the existing docs and issue 21514 
then?

--

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Eric Snow

Eric Snow added the comment:

But that part is less of a concern since we don't need namespace packages 
before or during bootstrapping, and afterward we have access to 
interp-importlib.  Or am I missing something?

 which gets us back into the whole question of whether types should
 function entirely in isolation from other subsystems of Python.

That is a great question, regardless.  In part I imagine it depends on the 
subsystem and how intrinsic it is to the interpreter, which seems like a 
relatively implementation-agnostic point from a high-level view.

--

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



[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-30 Thread Zachary Ware

Zachary Ware added the comment:

Go ahead and commit; it will be up to Benjamin to cherry-pick it to his release 
branch (or to ask you to do it).

--

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Devise a simple test (fail before, work after) that does not require enum34. If 
this fix is committed, the message could note that the same issue was fixed 
differently in 3.4 mixed in with other changes.

--
nosy: +terry.reedy
stage:  - test needed

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



[issue21568] Win32 pip doesn't use relative path to found site-packages.

2014-05-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +ncoghlan

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



[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Did you intend to upload a diff with the current changes?

My answers:
* Just describe 466. Don't invite trouble.
* Move the section to its logical place in temporal order, with a clear link.

--
nosy: +terry.reedy

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



[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Use try/finally to detach even if an exception is raised during parsing.

--
nosy: +serhiy.storchaka

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



[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f6e47d27f67a by Steve Dower in branch '2.7':
Issue #21462 PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds
http://hg.python.org/cpython/rev/f6e47d27f67a

--
nosy: +python-dev

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



[issue21608] logging.handlers.HTTPHandler.setFormatter() has no effect

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e5373bfbe76b by Vinay Sajip in branch '2.7':
Issue #21608: Updated HTTPHandler documentation.
http://hg.python.org/cpython/rev/e5373bfbe76b

New changeset 220bed23696e by Vinay Sajip in branch '3.4':
Issue #21608: Updated HTTPHandler documentation.
http://hg.python.org/cpython/rev/220bed23696e

New changeset 69011f6ce573 by Vinay Sajip in branch 'default':
Closes #21608: Merged documentation update from 3.4.
http://hg.python.org/cpython/rev/69011f6ce573

--
nosy: +python-dev
resolution: not a bug - fixed
stage:  - resolved
status: open - closed

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



[issue14097] Improve the introduction page of the tutorial

2014-05-30 Thread Zachary Ware

Zachary Ware added the comment:

How's this for a 2.7 backport?  The least direct part of the backport is the 
section on division; I pretty much had to completely rewrite the paragraph in 
2.x terms and I'm not certain that I took the best approach.

--
stage: commit review - patch review
versions:  -Python 3.3, Python 3.4
Added file: http://bugs.python.org/file35414/issue14097-2.7.diff

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



[issue21573] Clean up turtle.py code formatting

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am glad to see this. Gregor has been inactive for several years, Except for 
Ned's recent patch for OSX, it has been years since there was a turtle-specific 
code patch (from hg revision history).

Questions: is there project link? are any of the mentors core developers, with 
commit rights? or would you need commits from someone like me?

I have read turtle.py and found that the multiple layers made some things hard 
to follow. To me, this was a bigger impediment than code formatting. You may 
want to develop an outline of the layer structure.

As you may know, Guido generally discourages pure code cleanups and prefers 
that they be done when the code is examined for other purposes. I personally 
think some changes are safe enough if verified by a second person.

I looked for and did not fine test/test_turtle. Did I miss something? 
Turtledemo is a partial substitute, but it might not exercise all turtle 
functions.

If you only apply cleanups to 3.5, subsequent bug fixes for all 3 versions will 
become much more difficult. The default commit process assumes that maintenance 
patches merge forward cleanly. I try to keep Idle code the same across versions 
as much as possible.

--
nosy: +terry.reedy

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b26d021081d2 by Brett Cannon in branch 'default':
Issue #20383: Introduce importlib.util.module_from_spec().
http://hg.python.org/cpython/rev/b26d021081d2

--
nosy: +python-dev

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Brett Cannon

Brett Cannon added the comment:

After all the various revelations today about how much of a hassle and murky it 
would be to get types.ModuleType to do what we were after, I went ahead and 
kept importlib.util.module_from_spec(), but dropped the module argument bit. I 
also deconstructed _SpecMethods along the way while keeping the abstractions as 
Eric requested.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue21577] Help for ImportError should show a more useful signature.

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Your example in #21578 suggests that **kwargs should be deleted.
*args is right.
 ImportError(3, 'a')
ImportError(3, 'a')

Should not this be fixed by ArgClinic conversion, and is not there an issue for 
that for exceptions?

--
nosy: +terry.reedy

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



[issue21500] Make use of the load_tests protocol in test_importlib packages

2014-05-30 Thread R. David Murray

R. David Murray added the comment:

Personally I think the fact that this doesn't work by default is a bug in 
unittest.  See issue 15007.  Issue 16662 may also be related.

--
nosy: +r.david.murray

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



[issue21582] use support.captured_stdx context managers - test_asyncore

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since asyncore is depracated, I don't know if tests are being updated, or if 
this should be closed.

--
nosy: +josiahcarlson, stutzbach, terry.reedy
title: use support.catpured context managers - test_asyncore - use 
support.captured_stdx context managers - test_asyncore

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



[issue21504] can the subprocess module war using os.wait4 and so return usage?

2014-05-30 Thread R. David Murray

R. David Murray added the comment:

I think the answer is that if you want that level of control you can't use 
communicate, you have to implement what you specifically need.

I'm going to close this as rejected.  It could be reopened if someone can find 
a way to propose something that makes sense cross-platform.

--
nosy: +r.david.murray
resolution:  - rejected
stage:  - resolved
status: open - closed

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



[issue21583] use support.captured_stderr context manager - test_logging

2014-05-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +vinay.sajip
stage:  - patch review
title: use support.catpured_stderr context manager - test_logging - use 
support.captured_stderr context manager - test_logging
type:  - enhancement

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



[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The exception appears to be intentional, though I do not know what a 
'qualified' exec would be. But since the tuple form is intended to mimic 3.x 
exec, and since a reduced version of your example

c = '''
def g():
def f():
if True:
exec(, {}, {})
'''
compile(c, code, exec)

runs fine in 3.4, I agree that this appears to be a 2.7 compiler bug.

--
nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, terry.reedy
stage:  - needs patch

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Eric Snow

Eric Snow added the comment:

Thanks for doing that Brett and for accommodating me. :)  Also, the various 
little cleanups are much appreciated.

--

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



[issue21592] Make statistics.median run in linear time

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

To accept contributions, we need a signed (possibly electronically) 
contribution form. 
https://www.python.org/psf/contrib/contrib-form/

--
nosy: +terry.reedy

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



[issue21593] Clarify re.search documentation first match

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since I am 99.999% sure that first is intended, I will change 'a location' to 
'the first location'.

--
assignee: docs@python - terry.reedy
nosy: +terry.reedy
stage:  - needs patch
type:  - enhancement
versions:  -Python 3.1, Python 3.2, Python 3.3

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



[issue21577] Help for ImportError should show a more useful signature.

2014-05-30 Thread Eric Snow

Eric Snow added the comment:

Yeah, I also noticed that about **kwargs, but only a little while later and 
didn't get around to making a note here.  As to ArgumentClinic, I imagine that 
this could be fixed when ModuleType (in Objects/moduleobject.c) gets converted 
to use it.  I don't know too much about the limitations though--maybe that's 
why it wasn't converted already.

--

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



[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-30 Thread Zachary Ware

Zachary Ware added the comment:

Looks like the AMD64 buildbot isn't happy with OpenSSL 1.0.1g: 
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%202.7/builds/1223/steps/compile/logs/stdio

Here's my best stab-in-the-dark guess at fixing what's wrong; I don't have the 
ability to build x64 2.7 handy.

--
Added file: http://bugs.python.org/file35415/224ca86e3919_backport.diff

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



[issue21614] Case sensitivity problem in multiprocessing.

2014-05-30 Thread Colin Davidson

New submission from Colin Davidson:

On windows 7, if a Python app is run (under python 2.7.6) and the invoking 
filename is capitalized differently from the source file itself, a subsequent 
attempt to use the multiprocessing module to fork a process will fail in the 
forking module. This happens because the fopen at line 1559 in import.c (in 
the imp module find_module method) uses the invoking capitalization, rather 
than the file capitalization and fails to open the file.

The traceback gives lines 380 then 489 in forking.py, but as noted, the problem 
is in import.c (or in the Python startup, which could convert the 
capitalization...).

--
components: Interpreter Core, Windows
messages: 219423
nosy: ColinPDavidson
priority: normal
severity: normal
status: open
title: Case sensitivity problem in multiprocessing.
type: crash
versions: Python 2.7

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



[issue21603] IDLE SaveAs drops the extension in the prompted filename

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On Win 7, I also see x.py in the save dialog, both 2.7 and 3.4 as installed.

--
nosy: +terry.reedy

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



[issue21615] Curses bug report for Python 2.7 and Python 3.2

2014-05-30 Thread Richard s. Gordon

New submission from Richard s. Gordon:

Curses bug report for Python 2.7 and Python 3.2

My Python code outputs text properly with xterm and xterm-16color. It does not 
work properly with xterm-88color and xterm-256color (after defining RGB color 
pallet) when run on Python-2.7 and Python-3.2 on Cygwin with Windows 7 Pro, 
Ubuntu Linux 12.04, Mac OS X 10.9.3 and PS-BSD 10.

For text output to xterm-88color and xterm-256color Python generates unique 
colors that are plagued by the wrong color and underline artifacts.

xterm-16color   xterm-16color   
xterm-88color   xterm-256color
==  ==  
==  ===
Region 1cyan on black   cyan on black   
cyan on olive with underlines   cyan on purple with 
underlines
Region 2white on black  white on black  
navy on black   white on orange
Region 3yellow on black yellow on black magenta 
on black with underlinesnavy on black with underlines

Some of my test platform terminals (such as iTerm2 on my iMac desktop system 
running Mac OSX Mavericks 10.9.3) default to xterm-256color and presumably 
already have Python 2.7.5 built for 256 color. I downloaded and built Python 
3.2.2. 

My Python test code works properly with xterm and xterm-16color. Both display 
the wrong colors, some with underlines when run with xterm-88color and 
xterm-256color.

Any solutions or suggestions?

Richard S. Gordon

--
messages: 219425
nosy: eclectic9509
priority: normal
severity: normal
status: open
title: Curses bug report for Python 2.7 and Python 3.2

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



[issue21593] Clarify re.search documentation first match

2014-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f7bb1d73a341 by Terry Jan Reedy in branch '2.7':
Issue #21593: (from StackOverflow) minor doc clarification for re.search.
http://hg.python.org/cpython/rev/f7bb1d73a341

New changeset 6013a112aba0 by Terry Jan Reedy in branch '3.4':
Issue #21593: (from StackOverflow) minor doc clarification for re.search.
http://hg.python.org/cpython/rev/6013a112aba0

--
nosy: +python-dev

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



[issue21573] Clean up turtle.py code formatting

2014-05-30 Thread Lita Cho

Lita Cho added the comment:

Hi Terry,

 is there project link? are any of the mentors core developers, with
  commit rights? or would you need commits from someone like me?

I am not 100% sure. Let me ask Jessica, who is my mentor, and get back to you.

 I have read turtle.py and found that the multiple layers made some 
 things hard to follow. To me, this was a bigger impediment than code
  formatting. You may want to develop an outline of the layer
  structure.

There is no project link to Turtle cleanup specifically. But I can definitely 
try to reorganize the code such that it flows better and it is easier to read. 
I can add that to the list.

 As you may know, Guido generally discourages pure code cleanups and
 prefers that they be done when the code is examined for other 
 purposes. I personally think some changes are safe enough if verified 
 by a second person.

I actually did not know that Guido discourages pure code cleanup. Should I try 
to find a feature to add? Currently, I am doing all the easy stuff, and making 
it pep8 compliant and work through linter. I am also trying to delete some of 
the commented out code.

 I looked for and did not fine test/test_turtle. Did I miss something?
 Turtledemo is a partial substitute, but it might not exercise all 
 turtle functions.

I actually don't see the Turtle tests as well. Should creating unit tests for 
turtle.py be a separate ticket?

I am currently developing off of 3.4. I will try to run my patch through all 
the versions of Python 3 to make sure it is a clean fix.

--

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



[issue21306] PEP 466: backport hmac.compare_digest

2014-05-30 Thread Matthias Urlichs

Matthias Urlichs added the comment:

Currently (Debian's 2.7.7-rc1 package) hmac.compare_digest accepts two 
bytestring arguments, or two Unicode stings, but not one bytestring and one 
unicode.

I don't think that's a good idea.

--
nosy: +smurfix

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



[issue21616] argparse explodes with nargs='*' and a tuple metavar

2014-05-30 Thread Vasilis Vasaitis

Changes by Vasilis Vasaitis vvasai...@gmail.com:


--
versions: +Python 2.7

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



[issue21616] argparse explodes with nargs='*' and a tuple metavar

2014-05-30 Thread Vasilis Vasaitis

New submission from Vasilis Vasaitis:

The title says it all really, but to demostrate: Let's say I'm building a 
program which takes another command as its argument(s) on the command line, to 
execute it in a special way or whatever. The natural way to do this then would 
be something like the following:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs='*')
parser.parse_args()

Which gives the following output with -h:

usage: nargs.py [-h] [cmd [cmd ...]]

positional arguments:
  cmd

optional arguments:
  -h, --help  show this help message and exit

Now, let's say I want to have 'command' printed in the help output, but still 
write the shorter 'cmd' in the code. Naturally I would make use of the metavar 
feature:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs='*', metavar='command')
parser.parse_args()

So now the help output is:

usage: nargs.py [-h] [command [command ...]]

positional arguments:
  command

optional arguments:
  -h, --help  show this help message and exit

That's better, but I don't really want it to say 'command' twice there, it's 
more like a command and then its arguments. So what about a tuple instead?

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs='*', metavar=('command', 'arguments'))
parser.parse_args()

So let's see what happens now with -h:

Traceback (most recent call last):
  File /Users/Vasilis/Sources/Tests/nargs.py, line 6, in module
parser.parse_args()
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1717, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1749, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1955, in _parse_known_args
start_index = consume_optional(start_index)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1895, in consume_optional
take_action(action, args, option_string)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1823, in take_action
action(self, namespace, argument_values, option_string)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1016, in __call__
parser.print_help()
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 2348, in print_help
self._print_message(self.format_help(), file)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 2325, in format_help
formatter.add_arguments(action_group._group_actions)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 272, in add_arguments
self.add_argument(action)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 257, in add_argument
invocations = [get_invocation(action)]
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 535, in _format_action_invocation
metavar, = self._metavar_formatter(action, default)(1)
ValueError: too many values to unpack (expected 1)

Hm, that didn't go very well. Perhaps I can try with a single element in the 
tuple, as the exception seems to suggest:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs='*', metavar=('command',))
parser.parse_args()

Any better?

Traceback (most recent call last):
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1334, in add_argument
self._get_formatter()._format_args(action, None)
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 579, in _format_args
result = '[%s [%s ...]]' % get_metavar(2)
TypeError: not enough arguments for format string

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File /Users/Vasilis/Sources/Tests/nargs.py, line 5, in module
parser.add_argument('cmd', nargs='*', metavar=('command',))
  File 
/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/argparse.py,
 line 1336, in add_argument
raise ValueError(length 

[issue21504] can the subprocess module war using os.wait4 and so return usage?

2014-05-30 Thread donald petravick

donald petravick added the comment:

Ok.  I have a subclass with a copied out - then-modified wait method.
 ¹twill do for now.
I¹m clueless as to what the windows analog of wait4() would be.

On 5/30/14, 3:10 PM, R. David Murray rep...@bugs.python.org wrote:


R. David Murray added the comment:

I think the answer is that if you want that level of control you can't
use communicate, you have to implement what you specifically need.

I'm going to close this as rejected.  It could be reopened if someone can
find a way to propose something that makes sense cross-platform.

--
nosy: +r.david.murray
resolution:  - rejected
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21504
___


--

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



[issue21593] Clarify re.search documentation first match

2014-05-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue1570255] redirected cookies

2014-05-30 Thread Paul Suh

Paul Suh added the comment:

I found a repeatable, public test case: 

http://www.macupdate.com/download/26915/ScreenFlow-4.5.1.dmg

Using urllib2 with the following code leads to a redirect loop: 

#!/usr/bin/python

import urllib2

h = urllib2.HTTPHandler(debuglevel=1)
h2 = urllib2.HTTPSHandler(debuglevel=1)

opener = urllib2.build_opener(h)
opener2 = urllib2.build_opener(h2)
urllib2.install_opener(opener)
urllib2.install_opener(opener2)

request = 
urllib2.Request(url=http://www.macupdate.com/download/26915/ScreenFlow-4.5.1.dmg;)
request.add_header( User-Agent, foo )

url_handle = urllib2.urlopen(request)

--
nosy: +Paul.Suh

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



[issue1191964] asynchronous Subprocess

2014-05-30 Thread akira

akira added the comment:

 Does anyone have questions, comments, or concerns about the patch?

It seems the current API doesn't distinguish between BlockingIOError (temporary 
error), BrokenPipeError (permanent error) and EOF (permanent
non-error condition) -- everything is treated as EOF. Is it intentional?

--

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



[issue21516] pathlib.Path(...).is_dir() crashes on some directories (Windows)

2014-05-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
type: crash - behavior

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



[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-30 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, that *would* explain the lack of comments. I'll upload the missing
patch later today.

--

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



[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-30 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-30 Thread Nick Coghlan

Nick Coghlan added the comment:

Another thing to keep in the back of your minds: one of my goals for PEP
432 is to make it possible to have a fully functional embedded interpreter
up and running *without* configuring the Python level import system. This
is the state the interpreter would be in between the beginning and end of
initialisation.

--

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



[issue21306] PEP 466: backport hmac.compare_digest

2014-05-30 Thread Nick Coghlan

Nick Coghlan added the comment:

That restriction is deliberate (and documented). As a 3.x backport, this
utility inherits some of Python 3's pedantry about requiring explicit
conversions between binary and text data and being consistent as to which
domain you're operating in.

--

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



[issue21617] importlib reload can fail with AttributeError if module removed from sys.path

2014-05-30 Thread Ned Deily

New submission from Ned Deily:

There are significant differences in behavior between Python 2.7, 3.3, and 3.4 
(or current default) when using import reload() while manipulating sys.path.  
These differences cause unexpected behavior in the Run Script command of the 
TextMate 2 editor's Python bundle.  TM2's Python Run Script is designed to 
work with either Python 2 or 2 interpreters.  To do things like capture script 
stdout and stderr, the bundle launches a Python interpreter while prepending a 
directory with a custom sitecustomize module to sys.path.  The TM2 
sitecustomize then removes its directory from sys.path and uses reload to 
attempt to import any existing sitecustomize module.  It then proceeds to do 
its TM2 customizations.  In simplified pseudo-code:

# TM_DIRECTORY/sitecustomize.py
import sys
# remove this copy of sitecustomize from import path
if TM_DIRECTORY in sys.path:
sys.path.remove(TM_DIRECTORY)
try:
import sitecustomize# get module reference
if sys.version_info[0] = 3:
from imp import reload
reload(sitecustomize)   # try to import another
# using altered path
except ImportError:
pass# no other sitecustomize found
# do TM2 customizations here
# ...

this seems to work just fine with Python 2.7.  With Python 3.3 the reload 
causes the originally imported sitecustomize to be used again, regardless of 
whether another sitecustomize exists on sys.path.  For Python 3.4, 1d67eb1df5a9 
for Issue19851 changed reloading.  Now for 3.4 (and default), if another 
sitecustomize exists on sys.path, the behavior is as expected as in 2.7: the 
other sitecustomize is imported by reload and executes.  However, if there is 
no other sitecustomize, 3.4/default now gets an AttributeError exception in 
reload, rather than the expected ImportError.  Enabling PYTHONVERBOSE shows:

  File ./lib/python3.5/importlib/__init__.py, line 148, in reload
_bootstrap._exec(spec, module)
  File frozen importlib._bootstrap, line 1083, in _exec
AttributeError: 'NoneType' object has no attribute 'name'

And this is due to the call in reload() to _bootstrap._find_spec() returning 
None (Lib/importlib/__init__.py:147), presumably since there no longer is a 
sitecustomize.
It looks like the following patch fixes the problem for this case:

diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py
--- a/Lib/importlib/__init__.py
+++ b/Lib/importlib/__init__.py
@@ -145,6 +145,9 @@
 pkgpath = None
 target = module
 spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, target)
+if not spec:
+msg = module {} cannot be reloaded
+raise ImportError(msg.format(name), name=name)
 _bootstrap._exec(spec, module)
 # The module may have replaced itself in sys.modules!
 return sys.modules[name]

I'm not sure if this is a correct or sufficient change in the general case.

http://stackoverflow.com/questions/23962319/error-output-in-textmate-2-using-python-3-4

--
files: test_sitecustomize.sh
messages: 219436
nosy: brett.cannon, eric.snow, ned.deily
priority: normal
severity: normal
status: open
title: importlib reload can fail with AttributeError if module removed from 
sys.path
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35416/test_sitecustomize.sh

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



[issue21592] Make statistics.median run in linear time

2014-05-30 Thread Tim Peters

Tim Peters added the comment:

I suggest this needs a measurable goal, like minimize expected-case time or 
minimize worst-case time.  Use a state of the art implementation isn't a 
measurable goal - it's an abstract wish with no measurable merit on its own ;-)

Note that I wrote the median-of-k code referenced in the first post here (it 
was in reply to David Eppstein).  Even then it was hard to beat sort() + index.

It's harder now, and for an important reason:  Python's _current_ sort can 
exploit many kinds of partial order, and can often complete in linear time.

This makes picking typical input for timing crucial.  If you want to skew it 
to put sort() + index at maximum disadvantage, use only shuffled (random order) 
pairwise-unequal inputs.  But most streams of data do have some kinds of 
partial order (which is why the newer sort() implementation has been so 
successful), and typical is a much tougher thing to capture than shuffled.

--
nosy: +tim.peters

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



[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-30 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
keywords: +patch
Added file: 
http://bugs.python.org/file35417/py27_whats_new_preamble_changes.diff

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



[issue21573] Clean up turtle.py code formatting

2014-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When I re-read the top of the file, I remembered that turtle.py has unique 
issues in relation to code ownership. (I was once told that Gregor had to 
approve any substantive code change.) I asked about that and about code 
cleanups on pydev (thread 'updating turtle.py').

Re your message: I was suggesting 'mapping' the code, not re-structuring it.

Testing: A complete 'unit' test would test each function in each layer. A 
minimal 'unit' test should at least test each top-level function and check 
response on the canvas. Assuming that one can get to tk root and canvas, some 
things should be possible. But I don't know what introspection functions a 
canvas has. An alternative would be to replace the canvas with a mock-canvas 
with extra introspection added. Another alternative would be a human-verified 
test, a turtle script that systematically called every function and said that 
it was doing for a person to verify. Line width: 1, 2, 3, 5, 8, 12 17, 30 
(with a slight pause for each width).

Versions: at most 2.7, 3.4, 3.5. The 3.4 and 3.5 turtle code should be close to 
identical.

--

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



[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Thank you, Serhiy, for the review! Here is the updated patch.

--
Added file: 
http://bugs.python.org/file35418/bytes_parser_dont_close_file_v2.patch

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



[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-05-30 Thread Vajrasky Kok

Changes by Vajrasky Kok sky@speaklikeaking.com:


--
versions: +Python 3.5 -Python 3.4

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-30 Thread Steven Stewart-Gallus

Changes by Steven Stewart-Gallus sstewartgallu...@mylangara.bc.ca:


--
type:  - security
versions: +Python 3.4

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-30 Thread Steven Stewart-Gallus

New submission from Steven Stewart-Gallus:

The sysconf(_SC_OPEN_MAX) approach to closing fds is kind of flawed. It is kind 
of hacky and slow (see http://bugs.python.org/issue1663329). Moreover, this 
approach is incorrect as fds can be inherited from previous processes that have 
had higher resource limits. This is especially important because this is a 
possible security problem. I would recommend using the closefrom system call on 
BSDs or the /dev/fd directory on BSDs and /proc/self/fd on Linux (remember not 
to close fds as you read directory entries from the fd directory as that gives 
weird results because you're concurrently reading and modifying the entries in 
the directory at the same time). A C program that illustrates the problem of 
inheriting fds past lowered resource limits is shown below.

#include errno.h
#include stdlib.h
#include stdio.h
#include string.h
#include sys/time.h
#include sys/resource.h

int main() {
struct rlimit const limit = {
.rlim_cur = 0,
.rlim_max = 0
};
if (-1 == setrlimit(RLIMIT_NOFILE, limit)) {
fprintf(stderr, error: %s\n, strerror(errno));
exit(EXIT_FAILURE);
}

puts(Printing to standard output even though the resource limit is lowered 
past standard output's number!);

return EXIT_SUCCESS;
}

--
messages: 219440
nosy: sstewartgallus
priority: normal
severity: normal
status: open
title: POpen does not close fds when fds have been inherited from a process 
with a higher resource limit

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



[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2014-05-30 Thread Ned Deily

Ned Deily added the comment:

Isn't Modules/Setup used for builtin modules?

One of the better kept secrets of Python is that Modules/Setup can be used for 
building shared modules as well.  I didn't know that until looking into it 
recently as a result of RDM's comment.  See Issue17095.

--
nosy: +ned.deily

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-30 Thread Steven Stewart-Gallus

Steven Stewart-Gallus added the comment:

Okay here's a stub patch that address FreeBSD, NetBSD and Linux. I'm not sure 
how to address the other platforms.

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

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-30 Thread Steven Stewart-Gallus

Steven Stewart-Gallus added the comment:

Oh right! I forgot a possible problem with my proposed patch. It is 
incompatible with Valgrind (see issue 
https://bugs.kde.org/show_bug.cgi?id=331311). Either this patch won't be 
applied, Valgrind compatibility is judged not essential or the Valgrind 
developers will start emulating /proc/self/fd.

--

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



[issue21613] Installer for mac doesn't store the installation location

2014-05-30 Thread Ned Deily

Ned Deily added the comment:

Files are recorded during bundle-style installation, too.  Without spending a 
lot of time looking at it right now, I believe the null location reported is a 
red herring; I think that has to do with packages that allow themselves to be 
installed in arbitrary locations.  The Python installer packages do not allow 
that.  That said, the paths reported by the --files options could be more 
accurate.  I'll see what I can do as part of the conversion to producing flat 
packages.  There are other issues, though.  There are files created by the 
packages' postflight scripts.  In particular, the many .pyc and .pyo files are 
created by compileall during post-installation so these files are not recorded 
as installed.  Thus, you cannot currently depend on the results of --files to 
uninstall all files.  Automated uninstalls have never been supported; it would 
be nice to do.

--
assignee: ronaldoussoren - ned.deily
priority: normal - low
versions: +Python 3.5 -Python 3.2, Python 3.3, Python 3.4

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-30 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +gps, larry

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