[issue11730] Setting Invalid sys.stdin in interactive mode => loop forever.

2011-04-02 Thread STINNER Victor
STINNER Victor added the comment: I think that it is a duplicate of #8070. -- resolution: -> duplicate status: open -> closed ___ Python tracker ___ ___

[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2011-04-02 Thread STINNER Victor
STINNER Victor added the comment: Issue #11730 has been marked as duplicate. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2011-04-02 Thread ysj.ray
ysj.ray added the comment: I'd prefer not exit program but try to use Py_FileSystemDefaultEncoding as enc when sys.stdin is invalid. On most cases, setting sys.stdin to some other invalid value does means the program could not continue running. --

[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2011-04-02 Thread ysj.ray
ysj.ray added the comment: > On most cases, setting sys.stdin to some other invalid value does means the > program could not continue running. Sorry, it should be: On most cases, setting sys.stdin to some other invalid value does not mean the program could not continue running. --

[issue7443] test.support.unlink issue on Windows platform

2011-04-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: FYI: implementation of unlink already has multiple calls for unicode version to process symlinks. Ansi version is the simple DeleteFileA call. Now we have different behavior for unicode and ansi variants as I can see. Now I'm working on unlink implementations

[issue10791] Wrapping TextIOWrapper around gzip files

2011-04-02 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nvawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue11740] difflib html diff takes extremely long

2011-04-02 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: The culprit seems to be Differ._fancy_replace. There is a nasty quadratic loop there, that has pretty complex internal code. I have done a quick a fix, that makes example run below a second at the expense of not calling _fancy_replace for longer chunks an

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Here is an updated patch that adds read1() to BZ2File. This should fix things for issue10791 from the bz2 side. I also took the opportunity to clean up _read_block() to be more readable. As per Martin's suggestion on python-dev, I put the copyright notice in the p

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Updated documentation. -- Added file: http://bugs.python.org/file21503/bz2-v5-doc.diff ___ Python tracker ___

[issue8905] difflib should accept arbitrary line iterators

2011-04-02 Thread Filip Gruszczyński
Changes by Filip Gruszczyński : -- nosy: +gruszczy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue6931] dreadful performance in difflib: ndiff and HtmlDiff

2011-04-02 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: Check also this: http://bugs.python.org/issue11740 -- nosy: +gruszczy ___ Python tracker ___ __

[issue4709] Mingw-w64 and python on windows x64

2011-04-02 Thread cournapeau david
cournapeau david added the comment: Hi Martin, It was nice meeting you at Pycon. I finally took the time to set up a windows 64 bits environment, and here are the exact steps I needed to do to reproduce the issue, and fix it by hand: - Start fresh from windows 7 64 bits - clone python hg

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Adam Matan
New submission from Adam Matan : shutil.copy2(file, dest) fails when dest has unicode characters: [2011-04-02 17:19:54 adam@adam-laptop ~/personal :) ]$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more inform

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Library (Lib) -Extension Modules nosy: +ezio.melotti stage: -> test needed type: -> behavior ___ Python tracker ___ __

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: The problem here is that you are mixing byte strings and unicode. glob.glob('*.ods') returns a list of strings, so in shutil.copy2(file, 'א') you are passing two byte strings and everything works fine. In shutil.copy2(file, u'א') instead, file is a byte string, a

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Adam Matan
Adam Matan added the comment: Don't you think that shutil should be able to handle mixed data types, for example byte string as file name and unicode destination directory? This is, in my opinion, a very common scenario. Would you consider converting all arguments to Unicode? -- ___

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: I should have added that both 'א' and u'א' work as long as the file names in the list returned by glob() are ASCII: if u'א' is used they are simply coerced to unicode. If there are non-ASCII file names in the glob() list, the copy fails because Python 2 tries t

[issue11742] Possible bug in Python/import.c

2011-04-02 Thread Andrew Sommerville
New submission from Andrew Sommerville : Around line 1509 in Python/import.c, function "find_module", the importer is trying to fail with "No module named...". It is possible for "fp" to be NULL and "fdp" (the return value) to be non-NULL, which callers would see as success. Solution: add "fdp

[issue8631] subprocess.Popen.communicate(...) hangs on Windows

2011-04-02 Thread Patrick Gansterer
Patrick Gansterer added the comment: I can reproduce this on WinXP with 2.5, 2.7 and 3.2. On my other box (Win7 64bit) the same code works without problems. This problem happens only when I make a subprocess.call() to executables from my msysgit installation (e.g. echo, git). A call to 'notepa

