[issue1730136] tkFont.__eq__ gives type error

2014-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b379c092253 by Ned Deily in branch '2.7':
Issue #1730136: Fix backported exception name.
http://hg.python.org/cpython/rev/2b379c092253

--

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



[issue22194] access to cdecimal / libmpdec API

2014-08-21 Thread Stefan Behnel

Stefan Behnel added the comment:

 (for the record, the context is that we would like to support decimal objects 
 efficiently in Numba)

Same for Cython, although I guess we wouldn't do more than shipping the 
necessary declarations and (likely) also enable auto-coercion between the 
libmpdec decimal type (struct?) and CPython's decimal type, in the same way 
that we do it for byte strings.

Thus, a public header file with the necessary type checking and 
packing/unpacking C-API functions would be nice and also sufficient for now.

--
nosy: +scoder

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



[issue22238] fractions.gcd results in infinite loop when nan or inf given as parameter.

2014-08-21 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
resolution:  - wont fix
status: open - closed

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



[issue22238] fractions.gcd results in infinite loop when nan or inf given as parameter.

2014-08-21 Thread Mark Dickinson

Mark Dickinson added the comment:

I agreed with Raymond.

--

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



[issue22217] Reprs for zipfile classes

2014-08-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Berker's comments.

--
Added file: http://bugs.python.org/file36426/zipfile_reprs_2.patch

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



[issue21549] Add the members parameter for TarFile.list()

2014-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5875c50e93fe by Serhiy Storchaka in branch 'default':
Issue #21549: Added the members parameter to TarFile.list().
http://hg.python.org/cpython/rev/5875c50e93fe

--
nosy: +python-dev

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



[issue21549] Add the members parameter for TarFile.list()

2014-08-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Berker for the review.

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

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



[issue20797] zipfile.extractall should accept bytes path as parameter

2014-08-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also a discussion at Python-Dev:
http://comments.gmane.org/gmane.comp.python.devel/149048

Looks as there are no need to add bytes path in such high-level API. In any 
case you can call os.fsdecode() on path argument.

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

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



[issue19997] imghdr.what doesn't accept bytes paths

2014-08-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also a discussion at Python-Dev:
http://comments.gmane.org/gmane.comp.python.devel/149048

Looks as there are no need to add bytes path support in such high-level API. In 
any case you can call os.fsdecode() on path argument.

--
status: open - pending

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Akira Li

New submission from Akira Li:

 from datetime import datetime, timezone
   dt = datetime.now(timezone.utc)
   fmt = '%Y-%m-%d %H:%M:%S.%f %Z%z'
   datetime.strptime(dt.strftime(fmt), fmt)
  Traceback (most recent call last):
File stdin, line 1, in module
File /cpython/Lib/_strptime.py, line 500, in _strptime_datetime
  tt, fraction = _strptime(data_string, format)
File /cpython/Lib/_strptime.py, line 337, in _strptime
  (data_string, format))
  ValueError: time data '2014-08-21 11:29:13.537251 UTC+00:00+'
  does not match format '%Y-%m-%d %H:%M:%S.%f %Z%z'

The issue is that dt.strftime('%Z') produces 'UTC+00:00'
(due to timezone.utc.tzname(dt) returning 'UTC+00:00')
instead of 'UTC' that strptime() accepts and %Z examples [1]
in the docs demonstrate.

[1] 
https://docs.python.org/3.4/library/datetime.html#strftime-and-strptime-behavior

--
components: Library (Lib)
messages: 225606
nosy: akira
priority: normal
severity: normal
status: open
title: strftime/strptime round trip fails even for UTC datetime object
type: behavior
versions: Python 3.4, Python 3.5

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



[issue22016] Add a new 'surrogatereplace' output only error handler

2014-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Stephen Turnbull suggested on python-dev that this was a bad idea, and after 
reconsidering the current behaviour in Python 2, I realised that setting 
surrogateescape and letting the terminal deal with the consequences is exactly 
what we want.

What confused me is that ls replaces the unknown characters with question marks 
in the C locale:

$ ls
ニコラス.txt
$ LANG=C ls
.txt


Python 2 passes the bytes through, regardless of locale:

$ python -c import os; print(os.listdir('.')[0])
ニコラス.txt
$ LANG=C python -c import os; print(os.listdir('.')[0])
ニコラス.txt


