[issue25651] Confusing output for TestCase.subTest(0)

2015-11-21 Thread Nan Wu

Nan Wu added the comment:

Made it check against None explicitly. My concern is if [] is passed in, if 
will show [[]]. But this case should be rare.

--
keywords: +patch
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41115/subtest_msg_check_against_None.patch

___
Python tracker 

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



[issue25690] Replacement for unittest.mock.mock_open

2015-11-21 Thread R. David Murray

R. David Murray added the comment:

Thanks for the submission. I haven't looked at this in detail, but the fact 
that you are changing existing unit tests indicates there is probably a 
backward compatibility problem with your patch.  Also if you are adding 
features I'd expect there to be doc changes, which would make it easier to 
understand what you are proposing.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

Nick, your scenario seems to behave no differently with and without the patch:

Traceback (most recent call last):
  File "", line 2, in 
__main__.MainError

--

___
Python tracker 

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



[issue1927] raw_input behavior incorrect if readline not enabled

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

The input() implementation is a bit like this:

def input(prompt):
if stdin and stdout are the original file descriptors, and are terminals:
return PyOS_Readline(sys.stdin, sys.stdout, prompt)
else:
sys.stdout.write(prompt)  # Writes to stdout
return sys.stdin.readline()

def PyOS_StdioReadline(stdin, stdout, prompt):
'''Default implementation of PyOS_Readline()'''
sys.stderr.write(prompt)  # Writes to stderr
return stdin.readline()

def call_readline(stdin, stdout, prompt):
'''Implementation of PyOS_Readline() in the "readline" module'''
rl_instream = stdin
rl_outstream = stdout  # Readline writes to stdout
return readline_until_enter_or_signal(prompt)

It looks like PyOS_StdioReadline() has always written to stderr. The stdin and 
stdout parameters of PyOS_Readline() were added later, in revision dc4a0336a2a3.

I think the changes to myreadline.c will also affect the interactive 
interpreter prompt. But we have Issue 12869 open to change that to stdout, so 
maybe the change is okay.

Since input() should no longer depend on any instance of stderr, perhaps the 
check for “lost sys.stderr” should also be removed.

It may be worth applying any changes in myreadline.c to the independent version 
in pgenmain.c as well, just for consistency.

--

___
Python tracker 

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



[issue25680] Selector.select() hangs when there is nothing to select

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

I would expect it to hang (until the timeout expired) of no files are added. If 
it returns an empty list, that should mean the timeout expired.

I guess Mac uses KqueueSelector. I would certainly expect SelectSelector to 
hang. Maybe the underlying kqueue implementation behaves differently though. 
Perhaps Python should handle this as a special case in the selectors module?

--
nosy: +martin.panter

___
Python tracker 

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



[issue25643] Python tokenizer rewriting

2015-11-21 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Serhiy,

Just of your information but I think you know that, the tests pass ;-)

[398/399] test_multiprocessing_spawn (138 sec) -- running: test_tools
(108 sec)
[399/399] test_tools (121 sec)
385 tests OK.
3 tests altered the execution environment:
test___all__ test_site test_warnings
11 tests skipped:
test_devpoll test_kqueue test_msilib test_ossaudiodev
test_startfile test_tix test_tk test_ttk_guionly test_winreg
test_winsound test_zipfile64

But I am interested by this part of CPython, I am not an expert in
lexing and parsing but how can I help you ? I am a novice in this
domain.

Stephane

--

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-11-21 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I applied the recommendation of SilentGhost for this issue.

Need review

Thank you

--
Added file: http://bugs.python.org/file41119/issue25485-4.patch

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-21 Thread Larry Hastings

Changes by Larry Hastings :


--
priority: release blocker -> normal

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-21 Thread Larry Hastings

Larry Hastings added the comment:

The "release blocker" priority level is inappropriate for nice-to-have 
features.  Quoting PEP 101, the how-to-make-a-Python-release guide:

release blocker - Stops the release dead in its tracks.  You may
  not make any release with any open release
  blocker bugs.

While I'd like to see this fixed too, I'm not holding up the release for it.

--
nosy: +larry