[issue11678] Add support for Arch Linux to platform.linux_distributions()

2011-04-02 Thread Georg Brandl
Georg Brandl added the comment: And we all laughed :) -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10963] "subprocess" can raise OSError (EPIPE) when communicating with short-lived processes

2011-04-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I think it's best to remove all this inconsistency and fix it so that > EPIPE is never generated and then backport it to 2.7, 3.1, 3.2. > > Attached is a patch which fixes it for poll, select, windows and adds > two tests. The patch looks good to me. --

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here is an updated patch that adds read1() to BZ2File. This should fix things > for issue10791 from the bz2 side. I also took the opportunity to clean up > _read_block() to be more readable. As per Martin's suggestion on python-dev, I > put the copyright notic

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Adam Matan
Adam Matan added the comment: Don't you think it should be changed in Python 2.x, so that the ASCII filename will be automatically converted to to Unicode? -- ___ Python tracker __

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: The ASCII filename is already converted to unicode, but in your case the program was most likely failing with some non-ASCII filename. -- ___ Python tracker ___

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Adam Matan
Adam Matan added the comment: Do you think it should be fixed at the module level? -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: Here is a patch that passes functools tests. I'll be happy to work on it further. -- keywords: +patch Added file: http://bugs.python.org/file21504/11707.patch ___ Python tracker

[issue11741] shutil2.copy fails with destination filenames

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: Mixing byte and unicode strings should always be avoided, because the implicit coercion to unicode works only if the byte strings contains only ASCII, and fails otherwise. Several modules -- including shutil, glob, and os.path -- have API that work with both by

[issue11282] 3.3 unittest document not kept consist with code

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: Guido decided to leave the fail* methods and assertDictContainsSubset in 3.3 (and possibly even in the following versions), so that people moving from 2.7 to 3.3 don't have to change their code because these methods are missing. Since assertSameElements is not i

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Eric Smith
Eric Smith added the comment: I haven't had time to look at this in detail, but the concept appears sound. I'll try to devote some time to it, but hopefully someone else on core-mentorship with more familiarity with this code will also be able to review it. One thing: You don't want to delet

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Filip Gruszczyński
Filip Gruszczyński added the comment: Ok, here is patch that keep python implementation of cmp_to_key if C version can't be imported. Thanks again for you help :-) -- Added file: http://bugs.python.org/file21505/11707_2.patch ___ Python tracker

[issue11743] Rewrite PipeConnection and Connection in pure Python

2011-04-02 Thread Antoine Pitrou
New submission from Antoine Pitrou : Here is a rewrite of multiprocessing.{PipeConnection,Connection} in pure Python, for ease of maintenance and improvement. -- components: Library (Lib) files: mpconn.patch keywords: patch messages: 132816 nosy: asksol, brian.curtin, jnoller, pitrou, t

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-04-02 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: +Rewrite PipeConnection and Connection in pure Python ___ Python tracker ___ ___ Python-bu

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nice work. There are a few nits (dealloc and traverse need to address both python objects in the struct). I will look at the patch in detail when I get a chance (in the next week or so). It would be great if more tests were added (in general, C equivalen

[issue2736] datetime needs an "epoch" method

2011-04-02 Thread Ka-Ping Yee
Ka-Ping Yee added the comment: > no one has come up with a satisfactory solution Plenty have proposed a satisfactory solution. No one has come up with a solution that is satisfactory to *you*, because you have overconstrained the problem. The reason we still have no utctotimestamp() after a

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Thanks for the review. I've made most of the changes you suggested, but there's one thing I wanted to check about: > - instead of "int(size)", use "size = size.__index__()" so as to forbid floats The tests for readline() and readlines() expect a TypeError if siz

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The tests for readline() and readlines() expect a TypeError if size is None. > Calling size.__index__() in this case raises an AttributeError instead. > Should I > change the tests to expect an AttributeError? Alternatively, something like > this > would mor

[issue10712] 2to3 fixer for deprecated unittest method names

2011-04-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: -> ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Here's the updated patch. -- Added file: http://bugs.python.org/file21507/bz2-v6.diff ___ Python tracker ___ _

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: ... and the corresponding updated documentation patch. -- Added file: http://bugs.python.org/file21508/bz2-v6-doc.diff ___ Python tracker ___

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Santoso Wijaya added the comment: There does not seem to be any mention of what an ANSI behavior should be upon encountering a non-supported format string. Hence, perhaps, the discrepancy among different platforms. -- ___ Python tracker

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- versions: +Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Santoso Wijaya added the comment: I don't think this is a Windows "bug" per se, because the behavior is undefined in the standards. The burden is up to us to validate the format string inputted [w]strftime and currently, our code mistakenly clears "%f" as valid. I'm attaching a patch against

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Changes by Santoso Wijaya : Removed file: http://bugs.python.org/file21509/issue11703.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Santoso Wijaya added the comment: Wrong filename. Attaching again: against 2.7 and 3.1 branches. -- Added file: http://bugs.python.org/file21510/issue10762_py27.patch ___ Python tracker ___

[issue10762] strftime('%f') segfault

2011-04-02 Thread Santoso Wijaya
Changes by Santoso Wijaya : Added file: http://bugs.python.org/file21511/issue10762_py31.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue11744] re.LOCALE doesn't reflect locale.setlocale(...)

2011-04-02 Thread Vlastimil Brom
New submission from Vlastimil Brom : Hi, I just noticed a behaviour of the re.LOCALE flag I can't understand; I first reported this to the new regex implementation, which, however, only mimics the standard lib re in this case: http://code.google.com/p/mrab-regex-hg/issues/detail?id=6 I also cou

[issue11744] re.LOCALE doesn't reflect locale.setlocale(...)

2011-04-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, mrabarnett ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue1647489] zero-length match confuses re.finditer()