Current Python 3 gets confused if the C locale is set, as the encoding on 
sys.stdout gets set to ascii, which breaks roundtripping:

$ python3 -c import os; print(os.listdir('.')[0])
ニコラス.txt   
$ LANG=C python3 -c import os; print(os.listdir('.')[0])
Traceback (most recent call last):
  File string, line 1, in module   
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-11: 
ordinal not in range(128)

However, Python 3.5 will already set surrogateescape on sys.stdout by 
default, reproducing the behaviour of *Python 2*, rather than the behaviour of 
ls:
$ LANG=C ~/devel/py3k/python -c import os; print(os.listdir('.')[0])
ニコラス.txt

--
resolution:  - rejected
stage:  - resolved
status: open - closed
type:  - enhancement

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



[issue22194] access to cdecimal / libmpdec API

2014-08-21 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +lemburg

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +belopolsky

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



[issue22240] argparse support for python -m module in help

2014-08-21 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +ncoghlan

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



[issue22240] argparse support for python -m module in help

2014-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

I suspect resolving this will actually need special casing on the argparse side 
- __main__.__spec__ will have the original details for __main__ when executed 
via -m of zipfile/directory execution.

Things to check for:

* __main__.__spec__ is not None indicates a -m invocation
* __main__.__spec__.name will give you the module name that was executed
* if it is exactly __main__ then this is likely zipfile or directory 
execution, and sys.argv[0] will still give the correct name
* if it ends with a .__main__, it is likely package execution, and the last 
segment should be dropped
* otherwise, it is normal module execution

In the latter two cases, sys.executable can be used to figure out what to put 
before the -m (we don't expose the raw C level argv to Python, although there 
is an open RFE to do so somewhere on the tracker).

--
nosy: +bethard

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

This is a duplicate of #15873.

--
components: +Extension Modules
resolution:  - duplicate
status: open - closed
superseder:  - datetime: add ability to parse RFC 3339 dates and times
type: behavior - enhancement
versions:  -Python 3.4

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



[issue22242] Doc fix in the Import section in language reference.

2014-08-21 Thread Jon Poler

New submission from Jon Poler:

It looks like there might be a contradiction in the documentation of import in 
the language reference. In the loading subsection 
https://docs.python.org/dev/reference/import.html#loading, first bulleted list 
of the section, it specifies that if a loader fails, it must remove only the 
failing module from sys.modules, while other side-effect imports by loader will 
stay in sys.modules.

In the next subsection 
https://docs.python.org/dev/reference/import.html#loaders, second bulleted list 
(last bullet), the phrasing is confusing, and possibly contradictory. I believe 
that it meant to reiterate what was said above (see my previous paragraph).

Attached is a potential patch, but if anyone finds that I am interpreting this 
wrong, I'll make adjustments accordingly.

--
assignee: docs@python
components: Documentation
files: import_doc_fix.patch
keywords: patch
messages: 225610
nosy: docs@python, jon.poler
priority: normal
severity: normal
status: open
title: Doc fix in the Import section in language reference.
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36427/import_doc_fix.patch

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