___
Python tracker 

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



[issue25624] shutil.make_archive makes invalid directory entries

2015-11-21 Thread Dingyuan Wang

Dingyuan Wang added the comment:

Yes, patching zipfile is enough. I wrote a test using `unzip -t` to check the 
zip. ZipFile.testzip can't detect this kind of error because 
zlib.decompressobj(-15) will decode b'' to b'' without errors.

--
Added file: http://bugs.python.org/file41120/storedirectory_test.patch

___
Python tracker 

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



[issue19687] Fixes for elementtree integer overflow

2015-11-21 Thread Eli Bendersky

Eli Bendersky added the comment:

Serhiy, I'm truly sorry but for this and other issues you pinged -- I currently 
have zero bandwidth to invest in this. Feel free to ask around on pydev if 
there are other folks interested in reviewing patches and decisions w.r.t the 
etree module. I'm fine with your judgement otherwise.

--

___
Python tracker 

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



[issue25692] input function outputs prompt to stderr

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

This has been discovered before: Issue 1927, with a simple patch. The choice 
between stdout and stderr seems to be rather complicated, so the patch may need 
a bit more work.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> closed
superseder:  -> raw_input behavior incorrect if readline not enabled

___
Python tracker 

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



[issue25689] ftplib docs language fix

2015-11-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 74111e62a76c by Martin Panter in branch '3.4':
Issue #25689: Fix language in ftplib and nntplib docs
https://hg.python.org/cpython/rev/74111e62a76c

New changeset 2fa12e53e8f3 by Martin Panter in branch '3.5':
Issue #25689: Merge ftplib and nntplib docs from 3.4 into 3.5
https://hg.python.org/cpython/rev/2fa12e53e8f3

New changeset b99a30383bd5 by Martin Panter in branch 'default':
Issue #25689: Merge ftplib and nntplib docs from 3.5
https://hg.python.org/cpython/rev/b99a30383bd5

--
nosy: +python-dev

___
Python tracker 

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



[issue25689] ftplib docs language fix

2015-11-21 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25689] ftplib docs language fix

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patch, I will commit it.

I also noticed the same problem in nntplib. And I think the sentence works even 
better starting as “The FTP class supports . . .”.

--
nosy: +martin.panter

___
Python tracker 

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



[issue12869] PyOS_StdioReadline is printing the prompt on stderr

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

Actually Issue 1927 has a simple patch which should change this to stdout. I 
haven’t tested, the code looks like that patch will not use a redirected 
sys.stdout, so it would match not using a redirected sys.stdin.

--

___
Python tracker 

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



[issue25643] Python tokenizer rewriting

2015-11-21 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue25688] File leak in ElementTree.iterparse()

2015-11-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

ElementTree.iterparse() can leak internally open file in case of error. 
Proposed patch fixes the leak.

--
components: Library (Lib)
files: etree_iterparse_leak.patch
keywords: patch
messages: 255051
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: File leak in ElementTree.iterparse()
type: resource usage
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file4/etree_iterparse_leak.patch

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 80f6f77a7cc3 by Martin Panter in branch '3.5':
Issue #25626: Change zlib to accept Py_ssize_t and cap to UINT_MAX
https://hg.python.org/cpython/rev/80f6f77a7cc3

New changeset afa1b6cd77a5 by Martin Panter in branch 'default':
Issue #25626: Merge zlib fix from 3.5
https://hg.python.org/cpython/rev/afa1b6cd77a5

New changeset 5117f0b3be09 by Martin Panter in branch 'default':
Issue #25626: Add news to 3.6 section
https://hg.python.org/cpython/rev/5117f0b3be09

--
nosy: +python-dev

___
Python tracker 

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



[issue25686] Don't use distutils in test_shutil

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Stéphane for your review.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7

___
Python tracker 

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



