[issue23051] multiprocessing.pool methods imap() and imap_unordered() cause deadlock

2014-12-15 Thread Ned Deily

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


--
nosy: +sbt

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



[issue23052] python2.7.9 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

2014-12-15 Thread binbjz

binbjz added the comment:

I have added code to disable global verification on phsphere. It works well. 
thanks.

--
resolution: not a bug - 
type: behavior - crash

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



[issue22706] Idle extension configuration and key bindings

2014-12-15 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Need some clarification on this issue. I tried changing the cfgBindings for 
FormatParagraph. It creates a new key-set and writes the changes to user 
config-keys.cfg in ~/.idlerc(the keybindings). Any changes made to 
FormatParagraph in extension dialog(the [X]) are written to the user 
config-extensions.cfg file in ~/.idlerc.

Have I understood the issue correctly in saying that the desired outcome is 
both [X] and [X_cfgBindings] write to config-extensions.cfg in ~/.idlerc?

--

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



[issue23015] Improve test_uuid

2014-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f972583c7c4f by Serhiy Storchaka in branch '2.7':
Issue #23015: Improved testing of the uuid module.
https://hg.python.org/cpython/rev/f972583c7c4f

New changeset 3551dc8af54e by Serhiy Storchaka in branch '3.4':
Issue #23015: Improved testing of the uuid module.
https://hg.python.org/cpython/rev/3551dc8af54e

New changeset fd1d994afe52 by Serhiy Storchaka in branch 'default':
Issue #23015: Improved testing of the uuid module.
https://hg.python.org/cpython/rev/fd1d994afe52

--
nosy: +python-dev

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



[issue22777] Test pickling with all protocols

2014-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9927781e457f by Serhiy Storchaka in branch '2.7':
Issue #22777: Test pickling with all protocols.
https://hg.python.org/cpython/rev/9927781e457f

New changeset 04c9fffde184 by Serhiy Storchaka in branch '3.4':
Issue #22777: Test pickling with all protocols.
https://hg.python.org/cpython/rev/04c9fffde184

New changeset 77fc30182dc2 by Serhiy Storchaka in branch 'default':
Issue #22777: Test pickling with all protocols.
https://hg.python.org/cpython/rev/77fc30182dc2

--
nosy: +python-dev

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



[issue23015] Improve test_uuid

2014-12-15 Thread Serhiy Storchaka

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


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

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



[issue22777] Test pickling with all protocols

2014-12-15 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved

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



[issue22818] Deprecate splitting on possible zero-width re patterns

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I there are no objections I'm going to commit the patch soon.

--
assignee:  - serhiy.storchaka

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Serhiy Storchaka

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


--
keywords: +needs review

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