[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-21 Thread Michael Williamson

New submission from Michael Williamson:

In the docs for the try statement [1], part of the grammar is:

try1_stmt ::=  try : suite
   (except [expression [as target]] : suite)+
   [else : suite]
   [finally : suite]

The `target` rule allows any assignable expression (identifier, attributes, 
etc.). However, CPython appears to only allow identifiers as a target. The 
abstract grammar in the ast module [2] appears to confirm this.

[1] https://docs.python.org/3.4/reference/compound_stmts.html#the-try-statement
[2] https://docs.python.org/3.4/library/ast.html#abstract-grammar

--
assignee: docs@python
components: Documentation
messages: 225611
nosy: docs@python, mwilliamson
priority: normal
severity: normal
status: open
title: Documentation on try statement incorrectly implies target of except 
clause can be any assignable expression
versions: Python 3.4, Python 3.5

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



[issue4180] warnings.simplefilter(always) does not make warnings always show up

2014-08-21 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee: exarkun - 
stage: patch review - needs patch

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



[issue22240] argparse support for python -m module in help

2014-08-21 Thread Peter Otten

Changes by Peter Otten __pete...@web.de:


--
nosy: +peter.otten

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



[issue22240] argparse support for python -m module in help

2014-08-21 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +BreamoreBoy, paul.j3

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



[issue22236] Do not use _default_root in Tkinter tests

2014-08-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In updated patch the root windows is created only once per test class.

--
Added file: http://bugs.python.org/file36428/tkinter_no_default_root_2.patch

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



[issue21585] Run Tkinter tests with wantobjects=False

2014-08-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
dependencies: +Do not use _default_root in Tkinter tests

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



[issue21308] PEP 466: backport ssl changes

2014-08-21 Thread Stefan Behnel

Stefan Behnel added the comment:

The current implementation doesn't work with Unicode file paths. Try passing a 
Unicode string e.g. as cafile into context.load_verify_locations(). It calls 
PyString_AsEncodedObject() on it, which then fails with a PyErr_BadArgument() 
on the entry type check.

--
nosy: +scoder

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



[issue21308] PEP 466: backport ssl changes

2014-08-21 Thread Alex Gaynor

Alex Gaynor added the comment:

Thanks for the report, I've filed: http://bugs.python.org/issue22244 to track 
that issue.

--

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



[issue22244] load_verify_locations fails to handle unicode paths on Python 2

2014-08-21 Thread Alex Gaynor

New submission from Alex Gaynor:

Details of the issue are here: http://bugs.python.org/msg225613

I'm not sure what the correct API to use is there, perhaps the encoding can be 
folded into the PyArg_ParseTupleAndKeywords() call.

--
components: Extension Modules
messages: 225614
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
status: open
title: load_verify_locations fails to handle unicode paths on Python 2
versions: Python 2.7

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



[issue22243] Documentation on try statement incorrectly implies target of except clause can be any assignable expression

2014-08-21 Thread Jayanth Koushik

Jayanth Koushik added the comment:

Yes. Seems to be a documentation error. The full grammar specification [1] uses 
'NAME' instead of 'target'.

[1]: https://docs.python.org/3/reference/grammar.html

--
nosy: +jayanthkoushik
type:  - enhancement

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



[issue21585] Run Tkinter tests with wantobjects=False

2014-08-21 Thread Lita Cho

Lita Cho added the comment:

Hi Terry,

I had no idea we were moving away from using test_main. 

So instead, of using support.run_unittest, we should import all the unittest 
from tkinter/test/ and wrap everything with that exec method, setting 
wantobjects=1 and again with wantobjects=0?

Also, do you have an example of a unit test that doesn't use test_main? All the 
unit tests I've seen (tkinter, smtplib, nntplib) all use test_main.



Lita

--

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



[issue22242] Doc fix in the Import section in language reference.

2014-08-21 Thread Ned Deily

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


--
nosy: +eric.snow

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2014-08-21 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue22239] asyncio: nested event loop

2014-08-21 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue4180] warnings.simplefilter(always) does not make warnings always show up

2014-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch implementing an alternate approach, with a version number added 
in the registry dicts. It also reuses Tres' test cases.

Removing 2.7 because at this point we probably don't want to add non-minimal 
changes there (outside of the ssl module, that is :-)).

--
versions:  -Python 2.7
Added file: http://bugs.python.org/file36429/warnings_issue4180.patch

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



[issue4180] warnings.simplefilter(always) does not make warnings always show up

2014-08-21 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage: needs patch - patch review

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



[issue22118] urljoin fails with messy relative URLs

2014-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b116489d31ff by Antoine Pitrou in branch 'default':
Issue #22118: Switch urllib.parse to use RFC 3986 semantics for the resolution 
of relative URLs, rather than RFCs 1808 and 2396.
http://hg.python.org/cpython/rev/b116489d31ff

--
nosy: +python-dev

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



[issue22118] urljoin fails with messy relative URLs

2014-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch is now committed to the future Python 3.5. Thank you very much for 
this contribution!

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

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



[issue2527] Pass a namespace to timeit

2014-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ben, thanks for the patch. Have you signed a contributor's agreement? You can 
find it at https://www.python.org/psf/contrib/contrib-form/

--

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



[issue22245] test_urllib2_localnet prints out error messages

2014-08-21 Thread Antoine Pitrou

New submission from Antoine Pitrou:

I get the following error messages in the test suite:

[1/1] test_urllib2_localnet
test_basic_auth_httperror (test.test_urllib2_localnet.BasicAuthTests) ... 

Exception happened during processing of request from ('127.0.0.1', 44046)
Traceback (most recent call last):
  File /home/antoine/cpython/34/Lib/socketserver.py, line 305, in 
_handle_request_noblock
self.process_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 331, in 
process_request
self.finish_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 344, in 
finish_request
self.RequestHandlerClass(request, client_address, self)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 291, 
in http_server_with_basic_auth_handler
return BasicAuthHandler(*args, **kwargs)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 212, 
in __init__
http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 669, in __init__
self.handle()
  File /home/antoine/cpython/34/Lib/http/server.py, line 398, in handle
self.handle_one_request()
  File /home/antoine/cpython/34/Lib/http/server.py, line 387, in 
handle_one_request
self.wfile.flush() #actually send the response if not already done.
ValueError: I/O operation on closed file.


Exception happened during processing of request from ('127.0.0.1', 44047)
Traceback (most recent call last):
  File /home/antoine/cpython/34/Lib/socketserver.py, line 305, in 
_handle_request_noblock
self.process_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 331, in 
process_request
self.finish_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 344, in 
finish_request
self.RequestHandlerClass(request, client_address, self)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 291, 
in http_server_with_basic_auth_handler
return BasicAuthHandler(*args, **kwargs)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 212, 
in __init__
http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 669, in __init__
self.handle()
  File /home/antoine/cpython/34/Lib/http/server.py, line 398, in handle
self.handle_one_request()
  File /home/antoine/cpython/34/Lib/http/server.py, line 387, in 
handle_one_request
self.wfile.flush() #actually send the response if not already done.
ValueError: I/O operation on closed file.

ok
test_basic_auth_success (test.test_urllib2_localnet.BasicAuthTests) ... 

Exception happened during processing of request from ('127.0.0.1', 60893)
Traceback (most recent call last):
  File /home/antoine/cpython/34/Lib/socketserver.py, line 305, in 
_handle_request_noblock
self.process_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 331, in 
process_request
self.finish_request(request, client_address)
Exception happened during processing of request from ('127.0.0.1', 60894)
Traceback (most recent call last):
  File /home/antoine/cpython/34/Lib/socketserver.py, line 305, in 
_handle_request_noblock
self.process_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 331, in 
process_request
self.finish_request(request, client_address)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 344, in 
finish_request
self.RequestHandlerClass(request, client_address, self)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 291, 
in http_server_with_basic_auth_handler
return BasicAuthHandler(*args, **kwargs)
  File /home/antoine/cpython/34/Lib/test/test_urllib2_localnet.py, line 212, 
in __init__
http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File /home/antoine/cpython/34/Lib/socketserver.py, line 669, in __init__
self.handle()
  File /home/antoine/cpython/34/Lib/http/server.py, line 398, in handle
self.handle_one_request()
  File /home/antoine/cpython/34/Lib/http/server.py, line 387, in 
handle_one_request
self.wfile.flush() #actually send the response if not already done.
ValueError: I/O operation on closed file.

ok


It seems they were introduced by 30e8a8f22a2a.

--
components: Tests
messages: 225622
nosy: orsenthil, pitrou
priority: normal
severity: normal
status: open
title: test_urllib2_localnet prints out error messages
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Akira Li

Akira Li added the comment:

I don't see, how it is a duplicate. Everything works if pytz.utc (.tzname() == 
'UTC')
is used instead of timezone.utc (.tzname() == 'UTC+00:00').
Everything works if UTC class from the example [1] 
in the tzinfo docs is used.
It only breaks due to the weird timezone.utc.tzname() return value.

[1] https://docs.python.org/3.4/library/datetime.html#datetime.tzinfo.fromutc

Why does datetime.now(timezone.utc).strftime('%Z')
(via timezone.utc.tzname(dt)) produce 'UTC+00:00'?
How is it motivated?
Is it documented somewhere?
Can datetime.now(timezone.utc).strftime('%Z') be changed to return 'UTC'?

--

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



[issue22246] add strptime(s, '%s')

2014-08-21 Thread Akira Li

New submission from Akira Li:

issue12750 makes strftime('%s') portable. For symmetry,
datetime.strptime(s, '%s') could be enabled to return local time as an
aware (to avoid loosing info) datetime object for a given integer
(seconds since the Epoch) timestamp string.

I've uploaded a prototype patch with a draft implementation, docs, and
tests.

--
components: Library (Lib)
files: draft-strptime-%s.diff
keywords: patch
messages: 225624
nosy: akira
priority: normal
severity: normal
status: open
title: add strptime(s, '%s')
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36430/draft-strptime-%s.diff

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



[issue22246] add strptime(s, '%s')

2014-08-21 Thread Akira Li

Changes by Akira Li 4kir4...@gmail.com:


Removed file: http://bugs.python.org/file36430/draft-strptime-%s.diff

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



[issue22246] add strptime(s, '%s')

2014-08-21 Thread Akira Li

Changes by Akira Li 4kir4...@gmail.com:


Added file: http://bugs.python.org/file36431/draft-strptime-%s.diff

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I see.  I thought you were complaining about %z format not supporting 00:00 
as in 

 from datetime import *
 datetime.strptime(00:00,%z)
Traceback (most recent call last):
 ..
ValueError: time data '00:00' does not match format '%z'

but your issue is that %Z does not parse UTC+00:00 as in

 datetime.strptime(UTC+00:00x,%Zx)
Traceback (most recent call last):
 ..
ValueError: time data 'UTC+00:00x' does not match format '%Zx'

The name produced by timezone when no name is explicitly specified is 
documented:

https://docs.python.org/3.4/library/datetime.html#datetime.timezone.tzname


 Can datetime.now(timezone.utc).strftime('%Z') be changed to return 'UTC'?

I think it can.  I am surprised this did not come up in #5094 where UTC±hh:mm 
syntax was discussed.

The change would be trivial - just supply explicit name to utc singleton.

Please ask on Python-Dev if anyone would object.

--
keywords: +easy
resolution: duplicate - 
status: closed - open
superseder: datetime: add ability to parse RFC 3339 dates and times - 

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

See also http://bugs.python.org/issue5094#msg106476.

It looks like providing 'UTC' as the name of utc singleton was part of my 
original proposal.  I have no recollection on why it was not implemented that 
way.

--
nosy: +brett.cannon, mark.dickinson

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



[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts

Ben Roberts added the comment:

I did sign one right after I submitted the patch.  Takes a few days for the 
asterisks to propagate I guess :)

--

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



[issue15125] argparse: positional arguments containing - in name not handled well

2014-08-21 Thread paul j3

paul j3 added the comment:

It still needs a documentation patch.  

And if the documentation was clearer, would sfllaw's patch still be needed?

--

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



[issue21308] PEP 466: backport ssl changes

2014-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for getting this in, folks!

As Alex suggests, we can file any identified regressions as new issues.

--

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Akira,

I see that you participated in the original discussion (msg107608).  We settled 
on str(timezone.utc) == 'UTC+00:00' and this was clearly a deliberate choice.  
I don't think we can revisit this now, but we can probably make strptime smart 
enough to parse UTC±hh:mm with %Z format code.

--

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



[issue13540] Document the Action API in argparse

2014-08-21 Thread paul j3

paul j3 added the comment:

The formatting of the descriptor line for this class is not consistent with the 
classes for this module.

It lacks 'class'.

It is all bold

In contrast 