[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch optimizes iterparse(). Now it is only 33% slower than in 2.7 
(was 2.6 times slower).

--
components: +Extension Modules, Library (Lib), XML
keywords: +patch
nosy: +eli.bendersky, scoder
stage:  -> patch review
type:  -> performance
versions: +Python 3.6
Added file: http://bugs.python.org/file41110/etree_iterparse.patch

___
Python tracker 

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



[issue25624] shutil.make_archive makes invalid directory entries

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you add a test Dingyuan? You can take test_zipfile_vs_zip in test_shutil 
as an example.

The patch changes both shutil and zipfile. Aren't only changes to zipfile 
needed?

--
stage: needs patch -> test needed

___
Python tracker 

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



[issue1062277] Pickle breakage with reduction of recursive structures

2015-11-21 Thread Davis Herring

Davis Herring added the comment:

Re msg110868: it's impossible to resolve a __reduce__ loop that involves only 
immutable intermediate objects (including none at all):

class Direct:
  def __reduce__(self): return id,(self,) # obviously impossible
class Indirect:
  # Can't create either the new object or the tuple first!
  def __reduce__(self): return id,((self,),)

With pre-existing mutable objects, the same trick as for tuples certainly could 
be applied:

class Mutable:
  def __init__(self): self.bracketed=[self]
  # Create list, REDUCE, then populate list
  def __reduce__(self): return id,(self.bracketed,)

The way an analog to the tuple implementation would deal with this would be 
something like

id   # the dummy "constructor" in this example
[]   # empty list, memoized immediately as, say, #5
id   # try again to store the Mutable
@5   # fetch from memo
T1   # make singleton tuple
R# reduce (have now succeeded in "making" the Mutable as, say, #20)
APP  # to the list
T1   # finish the first __reduce__ attempt
POP  # abandon it, since the object has been created
POP  # abandon the "id" as well
@20  # fetch the previous answer

If the list were created directly in __reduce__, you'd still recurse infinitely 
trying to create each new list object.  On the other hand, even complicated 
cases like this should work:

class Switch:
  def __reduce__(self): return id,(self.lst,)
a=Switch(); b=Switch()
a.list=[b,a]; b.list=[a,b]

where the pickling of, say, a would look something like

id
[]# -> #17
id# trying b now
[]# -> #42
id# trying a again
@17
T1
R # a done (#88)
APP
id# trying b again
@42
T1
R # b done (#101)
APP   # b's list now populated
POP
POP   # b abandoned
@101  # b fetched
APP   # finally building a's list
@88   # a is long done
APP   # a's list now populated
POP
POP   # a abandoned
@88   # final value: a

Perhaps a technique for distinguishing these cases is to look for new objects 
having been created since the last time we visited an object.  If there are 
none, we're in the immutable case and we lose.  If there are yet more created 
between the second and third visits, on the other hand, we're generating more 
objects from __reduce__ every time and should again abort.

--
nosy: +herring

___
Python tracker 

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



[issue25686] Don't use distutils in test_shutil

2015-11-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c50cbb5d5ece by Serhiy Storchaka in branch '3.4':
Issue #25686: test_shutil no longer uses the distutils package for searching
https://hg.python.org/cpython/rev/c50cbb5d5ece

New changeset df11d58fce00 by Serhiy Storchaka in branch '3.5':
Issue #25686: test_shutil no longer uses the distutils package for searching
https://hg.python.org/cpython/rev/df11d58fce00

New changeset 3ccd9dfb8ab7 by Serhiy Storchaka in branch 'default':
Issue #25686: test_shutil no longer uses the distutils package for searching
https://hg.python.org/cpython/rev/3ccd9dfb8ab7

New changeset 81b4b130a891 by Serhiy Storchaka in branch '2.7':
Issue #25686: test_shutil no longer uses the distutils package for running
https://hg.python.org/cpython/rev/81b4b130a891

--
nosy: +python-dev

___
Python tracker 

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



[issue25528] Attempt to further increase test coverage of calendar module

2015-11-21 Thread Rohit Mediratta

Rohit Mediratta added the comment:

Thanks for the comments. I did indeed have the patch reversed. I've resolved it 
here.

Martin: I had the locale=None case in the patch.

--
Added file: http://bugs.python.org/file41109/mywork_update.patch

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-21 Thread Martin Panter

Martin Panter added the comment:

Thank you Serhiy for you help, and Ben for reporting this.

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

___
Python tracker 

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