2011-04-02 Thread Denver Coneybeare
Denver Coneybeare added the comment: I just re-tested this issue in trunk at changeset 053bc5ca199b and the issue is still exactly reproducible as originally reported. That is, the match to the empty string skips a character of the match: >>> import re >>> [m.groups() for m in re.finditer(r'

[issue11745] idlelib/PyShell.py: incorrect module name reported in error message: Tkinter should be tkinter

2011-04-02 Thread Denver Coneybeare
New submission from Denver Coneybeare : Just a very minor bug. The error message in idlelib/PyShell.py that is printed when importing tkinter fails says that it failed to import "Tkinter", but the actual module name is "tkinter" (with a lowercase t). try: from tkinter import * except Im

[issue11745] idlelib/PyShell.py: incorrect module name reported in error message: Tkinter should be tkinter

2011-04-02 Thread Denver Coneybeare
Changes by Denver Coneybeare : -- keywords: +patch Added file: http://bugs.python.org/file21512/patch_idle_tkinter_import_v1.patch ___ Python tracker ___

[issue11745] idlelib/PyShell.py: incorrect module name reported in error message: Tkinter should be tkinter

2011-04-02 Thread Denver Coneybeare
Changes by Denver Coneybeare : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11745] idlelib/PyShell.py: incorrect module name reported in error message: Tkinter should be tkinter

2011-04-02 Thread Ezio Melotti
Ezio Melotti added the comment: I think in this case "Tkinter" refers to the "Tkinter" library, rather than the "tkinter" module. -- nosy: +ezio.melotti type: behavior -> ___ Python tracker _

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue11746] ssl library load_cert_chain cannot use elliptic curve type private key

2011-04-02 Thread umedoblock
New submission from umedoblock : ssl library load_cert_chain cannot use elliptic curve type private key. I resolved the problem, I attached patch file -- components: Library (Lib) files: _ssl.c.diff keywords: patch messages: 132830 nosy: umedoblock priority: normal severity: normal stat

[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

2011-04-02 Thread Daniel Goertzen
Daniel Goertzen added the comment: It turns out that cx-freeze deliberately sets Py_IgnoreEnvironmentFlag to ensure that the final executable is really an isolated, standalone executable (ie, it can't be subverted by setting PYTHONPATH.) Therefore the PYTHONIOENCODING work-around does not wo

[issue11747] unified_diff function product incorrect range information

2011-04-02 Thread Jan Koprowski
New submission from Jan Koprowski : Python: --- >>> import difflib >>> dl = difflib.unified_diff([], ['a\n', 'b\n']) >>> print ''.join(dl), --- +++ @@ -1,0 +1,2 @@ +a +b Gnu diff: --- $diff -uN a b --- a 1970-01-01 01:00:00.0 +0100 +++ b

[issue11707] Create C version of functools.cmp_to_key()

2011-04-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Filip, can you please submit a contributor agreement? http://docs.python.org/devguide/coredev.html#sign-a-contributor-agreement -- ___ Python tracker _