[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--
keywords: +needs review

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



[issue18473] some objects pickled by Python 3.x are not unpicklable in Python 2.x because of incorrect REVERSE_IMPORT_MAPPING

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--
keywords: +needs review

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



[issue22783] Pickle: use NEWOBJ instead of NEWOBJ_EX if possible

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--
keywords: +needs review

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



[issue15513] Correct __sizeof__ support for pickle

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--
keywords: +needs review

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



[issue21279] str.translate documentation incomplete

2014-12-15 Thread John Posner

John Posner added the comment:

Kindly ignore message #2 on the Rietveld page (sorry for the channel noise). 
Here's my suggested revision:

Return a copy of the string *str* in which each character has been mapped 
through the given translation *table*. The table must be a subscriptable 
object, for instance a list or dictionary; when subscripted (indexed) by a 
Unicode ordinal (an integer in range(1048576)), the table object can:

* return a Unicode ordinal or a string, to map the character to one or more 
other characters.

* return None, to delete the character from the return string.

* raise a LookupError (possibly an instance of subclass IndexError or 
KeyError), to map the character to itself.

--
nosy: +jjposner

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



[issue23053] test_urllib2_localnet fails without ssl

2014-12-15 Thread jan matejek

New submission from jan matejek:

The pep 476 commit to Python 2.7 [1] adds unconditional import ssl to 
test_urllib2_localnet.py. This causes the test to fail with an ImportError if 
ssl module is not built.

Note that like 5 lines later, ssl is imported conditionally, and all the 
relevant tests are configured to skip if ssl is not present. So to fix this, 
all that is needed is to remove the import ssl line. Attached patch does just 
that.

[1] https://hg.python.org/cpython/rev/fb83916c3ea1

--
components: Tests
files: python-2.7-urllib2-localnet-ssl.patch
keywords: patch
messages: 232663
nosy: matejcik
priority: normal
severity: normal
status: open
title: test_urllib2_localnet fails without ssl
type: behavior
versions: Python 2.7
Added file: 
http://bugs.python.org/file37454/python-2.7-urllib2-localnet-ssl.patch

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



[issue23054] ConnectionError: ('Connection aborted.', BadStatusLine(''''))

2014-12-15 Thread Joe Cabrera

New submission from Joe Cabrera:

ConnectionError: ('Connection aborted.', BadStatusLine())

This error can also occur on Linux and Windows, a more descriptive error 
messages would be useful for people trying to debug their code.

--
assignee: docs@python
components: Documentation
messages: 232664
nosy: docs@python, joecabrera
priority: normal
severity: normal
status: open
title: ConnectionError: ('Connection aborted.', BadStatusLine())
type: behavior
versions: Python 2.7

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



[issue23053] test_urllib2_localnet fails without ssl

2014-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ebe8917189a3 by Benjamin Peterson in branch '2.7':
remove extra ssl imports (closes #23053)
https://hg.python.org/cpython/rev/ebe8917189a3

New changeset 1da9e9eaeae8 by Benjamin Peterson in branch '3.4':
remove extra ssl imports (closes #23053)
https://hg.python.org/cpython/rev/1da9e9eaeae8

New changeset 8214675f6385 by Benjamin Peterson in branch 'default':
merge 3.4 (#23053)
https://hg.python.org/cpython/rev/8214675f6385

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

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



[issue23054] ConnectionError: ('Connection aborted.', BadStatusLine(''''))

2014-12-15 Thread R. David Murray

R. David Murray added the comment:

I think you made a mistake in your copy and paste or retyping of that line, 
since it is not valid python syntax.

What is not explicit about it?  It is telling you there was a bad status line, 
and what the bad status line contents was.  (Used to be you couldn't tell, when 
the badness of the status line was that it was empty, that that was what the 
error message was saying, but I'm pretty sure we fixed that so that it shows an 
empty status line as an empty string in the message).

--
nosy: +r.david.murray

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



[issue23054] ConnectionError: ('Connection aborted.', BadStatusLine(''''))

2014-12-15 Thread R. David Murray

R. David Murray added the comment:

Perhaps part of your problem is that you are not getting the string 
representation of the error message.  Is that because of your code, or is this 
representation something the stdlib is generating?

--

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread STINNER Victor

STINNER Victor added the comment:

 These character encodings are legacy, but are still used.

Do you have an idea of how many users still have documents stored or exchanged 
using these encodings? The patch is not trivial, the legacy japanese codecs are 
complex and so error prone :-/

For previous requests to add new codecs, we closed issues as wontfix and we 
suggested to share the codecs at the Python Cheeseshop (PyPI). Here it's more 
complex because C code is modified to implement the new encodings.

$ diffstat issue23050_13417.diff 
 Doc/library/codecs.rst   |   16 
 Lib/encodings/aliases.py |   26 
 Lib/test/test_codecencodings_iso2022.py  |   59 +
 Lib/test/test_codecs.py  |2 
 Lib/test/test_multibytecodec.py  |6 
 Lib/test/test_xml_etree.py   |4 
 Modules/cjkcodecs/_codecs_iso2022.c  |  718 ++-
 Modules/cjkcodecs/_codecs_jp.c   |  305 +
 Modules/cjkcodecs/mappings_jp.h  |  950 ++-
 Modules/cjkcodecs/multibytecodec.h   |   11 
 Python/importlib.h   |  860 ++--
 b/Lib/encodings/cp50220.py   |   39 +
 b/Lib/encodings/cp50221.py   |   39 +
 b/Lib/encodings/cp50222.py   |   39 +
 b/Lib/encodings/cp51932.py   |   39 +
 b/Lib/encodings/eucjp_ms.py  |   39 +
 b/Lib/encodings/iso2022_jp_ms.py |   39 +
 b/Lib/test/cjkencodings/cp50220-utf8.txt |   30 
 b/Lib/test/cjkencodings/cp50220.txt  |   30 
 b/Modules/cjkcodecs/mappings_cp50220_k.h |   31 +
 20 files changed, 2452 insertions(+), 830 deletions(-)

--
nosy: +haypo

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



[issue22875] asyncio: call_soon() documentation unclear on timing

2014-12-15 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Martin for your change, I commited it.

--
resolution:  - fixed
status: open - closed

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



[issue22875] asyncio: call_soon() documentation unclear on timing

2014-12-15 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forgot to mention the issue number in my commit.

changeset:   93893:a59fed8c710b
branch:  3.4
parent:  93891:1da9e9eaeae8
user:Victor Stinner victor.stin...@gmail.com
date:Mon Dec 15 17:50:55 2014 +0100
files:   Doc/library/asyncio-eventloop.rst
description:
asyncio doc: call_soon() does not call immediatly the callback. Patch written
by Martin Panter.

--

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-15 Thread Demian Brecht

Demian Brecht added the comment:

+ loewis as he's listed as the xmlrpc expert

If you're worried about the number of lines, turn the function into a lambda:

proxy = ServerProxy('http://example.com/gateway/', transport=Transport(
connection_factory=lambda h: HTTPConnection(h, timeout=42)))

I think that the problem with the way that you're looking at the problem:'just 
only for adding timeout', when what you're fundamentally after is to modify 
the attribute of an object two levels removed by composition.

I /do/ agree that this is slightly more complex than simply setting a timeout 
parameter, but I also think that it's actually quite a bit more flexible and 
practically useful.

Borrowing from PEP20: There should be one-- and preferably only one --obvious 
way to do it.. Having a timeout at the top level ServerProxy object introduces 
ambiguity and therefore doesn't conform. Should the connection_factory concept 
be used, having a timeout parameter at the Transport level also introduces 
ambiguity. Setting the timeout through a custom HTTPConnection instantiated 
through connection_factory is an obvious way to do it (especially if 
documented) and is marginally more code.

If you /only/ care about the timeout and really don't want to be bothered with 
the connection_factory, you can always set the global socket timeout for the 
given request with:

socket.setdefaulttimeout([timeout])

--

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



[issue22875] asyncio: call_soon() documentation unclear on timing

2014-12-15 Thread STINNER Victor

STINNER Victor added the comment:

FYI I added a new test to the aiotest project (test suite for asyncio), for 
this issue:
https://bitbucket.org/haypo/aiotest/commits/17dd11fc2f4bafad623f940b1a33a3b8b0d39ccd

--

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Guido van Rossum

New submission from Guido van Rossum:

Fix as reported by Guido Vranken on secur...@python.org, with minimal test by 
me.

Needs:

- review
- port to 3.2--3.5

Questions:

- Does my test case cover all changed code?

--
assignee: gvanrossum
files: vranken.diff
keywords: needs review, patch
messages: 232673
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: PyUnicode_FromFormatV crasher
type: crash
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37455/vranken.diff

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread Tetsuya Morimoto

Tetsuya Morimoto added the comment:

 These character encodings are legacy, but are still used.

 Do you have an idea of how many users still have documents stored or 
 exchanged using these encodings?

Hmm, I guess iso-2022-jp codec is still default charset of MUA (Mail
User Agent) on Japanese Windows platform. But I'm not sure how many so
I'll investigate, wait a few days.

 The patch is not trivial, the legacy japanese codecs are complex and so error 
 prone :-/

Ya, this patch has some refactoring. However, existing tests have
passed and adding encoding codecs wouldn't affect other codecs
basically. Why do you think it's error plone?

 For previous requests to add new codecs, we closed issues as wontfix and we 
 suggested to share the codecs at the Python Cheeseshop (PyPI). Here it's more 
 complex because C code is modified to implement the new encodings.

Could you show me previous requests? I can understand C code modifying
is higher cost to review. However, we have codec tests and it wouldn't
affect other codecs, I think.

--

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



[issue23056] tarfile raises an exception when reading an empty tar in streaming mode

2014-12-15 Thread Gregory P. Smith

New submission from Gregory P. Smith:

$ cat test.py EOF
import tarfile
import sys

with tarfile.open(sys.argv[1], mode=r|*) as f:
  while True:
info = f.next()
if not info:
  break
EOF
$ tar cf test.tar -T /dev/null
$ python2.7 test.py test.tar
Traceback (most recent call last):
  File test.py, line 6, in module
info = f.next()
  File /usr/lib/python2.7/tarfile.py, line 2319, in next
self.fileobj.seek(self.offset)
  File /usr/lib/python2.7/tarfile.py, line 555, in seek
raise StreamError(seeking backwards is not allowed)
tarfile.StreamError: seeking backwards is not allowed
$ python3.4 test.py test.tar
Traceback (most recent call last):
  File test.py, line 6, in module
info = f.next()
  File /usr/lib/python3.4/tarfile.py, line 2244, in next
self.fileobj.seek(self.offset)
  File /usr/lib/python3.4/tarfile.py, line 518, in seek
raise StreamError(seeking backwards is not allowed)
tarfile.StreamError: seeking backwards is not allowed

I have reconfirmed that the above still happens using a top of tree 2.7.9+ 
build.

--
components: Library (Lib)
messages: 232675
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: tarfile raises an exception when reading an empty tar in streaming mode
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue23041] csv needs more quoting rules

2014-12-15 Thread Samwyse

Samwyse added the comment:

Yes, it's based on a real-world need.  I work for a Fortune 500 company and we 
have an internal tool that exports CSV files using what I've described as the 
QUOTE_NOTNULL rules.  I need to create similar files for re-importation.  Right 
now, I have to post-process the output of my Python program to get it right.  I 
added in the QUOTE_STRINGS rule for completeness.  I think these two new rules 
would be useful for anyone wanting to create sparse CSV files.

--

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



[issue23041] csv needs more quoting rules

2014-12-15 Thread Skip Montanaro

Skip Montanaro added the comment:

If I understand correctly, your software needs to distinguish between

# wrote [foo, , 42, None] with quote_all in effect
foo,,42,

and

# wrote [foo, None, 42, ] with quote_nonnull in effect
foo,,42,

so you in effect want to transmit some type information through a CSV file?

--

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



[issue23057] asyncio loop on Windows should stop on keyboard interrupt

2014-12-15 Thread Andrew Svetlov

New submission from Andrew Svetlov:

See 
http://stackoverflow.com/questions/27480967/why-does-the-asyncios-event-loop-suppress-the-keyboardinterrupt-on-windows
 for details

--
components: asyncio
messages: 232678
nosy: asvetlov, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio loop on Windows should stop on keyboard interrupt
type: behavior
versions: Python 3.4, Python 3.5

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



[issue23058] argparse silently ignores arguments

2014-12-15 Thread Rémi Rampin

New submission from Rémi Rampin:

This works correctly on Python 3.4.

On Python 2.7, argparse seems to completely and silently ignore arguments in 
some conditions, for instance this setup will cause --verbose to be ignored on 
the main parser:

options = argparse.ArgumentParser(add_help=False)
options.add_argument('-v', '--verbose', action='store_true')
parser = argparse.ArgumentParser(parents=[options])
subparsers = parser.add_subparsers()
parser_cmd = subparsers.add_parser('cmd', parents=[options])

Full runnable example here: 
http://paste.pound-python.org/show/XfVVhdJHSPISXLP1lASd/

Might or might not be related to #9351, workarounds welcome.

--
components: Library (Lib)
messages: 232679
nosy: remram
priority: normal
severity: normal
status: open
title: argparse silently ignores arguments
type: behavior
versions: Python 2.7

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



[issue23059] sort misc help topics in cmd

2014-12-15 Thread Samwyse

New submission from Samwyse:

I've discovered that do_help method of cmd.Cmd prints the documented and 
undocumented commands in sorted order, but does not sort the miscellaneous 
topics.  This would be an easy fix, just change 
self.print_topics(self.misc_header, help.keys(),15,80) to use 
sorted(help.keys()).

--
components: Library (Lib)
messages: 232680
nosy: samwyse
priority: normal
severity: normal
status: open
title: sort misc help topics in cmd
versions: Python 3.5

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



[issue23041] csv needs more quoting rules

2014-12-15 Thread Samwyse

Samwyse added the comment:

Skip, I don't have any visibility into how the Java program I'm feeding data 
into works, I'm just trying to replicate the csv files that it exports as 
accurately as possible.  It has several other quirks, but I can replicate all 
of them using Dialects; this is the only feature I can't.  The files I'm 
looking at have quoted strings and numbers, but there aren't any quoted empty 
strings.  I'm using a DictWriter to create similar csv files, where missing 
keys are treated as values of None, so I'd like those printed without quotes.  
If we also want to print empty strings without quotes, that wouldn't impact me 
at all.

Besides my selfish needs, this could be useful to anyone wanting to reduce the 
save of csv files that have lots of empty fields, but wants to quote all 
non-empty values.  This may be an empty set, I don't know.

--

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



[issue23058] argparse silently ignores arguments

2014-12-15 Thread Rémi Rampin

Rémi Rampin added the comment:

Interestingly, this worked before my upgrade 2.7.8 - 2.7.9.

--

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Berker Peksag

Berker Peksag added the comment:

The second patch raises RuntimeError: maximum recursion depth exceeded if the 
target file is exist.

  File /home/berker/projects/cpython/default/Tools/freeze/bkfile.py, line 
18, in close
f.close()
RuntimeError: maximum recursion depth exceeded

--
nosy: +berker.peksag

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread STINNER Victor

STINNER Victor added the comment:

I refactored some parts of CJK codecs for performances, after the PEP 393
was implemented. A blocker point was that these codecs have very few tests.
Not for valid data but for invalid data. It may be a little bit better. I
tried to write a test for each path in if/else, to test all cases, in the
codecs that I modified.

By error prone, it mean that it's easy to introduce a bug or a regressio,
since the code is complex and almost nobody maintains it.

I'm not stongly opposed to any change. I'm just trying to understand the
context.

--

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Another traditional issue with Japanese codecs is that people have different 
opinions on what the encoding should do. It may be that when we release the 
codec, somebody comes up and says that the codec is incorrect, and it should do 
something different for some code points, citing some other applications which 
he considers right. In particular for the Microsoft ones, people may claim that 
some version of Windows did things differently.

Now, for this set, the ones that got registered with IANA sound ok (in the 
sense that it is our bug if they fail to conform to the IANA spec, and IANA's 
fault if they fail to do what users expect). For the other ones, I wonder 
whether there is some official source that can be consulted for correctness.

On a different note: why do you claim that the code is written by Perky? (it's 
not you, is it?)

--

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



[issue22783] Pickle: use NEWOBJ instead of NEWOBJ_EX if possible

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Some examples (with issue19858 for protocol 4 optimization).

Unpatched:

 len(pickle.dumps([P(12, 34) for i in range(1000)], 3))
17258
 len(pickletools.optimize(pickle.dumps([P(12, 34) for i in range(1000)], 3)))
8018
 len(pickle.dumps([P(i, -i) for i in range(1000)], 3))
20999
 len(pickletools.optimize(pickle.dumps([P(i, -i) for i in range(1000)], 3)))
11759

 len(pickle.dumps([P(12, 34) for i in range(1000)], 4))
12031
 len(pickletools.optimize(pickle.dumps([P(12, 34) for i in range(1000)], 4)))
9028
 len(pickle.dumps([P(i, -i) for i in range(1000)], 4))
15772
 len(pickletools.optimize(pickle.dumps([P(i, -i) for i in range(1000)], 4)))
12769

Patched:

 len(pickle.dumps([P(12, 34) for i in range(1000)], 4))
10031
 len(pickletools.optimize(pickle.dumps([P(12, 34) for i in range(1000)], 4)))
8028
 len(pickle.dumps([P(i, -i) for i in range(1000)], 4))
13772
 len(pickletools.optimize(pickle.dumps([P(i, -i) for i in range(1000)], 4)))
11769

--

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Berker. Updated patch fixes recursion issue.

--
Added file: http://bugs.python.org/file37456/bkfile3.patch

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



[issue21740] doctest doesn't allow duck-typing callables

2014-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 12ef799a9a51 by Zachary Ware in branch 'default':
Issue #21740: Fix module name in NEWS entry.
https://hg.python.org/cpython/rev/12ef799a9a51

--

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have added a couple of comments. Here is a patch which fixes found bugs.

3.4+ is not affected by this bug. 3.2 looks same as 2.7 and is affected, 3.3 
uses different code but at first glance looks affected too. Is it worth to fix 
this bug in 3.2 and 3.3?

--
components: +Interpreter Core
nosy: +georg.brandl, haypo, serhiy.storchaka
stage:  - patch review
versions:  -Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37457/issue23055-2.7.patch

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Thank you for digging into this! I'd say go ahead and update 3.2 and 3.3 too -- 
these are in security-fix-only mode meaning that we only fix security issues 
and don't do actual releases. But we still do security bugfixes: for 3.2 until 
February 2016 (PEP 392), for 3.3 until September 2017 (PEP 398).

I don't think that this warrants changing the 2.7 bugfix release schedule.

--
versions: +Python 3.2, Python 3.3

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Guido Vranken

Guido Vranken added the comment:

Serhiy Storchaka: good call on changing my 'n += (width + precision)  20 ? 20 
: (width + precision);' into 'if (width  precision) width = precision;', I 
didn't realize that sprintf's space requirement entails using the largest of 
the two instead of adding the two together.

I noticed the apparently pointless width calculation in 'step 1' but decided 
not to touch it -- good that it's removed now though.

I will start doing more debugging based on this new patch now to ensure that 
the bug is gone now.

On a more design-related note, for the sake of readability and stability, I'd 
personally opt for implementing toned-down custom sprintf-like function that 
does exactly what it needs to do and nothing more, since a function like this 
one requires perfect alignment with the underlying sprintf() in terms of 
functionality, at the possible expense of stability and integrity issues like 
we see here. For instance, width and precision are currently overflowable, 
resulting in either a minus sign appearing in the resulant format string given 
to sprintf() (width and precision are signed integers), or completely 
overflowing it (ie. (uint64_t)18446744073709551617 == 1 ). Considering the 
latter example, how do we know sprintf uses the same logic?

Guido

--
nosy: +Guido

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Guido Vranken

Guido Vranken added the comment:

I'd also like to add that, although I agree with Guido van Rossum that the 
likelihood of even triggering this bug in a general programming context is low, 
there are two buffer overflows at play here (one stack-based and one 
heap-based), and given an adversary's control over the format and vargs 
parameters, I'd there is a reasonable likelihood of exploiting it to execute 
arbitrary code, since the one controlling the parameters has some control as to 
which bytes end up where outside buffer boundaries.

--

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



[issue23004] mock_open() should allow reading binary data

2014-12-15 Thread Aaron Hill

Aaron Hill added the comment:

I've fixed the issues you pointed out.

Is there a better way than uploading a new patch file to make changes?

--
Added file: 
http://bugs.python.org/file37458/mock-open-allow-binary-without-coerce-fixup.patch

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



[issue23055] PyUnicode_FromFormatV crasher

2014-12-15 Thread Guido van Rossum

Guido van Rossum added the comment:

I'd be much worried about attack scenarios if this function was part of the 
standard library. But it's not -- the stdlib's % operator uses completely 
different code. The most common use case is probably to generate error messages 
from extension modules -- and there the format is almost always a literal in 
the C code. (An adversary who can load a C extension doesn't need this exploit.)

--

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



[issue21279] str.translate documentation incomplete

2014-12-15 Thread Martin Panter

Martin Panter added the comment:

I’m largely happy with any of these revisions. If I end up doing another patch 
I would omit the *str* (it is a class name, not a parameter). Also I would omit 
the range(2^20) claim. Unless people think it is important; why is it different 
to sys.maxunicode + 1 = 0x11?

--

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



[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client

2014-12-15 Thread Martin Panter

Martin Panter added the comment:

There could be potential for breaking compatibility if people are intentionally 
sending values with folded lines (obsoleted by the new HTTP RFC).

Perhaps the same error should be raised for values that cannot be encoded in 
Latin-1? Also, maybe most control characters should trigger an error, not just 
CR and LF. Apart from line folding, the HTTP RFC only allows visible ASCII 
characters, spaces and tabs, and obsolete non-ASCII chars = 0x80.

--
nosy: +vadmium

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



[issue23060] Assert fails in multiprocessing.heap.Arena.__setstate__ on Windows

2014-12-15 Thread Steve Dower

New submission from Steve Dower:

Currently, the implementation of __setstate__ at Lib/multiprocessing/heap.py:54 
looks like this:

def __setstate__(self, state):
self.size, self.name = self._state = state
self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
assert _winapi.GetLastError() == _winapi.ERROR_ALREADY_EXISTS

This assertion can fail when the assignment to buffer triggers memory 
[re]allocation, which could clear the last error result. So far, this fails 
reliably on debug builds using VS 2015 (which causes some tests to timeout when 
all of the child processes fail to start), but could also fail in threaded code 
at any time.

I don't know why release builds or builds with VS 2010 did not trigger this, 
but I would speculate that either VS 2015 is using a different API to allocate 
memory or Windows 8.1 has changed the behaviour of an API. Whether a function 
resets the last error code is deliberately unspecified 
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms679360(v=vs.85).aspx 
- some functions set the last-error code to 0 on success and others do not).

In my opinion, the assertion should just be removed.

A hack that appears to work currently is to add self.buffer = None before the 
existing assignment (to pre-expand self.__dict__ and avoid the allocation).

If the assertion is important, someone may want to add a parameter to mmap() to 
require that the memory-mapped file already exists and throws otherwise, but I 
am not volunteering to do this.

--
components: Windows
messages: 232697
nosy: jnoller, sbt, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Assert fails in multiprocessing.heap.Arena.__setstate__ on Windows
versions: Python 3.5

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



[issue23060] Assert fails in multiprocessing.heap.Arena.__setstate__ on Windows

2014-12-15 Thread Steve Dower

Steve Dower added the comment:

A buildbot failure due to this can be seen here: 
http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/183/steps/test/logs/stdio

--

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



[issue23059] cmd module should sort misc help topics

2014-12-15 Thread Samwyse

Changes by Samwyse samw...@gmail.com:


--
title: sort misc help topics in cmd - cmd module should sort misc help topics

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-15 Thread Eric Snow

Eric Snow added the comment:

Thanks for bringing this up, Brett.  The goal and approach seem good to me.  
Did you bring this up during the PEP 451 discussions?  If so, sorry I missed 
it.  You've made a good point.  And hopefully this will encourage people to 
subclass Loader more. :)

--

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-15 Thread Eric Snow

Eric Snow added the comment:

At some point should we make create_module (and exec_module) always required?  
In other words, when should would drop the legacy loader support?  I expect the 
answer is Python 4. :)

--

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



[issue19698] Implement _imp.exec_builtin and exec_dynamic

2014-12-15 Thread Eric Snow

Eric Snow added the comment:

Same here.

--

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread Tetsuya Morimoto

Tetsuya Morimoto added the comment:

 By error prone, it mean that it's easy to introduce a bug or a regression,
 since the code is complex and almost nobody maintains it.

Indeed. Actually, I encountered some faults when I migrated original
patch. The character encoding is a kind of specialty area. This patch
is written by Masayuki Moriyama, who is an expert of character
encoding and he have been contributed to various communities for a
long time. Also, he helps me to migrate original patch(for Python
2.4.3) to Python 3.5. You can see commit log he fixed some bugs.
https://bitbucket.org/t2y/cpython/commits/all

 I'm not stongly opposed to any change. I'm just trying to understand the
 context.

Thanks. I'll help it by explaining the context.

--

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



[issue21720] TypeError: Item in ``from list'' not a string message

2014-12-15 Thread Ben Finney

Ben Finney added the comment:

Is there room for a better resolution: fix the API so that Unicode objects are 
accepted in the ‘fromlist’ items?

--
nosy: +bignose

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



[issue21720] TypeError: Item in ``from list'' not a string message

2014-12-15 Thread Ben Finney

Changes by Ben Finney ben+pyt...@benfinney.id.au:


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



[issue23004] mock_open() should allow reading binary data

2014-12-15 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the updated patch, looks good to me. If you haven't already read it, 
the patch workflow is here: https://docs.python.org/devguide/patch.html and is 
the only workflow currently available.

--

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



[issue23004] mock_open() should allow reading binary data

2014-12-15 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - patch review

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-15 Thread Andrej A Antonov

Andrej A Antonov added the comment:

@demian.brecht , socket.setdefaulttimeout([timeout]) -- it is bad practice, 
because setting this global varible we may spoil other cases. example TCP 
keepalive [ s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, true) ]

and global variables is bad practice for other things.

and again -- compare what shorter (and what more clear):

proxy = ServerProxy('http://example.com/gateway/', transport=Transport(
connection_factory=lambda h: HTTPConnection(h, timeout=42)))

or

proxy = ServerProxy('http://example.com/gateway/', timeout=42)

 There should be one-- and preferably only one --obvious way to do it.. 
 Having a timeout at the top level ServerProxy object introduces ambiguity and 
 therefore doesn't conform

if you NOT point timeout in RPC-client -- you program will freeze or will 
maked resource leak (with small probability).

RPC-client and timeout -- these two concepts are inseparable!

you are allowed *NOT_using* timeout in RPC-client -- *ONLY* in *localhost* 
operations!

--

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



[issue23050] Add Japanese legacy encodings

2014-12-15 Thread Tetsuya Morimoto

Tetsuya Morimoto added the comment:

 Another traditional issue with Japanese codecs is that people have different 
 opinions on what the encoding should do. It may be that when we release the 
 codec, somebody comes up and says that the codec is incorrect, and it should 
 do something different for some code points, citing some other applications 
 which he considers right. In particular for the Microsoft ones, people may 
 claim that some version of Windows did things differently.

In regard to e-mail encoding, Japanese should use utf-8, then it
resolves most problems. However, for historical reason or
compatibility reason, it's different even today. I don't think these
legacy codecs are needed for individual application, but we sometimes
encounter an encoding issue when an application collaborates to
external system like e-mail.

 Now, for this set, the ones that got registered with IANA sound ok (in the 
 sense that it is our bug if they fail to conform to the IANA spec, and IANA's 
 fault if they fail to do what users expect). For the other ones, I wonder 
 whether there is some official source that can be consulted for correctness.

Exactly. Now, I'm finding euc-jp-ms and iso-2022-jp-ms spec in
English. Of course, there's a voluntary document in Japanese as
follows.
http://www.wdic.org/w/WDIC/eucJP-ms
http://www.wdic.org/w/WDIC/ISO-2022-JP-MS

I may agree with dropping character encoding which is difficult to
find official source.

 On a different note: why do you claim that the code is written by Perky? 
 (it's not you, is it?)

Right! Because the credit belongs to him. I'm an assistant.

--

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



[issue22733] MSVC ffi_prep_args doesn't handle 64-bit arguments properly

2014-12-15 Thread Steve Dower

Steve Dower added the comment:

This patch also resolves this test issue:

[ 68/390/2] test_ttk_textonly
test test_ttk_textonly crashed -- Traceback (most recent call last):
  File D:\...\lib\test\regrtest.py, line 1280, in runtest_inner
test_runner()
  File D:\...\lib\test\test_ttk_textonly.py, line 14, in test_main
*runtktests.get_tests(gui=False, packages=['test_ttk']))
  File D:\...\lib\tkinter\test\runtktests.py, line 65, in get_tests
for module in get_tests_modules(gui=gui, packages=packages):
  File D:\...\lib\tkinter\test\runtktests.py, line 50, in get_tests_modules
tkinter.test)
  File D:\...\lib\importlib\__init__.py, line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File frozen importlib._bootstrap, line 2208, in _gcd_import
  File frozen importlib._bootstrap, line 2191, in _find_and_load
  File frozen importlib._bootstrap, line 2180, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 1149, in _load_unlocked
  File frozen importlib._bootstrap, line 1420, in exec_module
  File frozen importlib._bootstrap, line 321, in _call_with_frames_removed
  File D:\...\lib\tkinter\test\test_ttk\test_extensions.py, line 8, in 
module
requires('gui')
  File D:\...\lib\test\support\__init__.py, line 492, in requires
if resource == 'gui' and not _is_gui_available():
  File D:\...\lib\test\support\__init__.py, line 436, in _is_gui_available
raise ctypes.WinError()
OSError: [WinError 0] The operation completed successfully.


I'm not entirely sure when/if I should just commit the fix without any reviews, 
but this issue needs to be fixed, so eventually I'll probably just do it :)

--

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



[issue23061] Update pep8 to specify explicitly 'module level' imports at top of file

2014-12-15 Thread Ian Lee

New submission from Ian Lee:

Minor update pep8 to specify explicitly that Imports at top of file refers 
specifically to module level imports, per input from Nick Coghlan @ 
https://github.com/jcrocholl/pep8/pull/304#issuecomment-66939162

--
assignee: docs@python
components: Documentation
files: pep-0008.patch
keywords: patch
messages: 232708
nosy: IanLee1521, docs@python, ncoghlan
priority: normal
severity: normal
status: open
title: Update pep8 to specify explicitly 'module level' imports at top of file
type: enhancement
Added file: http://bugs.python.org/file37459/pep-0008.patch

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-15 Thread Andrej A Antonov

Andrej A Antonov added the comment:

ok, let's go to other side of this problem:

question: why default transport (xmlrpc.client.Transport()) is not setting 
value of timeout?``

answer: because *unknown* which value need to using by default.

in various cases programmer need various timeout. default value of timeout for 
default transport -- what may be this number?

may be value 300 for timeout of default transport (xmlrpc.client.Transport()) 
may be normal in *most_cases*. but this will brake legacy soft that using 
socket.setdefaulttimeout(...)

--

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



[issue22980] C extension naming doesn't take bitness into account

2014-12-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f70c16189876 by Steve Dower in branch 'default':
#22980 Adds platform and version tags to .pyd files
https://hg.python.org/cpython/rev/f70c16189876

--
nosy: +python-dev

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



[issue22980] C extension naming doesn't take bitness into account

2014-12-15 Thread Steve Dower

Steve Dower added the comment:

Nobody seemed too bothered by it, so I committed a slightly simpler change that 
only includes the most specific tag (that is, .cp35-win32.pyd or .pyd). We 
can always add another tag easily enough if it seems useful, or roll this 
change back if it was a mistake.

Now, let's stop talking about Windows and get back to the original discussion :)

--

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



[issue23062] test_argparse --version test cases

2014-12-15 Thread Martin Panter

New submission from Martin Panter:

In Lib/test/test_argparse.py:

class TestHelpVersionOptional(HelpTestCase):
Test that the --version argument can be suppressed help messages

Assuming that the docstring means something like “. . . can be suppressed _in_ 
help messages”, the test is wrong, because the --version option is present in 
the expected output. Maybe it is missing a help=SUPPRESS option? Otherwise it 
seems this test class would be largely redundant with TestHelpVersionAction.

It also looks like the “version” attribute of the test classes is not used.

--
components: Tests
messages: 232712
nosy: vadmium
priority: normal
severity: normal
status: open
title: test_argparse --version test cases
versions: Python 3.5

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



[issue22733] MSVC ffi_prep_args doesn't handle 64-bit arguments properly

2014-12-15 Thread Zachary Ware

Zachary Ware added the comment:

I don't know near enough to comment on this one.  If you feel confident in it, 
I'd say go ahead.

--

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



[issue23062] test_argparse --version test cases

2014-12-15 Thread Berker Peksag

Berker Peksag added the comment:

I think that your analysis is correct. Also, looks like the original test is 
problematic: 
https://code.google.com/p/argparse/source/browse/test/test_argparse.py#3710

Here is a patch to fix the test.

--
keywords: +patch
nosy: +berker.peksag, bethard, paul.j3
stage:  - patch review
type:  - behavior
versions: +Python 3.4
Added file: http://bugs.python.org/file37460/issue23062.diff

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



[issue9694] argparse required arguments displayed under optional arguments

2014-12-15 Thread Martin Panter

Martin Panter added the comment:

Here is much larger patch in the spirit of Ryan’s, that fixes the 
documentation, adjusts the tests, and some of the internal comments and 
variable names in the source code as well. However if some changes are too 
controversial, I am happy to simplify it to (say) Ryan’s patch plus the minimum 
test fixes.

--
versions: +Python 3.5
Added file: http://bugs.python.org/file37461/option-internal.patch

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



[issue22945] Ctypes inconsistent between Linux and OS X

2014-12-15 Thread Ned Deily

Ned Deily added the comment:

Thanks, eryksun.  Any objections to closing this issue?

--

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



[issue22912] urlretreive locks up in 2.7.8

2014-12-15 Thread Ned Deily

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


--
nosy: +orsenthil -ned.deily

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



[issue22672] float arguments in scientific notation not supported by argparse

2014-12-15 Thread Ned Deily

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


--
nosy:  -ned.deily

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



[issue22706] Idle extension configuration and key bindings

2014-12-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When I alter an *extension* key binding (in the keys page of idle pref dialog), 
the change shows up in .idlerc/config-extensions.cfg, not config-keys.cfg.  For 
instance,

[ZoomHeight_cfgBindings]
zoom-height = Control-Alt-Key-space

If I also disable zoom-height, the following appears in a separate part of the 
same file.

[XoomHeight]
enable=False

For me, the two blocks are already in the same file.  The same is true for 
FormatParagraph.  I intended this issue to be about bringing them together in 
the file, with the [X] block first.  You seem to be saying that the current 
behavior is different on linux.  Since FormatParagraph is still special (see 
#20577), try ZoomHeight also.

--

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-15 Thread Demian Brecht

Demian Brecht added the comment:

  socket.setdefaulttimeout([timeout]) -- it is bad practice

I'm not really arguing this. It solves the problem, but definitely not in the 
best of ways. My point in referencing setdefaulttimeout is that if /all/ you 
care about is the timeout and you're horribly opposed to using an API as I 
suggested, you still have the option of using setdefaulttimeout. To be clear, 
it's not something that I'd advocate.

 because setting this global varible we may spoil other cases. example TCP 
 keepalive [s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, true) ]

I'm afraid you've somewhat lost me here. Calling setdefaulttimeout simply sets 
the value of defaulttimeout in socketmodule.c, which newly created sockets use 
as their default value until explicitly overridden via settimeout().

 and again -- compare what shorter (and what more clear):

Sure, your example is clear for this /specific/ use case. To illustrate my 
point about ambiguity though, it's unclear what the behaviour should be here 
based on your patch:

proxy = ServerProxy('http://example.com/gateway/', timeout=42, 
transport=Transport(2))

Should the value in the Transport instance be used or the one in the 
ServerProxy parameter list? It's not obvious and therefore not a sound decision 
from an API design standpoint.

Ignoring my suggestion of a connection_factory altogether, limiting the timeout 
to the Transport class is a little more sane and doesn't risk ambiguity:

proxy = ServerProxy('http://example.com/gateway/', 
transport=Transport(timeout=2))

Should my suggestion be tossed out, I do think that this is the most sane path 
to go down.


Now, re-introducing my thoughts on a connection factory (which I still believe 
is /much/ more flexible and extensible than simply passing in a timeout 
parameter for the reasons I previously mentioned), should the timeout parameter 
still be accepted at the Transport level, you run into the same level of 
ambiguity:

transport = Transport(timeout=2, connection_factory=lambda h: 
HTTPConnection(h, timeout=42))

So now the argument in my mind becomes: Should the connection attributes be 
assignable through Transport instantiation or should the user have 
accessibility to create their own instance of a connection class that adheres 
to the expected API and pass that in? To me, the flexibility and benefits of 
the latter far outweighs the additional complexity:

transport = Transport(timeout=2)
transport = Transport(connection_factory=lambda h: HTTPConnection(h, 
timeout=42))


 if you NOT point timeout in RPC-client -- you program will freeze or will 
 maked resource leak (with small probability).

Assuming a lack of concurrency, your program will indeed freeze until the 
system timeout has been reached. I'm not sure about a leak. If you have an 
example of such a case, it would likely be a good candidate for a new issue.


 answer: because *unknown* which value need to using by default.

No, the default should be set to socket._GLOBAL_DEFAULT_TIMEOUT (the same 
default used by HTTPConnection). When unset, the timeout on the socket is 
unspecified resulting in a value of -1, which then defaults to the 
system-specific timeout.


Hopefully I've clarified things a little better. Of course, that doesn't mean 
that you'll agree, in which case we'll just have to agree to disagree :)

--

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



[issue23056] tarfile raises an exception when reading an empty tar in streaming mode

2014-12-15 Thread Serhiy Storchaka

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


--
nosy: +larry, lars.gustaebel, serhiy.storchaka

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-15 Thread Andrej A Antonov

Andrej A Antonov added the comment:

 if you NOT point timeout in RPC-client -- you program will freeze or will 
 maked resource leak (with small probability).

 Assuming a lack of concurrency, your program will indeed freeze until the 
 system timeout has been reached. I'm not sure about a leak. If you have an 
 example of such a case, it would likely be a good candidate for a new issue.

I do not know how behavior in Microsoft Windows...

in GNU/Linux system timeout has been reached -- means that  system timeout 
will *never* reached.

you may easy to test this (to make this test -- we need using: 
client-computer and network-router-computer):




step 1. run next code on client-computer (GNU/Linux):

$ python3
 from xmlrpc.client import ServerProxy
 server = ServerProxy(http://betty.userland.com;)
 for _ in range(100): print(server.examples.getStateName(41))

step 2: to broke network in network-router-computer.

step 3: wait some minutes. example 60 minutes.

step 4: to repear netework in network-router-computer.

step 5: we will see, that program on client-computer will freeze *forever*. 
system timeout will *never* reached. even after some days -- system timeout 
will not reached. :-)



 it would likely be a good candidate for a new issue.

yes, may be we need new issue-ticket?

--

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



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-15 Thread Marc Abramowitz

New submission from Marc Abramowitz:

`python setup.py check --restructuredtext --strict --metadata` fails with:

warning: check: Could not finish the parsing.

if the RST document uses `code` or `code-block` directives.

This is annoying because the document is valid, but it appears to be invalid
and confuses people. For example, see
https://github.com/ionelmc/pytest-benchmark/pull/4#issuecomment-66940307

How to reproduce this bug
-

Clone a repo that has a `README.rst` with `code-block` directives in it. E.g.:

$ git clone g...@github.com:ionelmc/pytest-benchmark.git
$ cd pytest-benchmark
$ git checkout ab0b08f6fccb06a7909905a8409f8faa8b01e0d8

   Observe that it has code-blocks in it:

   $ grep 'code-block' README.rst
   .. code-block:: python
   .. code-block:: python

Observe that RST document is valid, according to `rst2html.py`:

   $ rst2html.py --halt=1 README.rst  README.html  echo RST was OK.
   RST was OK.

   $ head -n 3 README.html
   ?xml version=1.0 encoding=utf-8 ?
   !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
   html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en

Observe that `python setup.py check --restructuredtext --strict --metadata` 
fails:

$ python setup.py check --restructuredtext --strict --metadata
running check
warning: check: Could not finish the parsing.

error: Please correct your package.

$ echo $?
1

**What was expected**: `python setup.py check --restructuredtext --strict
--metadata` should succeed with no warnings, just as `rst2html.py did`, because
`README.rst` is a valid RST document.

**What actually happened**: `python setup.py check --restructuredtext --strict
--metadata` prints a warning and an error and fails, unlike `rst2html.py`

The error is coming from here:
https://github.com/python/cpython/blob/master/Lib/distutils/command/check.py#L142

It's happening because of this line:
https://github.com/python/cpython/blob/master/Lib/distutils/command/check.py#L125

:::python
settings = frontend.OptionParser().get_default_values()

If this is changed to:

:::python
settings = frontend.OptionParser(components=(Parser,)).get_default_values()

then things work much better (this is how `tools/quicktest.py` in docutils does 
it for example -- see 
https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py#l196)

The attached patch prevents the failure from happening and also adds more 
information to the error when things go south.

--
components: Distutils
hgrepos: 286
messages: 232720
nosy: Marc.Abramowitz, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: `python setup.py check --restructuredtext --strict --metadata` fails 
with: `warning: check: Could not finish the parsing.` if the RST document uses 
code or code-block directives.
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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