class argparse.ArgumentParser(prog=None, ...

uses bold for only the name.

--

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



[issue22237] sorted() docs should state that the sort is stable

2014-08-21 Thread Martin Panter

Martin Panter added the comment:

It looks like a fork of that how-to is actually part of the documentation: 
https://docs.python.org/release/3.4.0/howto/sorting.html. Perhaps the two 
should be linked better.

If “sorted” is indeed meant to be stable, that makes the docstring for the 
“heapsort” function 
https://docs.python.org/release/3.4.0/library/heapq.html#basic-examples 
invalid. That function is not stable, for example: heapsort((0, 0, False, 0)) 
- [0, False, 0, 0].

Also, the how-to implicitly guarantees that only less-than (__lt__) is required 
for comparison. This is already documented for “list.sort”, but it might be 
good to add that guarantee to the “sorted” reference. Maybe also clarify if it 
applies (or not) to other sorting and comparison routines (e.g. heapq, bisect, 
min, max), though maybe that is straying off scope for this bug.

--
nosy: +vadmium

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



[issue2527] Pass a namespace to timeit

2014-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, good. The patch looks fine to me, except that you should add 
versionchanged tags in the documentation for the added parameter.

--
stage: needs patch - patch review

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



[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter

Martin Panter added the comment:

NNTPConnectError does still seem a slightly awkward name. I would go for 
NNTPConnectionError instead, but I’m also happy to put my bikeshed paint away 
let this patch be applied as is :)

Handling of NNTPTemporaryError with a code of 400 is similar to handling of 
this EOFError. But I guess there is not much you could do with the API unless 
you made a separate subclass for 400 errors (like all the new 
EnvironmentError/OSError subclasses), which would be rather severe. My current 
workaround looks a bit like this:

try:
[_, info] = nntp.body(...)
except NNTPTemporaryError as err:
[code, *msg] = err.response.split(maxsplit=1)
if code != 400:
raise
except EOFError:  # Or NNTPConnect(ion)Error
msg = ()
else:
break  # Handle successful response
[msg] = msg or (Server shut down connection,)
# Handle connection shutdown by server

--

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



[issue21585] Run Tkinter tests with wantobjects=False

2014-08-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The current test/test_*.py example file in the docs intentionally does not 
contain test_main.
https://docs.python.org/3/library/test.html#writing-unit-tests-for-the-test-package
The next section explaining that test.regrtest runs 
unittest.TestLoader.loadTestsFromModule if test_main does not exist. I believed 
support.run_unittest.

I never used test_main in test_idle.py, Grep test/test_*.py for 'test_main' or 
its absence to count others. Or search all issues for 'unittest discovery' for 
conversions.  For instance: #18258 made this change to the five 
test_codecmaps*.py files.
http://bugs.python.org/file30644/test_codecmaps_discovery.diff
-def test_main():
-support.run_unittest(__name__)
-
 if __name__ == __main__:
-test_main()
+support.use_resources = ['urlfetch']
+unittest.main()

This all said, running all tests in a file with two different values of an 
attribute of the tested module is an exceptional case.  Zach, what do you think?

--

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



[issue19997] imghdr.what doesn't accept bytes paths

2014-08-21 Thread Claudiu Popa

Claudiu Popa added the comment:

Right, I've read the thread you posted and I agree. My use cases aren't strong 
enough and it's enough for me to call os.fsdecode.

--
resolution:  - wont fix
stage: patch review - resolved
status: pending - closed

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



[issue22247] More incomplete module.__all__ lists

2014-08-21 Thread Martin Panter

New submission from Martin Panter:

The nntplib.NNTPError exception is documented, but missing from __all__. I ran 
across another one the other day, but I can’t remember what it was now.

Is there a practical way to automatically test for some of these, perhaps by 
scanning the documentation for function and class definitions? These sort of 
bugs keep popping up, as people adding new features, exceptions, etc, forget to 
append them to __all__.

Another more radical idea: a decorator something like this might avoid 
copy-paste errors and make unexported APIs stand out more:

def public(api):
sys.modules[api.__module__].__all__.append(api.__name__)
return api

__all__ = list()
@public
def public_function(): ...
@public
class PublicClass: ...

Related:
* Issue 18554: os.__all__
* Issue 22191: warnings.__all__

--
components: Library (Lib)
messages: 225637
nosy: vadmium
priority: normal
severity: normal
status: open
title: More incomplete module.__all__ lists
versions: Python 3.4

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



[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter

Martin Panter added the comment:

Some more points:

* I suggest adding something like this to the documentation:

exception nntplib.NNTPConnect[ion]Error
  Exception raised when the server unexpectedly shuts down the connection.

* The tests should use BytesIO rather than StringIO. Other than that, I think 
monkey-patching the file attribute in the tests is fine; that’s probably the 
way I would do it!

* The new exception should be added to __all__.

--

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



[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts

Ben Roberts added the comment:

Ah yes.

New patch improves the docs.

--
Added file: http://bugs.python.org/file36432/timeit_global_arg_v2.patch

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



[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter

Martin Panter added the comment:

PPS: Documentation should probably have the “New in version 3.5” tag as well

--

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



[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Lita Cho

Lita Cho added the comment:

Thank yo so much, Martin! I will incorporate these changes and add them soon!

--

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



[issue21585] Run Tkinter tests with wantobjects=False

2014-08-21 Thread Zachary Ware

Zachary Ware added the comment:

I've been thinking on this for a while, and haven't come up with a solution 
that I like.  I haven't had a chance to look at #22236 yet, but I suspect it 
will help immensely.

Also, I have a work-in-progress patch for rearranging the tkinter tests into a 
test.test_tkinter subpackage.  At this point, I'm not sure if that will make 
this issue easier or harder to resolve, but it does take care of not using 
test_main for the tkinter tests.  I'm hoping to have some time to get that 
patch into a submittable state tomorrow, then have a good look at how it, 
#22236, and this issue interact.  Anyone who wants a look at where I'm going 
with the test_tkinter subpackage before I get it submitted, it's at 
http://hg.python.org/sandbox/zware/log/mv_pkg_tests/ (see the changes by doing 
hg diff --git -r default -r mv_pkg_tests Lib/test/test_tkinter; there are 
changes to other test packages in that branch as well that are missed by 
specifying Lib/test/test_tkinter).

--

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



[issue12750] datetime.strftime('%s') should respect tzinfo

2014-08-21 Thread Akira Li

Akira Li added the comment:

issue22246 discusses the reverse: strptime('12345', '%s')

--

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



[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Akira Li

Akira Li added the comment:

 I see that you participated in the original discussion (msg107608).
 We settled on str(timezone.utc) == 'UTC+00:00' and this was clearly a
 deliberate choice.  I don't think we can revisit this now, but we can
 probably make strptime smart enough to parse UTC±hh:mm with %Z format
 code.

I see it advocates either 'UTC' or '+00:00' ('-00:00' is semantically
different) i.e., mutually exclusive options: UTC is special enough
(it is a real timezone that is widely used) to warrant 'UTC' name. On
the other hand '+HH:MM' (%:z) (note: *without* 'UTC' prefix) is easily
extendable for a fixed-offset tzinfo family and it allows to use %Z to
generate/parse date/time strings with rfc3339-like utc offset and the
numeric tzname() would stress that a fixed-offset datetime.timezone
doesn't represent real zoneinfo timezone.

UTC+HH:MM is neither here nor there: it is easily confusable with
deprecated :GMT+H, Etc/GMT-H zoneinfo timezones (I'm not sure about
the signs) and it doesn't help generate/parse isoformat() strings
e.g., it confuses dateutil.parser therefore *strftime('... %Z') with
datetime.timezone should be avoided.*

pytz is *the* module that exposes zoneinfo (*the* timezone database)
to Python. Its tzname() methods (and therefore strftime('%Z')) produce
timezone abbreviations such as 'UTC', 'EST', 'CST' (all %Z examples in
datetime docs) that may be ambiguous (the same abbreviation can be
used by several timezones) and in reverse -- a single timezone can use
several abbreviations for the same purpose (non-DST related). I find
'%Z%z' to be easier to read at a glance compared to %z along (imagine
you look at dozens timestamps at once e.g., in a log collected from
several machines).

--

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



[issue22024] Add to shutil the ability to wait until files are definitely deleted

2014-08-21 Thread Sean McCully

Sean McCully added the comment:

Is this closer to what Zachary.Ware suggested, patch implements a 
wait_until_deleted method in C Api using inotify for Linux/FreeBSD.

--
nosy: +seanmccully
Added file: http://bugs.python.org/file36433/issue22024.patch

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



[issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags

2014-08-21 Thread Shlomi Fish

Shlomi Fish added the comment:

Here is the new output of the make test with Python-3.4.1 :

shlomif@telaviv1:~$ uname -a
Linux telaviv1.shlomifish.org 3.15.6-desktop-1.mga5 #1 SMP Wed Jul 23 22:28:50 
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

You may wish to install a Mageia Linux x86-64 Cauldron Virtual Machine instead 
of depending of waiting for me to do all that. See:

http://www.joelonsoftware.com/articles/fog43.html

Namely:  9. Do you use the best tools money can buy?.

--
Added file: http://bugs.python.org/file36434/python-3.4.1-make-test.txt

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