[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



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



[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



[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



[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



[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



[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



[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



[issue25686] Don't use distutils in test_shutil

2015-11-21 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Welcome Serhiy,

--

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

New submission from SilentGhost:

Just a minor fix, removing the following: "Here is a sample on how using it:"

--
assignee: docs@python
components: Documentation
files: ftplib_docs.diff
keywords: patch
messages: 255056
nosy: SilentGhost, docs@python
priority: normal
severity: normal
stage: patch review
status: open
title: ftplib docs language fix
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41112/ftplib_docs.diff

___
Python tracker 

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



[issue13275] Recommend xml.etree for XML processing

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The wording in the tutorial was changed in issue23891. Now ElementTree is 
mentioned on first place. In the "Structured Markup Processing Tools" section 
ElementTree is listed before other XML processing modules.

I think this issue can be closed now.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue10942] xml.etree.ElementTree.tostring returns type bytes, expected type str

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For now the documentation explains the resulting type of tostring().

https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.tostring
"""
Generates a string representation of an XML element, including all subelements. 
element is an Element instance. encoding [1] is the output encoding (default is 
US-ASCII). Use encoding="unicode" to generate a Unicode string (otherwise, a 
bytestring is generated). method is either "xml", "html" or "text" (default is 
"xml").
"""

Looks as this issue can be closed.

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can this issue be closed?

--
nosy: +serhiy.storchaka
status: open -> pending

___
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 Aleksey Kladov

Aleksey Kladov added the comment:

>What's the point of your bug report?

To show surprising platform-dependent API behavior. I don't know what is the 
correct behavior here, but it should be cross platform. Seems like the most 
sane option is to throw an exception. 


>Does your application really rely on the behaviour of the selector when no 
>file descriptor is registered?

It was developed on Mac and relied (quite probably incorrectly) on the empty 
list result. When I run it on linux, it unexpectedly hanged.

So, I would like to either

* observe an exception on all platforms
* observe an empty list on all platforms
* observe infinite blocking on all platforms

I think this special case should also be mentioned in the docs.

--

___
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 Niv Ben-David

New submission from Niv Ben-David:

The unittest.mock module defines a mock_open utility to mock the builtin open 
function.

During a recent project I found I needed something more. Specifically, mocking 
different files at the same time, better mocking for operations (like seek, 
readlines, etc.) among others.

The project can also be found on http://github.com/nivbend/mock-open

Thanks

--
components: Library (Lib)
files: mock_open.patch
keywords: patch
messages: 255061
nosy: Niv Ben-David
priority: normal
severity: normal
status: open
title: Replacement for unittest.mock.mock_open
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41113/mock_open.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 SilentGhost

Changes by SilentGhost :


--
components: +Tests
nosy: +ezio.melotti, michael.foord, rbcollins
stage:  -> patch review

___
Python tracker 

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



[issue25656] multiprocessing.dummy: pool.map hangs on empty list

2015-11-21 Thread Tomer

Tomer added the comment:

Thanks for the reply,

So first thing I found that I wasn’t working with python 2.7.10 – I updated to 
2.7.10 and it fixed the problem.

If you are still curious about reproducing the behavior I’m working on windows 
7 64 bit and as I said I worked with python 2.7,

Thank you.

--

___
Python tracker 

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



[issue25656] multiprocessing.dummy: pool.map hangs on empty list

2015-11-21 Thread Emanuel Barry

Changes by Emanuel Barry :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue25691] Crash on deleting Element attribute

2015-11-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

>>> import xml.etree.ElementTree as ET
>>> e = ET.Element('tag')
>>> del e.tag
Segmentation fault (core dumped)

Proposed patch fixes the crash.

--
components: Extension Modules
files: etree_del_attributes.patch
keywords: patch
messages: 255063
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Crash on deleting Element attribute
type: crash
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file41114/etree_del_attributes.patch

___
Python tracker 

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



[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



[issue20612] cElementTree has problems with StringIO object containing unicode content

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For now cElementTree parser just stops parsing when has read something that is 
not exactly of type str. Eli, Stefan, it is not hard to make cElementTree 
supporting Unicode streams, only few lines of code. But is it worth to do this 
on this stage? Or we have just close this issue as "won't fix"?

--
nosy: +eli.bendersky, scoder

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25488] IDLE: Remove '' and idlelib from sys.path when added

2015-11-21 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: IDLE: Remove idlelib from sys.path when added -> IDLE: Remove '' and 
idlelib from sys.path when added

___
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 Eugene Toder

Eugene Toder added the comment:

Davis, the possible cases (i.e. recursion via appropriate mutable objects) are 
already supported, and the impossible cases are, well, impossible. The only 
open issue is whether to implement better error handling for infinite recursion 
problems, instead of relying on built-in maximum recursion depth.

--

___
Python tracker 

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



[issue25264] test_marshal always crashs on "AMD64 Windows10 2.7" buildbot

2015-11-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
priority: normal -> high

___
Python tracker 

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



[issue25264] test_marshal always crashs on "AMD64 Windows10 2.7" buildbot

2015-11-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could anybody please run the test on Windows at found at least what test method 
is crashed? A stacktrace could help a lot too.

--

___
Python tracker 

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



[issue9941] Unify trace and profile interfaces

2015-11-21 Thread Gordon C

Gordon C added the comment:

I know this is an old bug (my first-time contribution), but I checked and it 
still applies in current versions. As suggested by @belopolsky, I added runcall 
to Trace and made runfunc an alias for it. I also updated the tests for trace 
to reflect the change to runcall over runfunc.

--
keywords: +patch
nosy: +Gordon C
Added file: http://bugs.python.org/file41116/9941.patch

___
Python tracker 

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



[issue25656] multiprocessing.dummy: pool.map hangs on empty list

2015-11-21 Thread Davin Potts

Davin Potts added the comment:

@tomer70: Thanks for the update and glad to hear that updating to the latest 
release fixed the issue.

--

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-11-21 Thread Jacek Kołodziej

Jacek Kołodziej added the comment:

Week and no response, I'm posting updated patches for calendar and tarfile.

--
Added file: http://bugs.python.org/file41118/Issue23883_tarfile_all.v2.patch

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-11-21 Thread Jacek Kołodziej

Changes by Jacek Kołodziej :


Added file: http://bugs.python.org/file41117/Issue23883_calendar_all.v2.patch

___
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 Jason R. Coombs

New submission from Jason R. Coombs:

The built-in function 'input' appears to be sending the prompt to stderr 
instead of stdout, as the docs state it should.

$ python3.5 -c "print('stdout'); import sys; print('stderr', file=sys.stderr); 
input('foo')" 2> errors.txt
stdout
hello
$ cat errors.txt
stderr
foo

I've replicated this behavior in both Python 3.4 on Linux and Python 3.5 and 
2.7 on OS X. Here's the 2.7 test/output:

$ python2.7 -c "from __future__ import print_function; print('stdout'); import 
sys; print('stderr', file=sys.stderr); raw_input('foo')" 2> errors.txt
stdout
hello
$ cat errors.txt 
stderr
foo

I believe the stated behavior (outputting the prompt to stdout) is the proper 
behavior.

I figure I must be doing something wrong here, because it seems bizarre to me 
that this discrepancy hasn't been discovered before.

--
messages: 255072
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: input function outputs prompt to stderr
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
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



[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



[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



[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



[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



[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

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



[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



[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



[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