[issue18962] Add special case for single iterator in heapq.merge function

2013-09-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e70bf1f32a3 by Raymond Hettinger in branch 'default': Issue #18962: Optimize the single iterator case for heapq.merge() http://hg.python.org/cpython/rev/0e70bf1f32a3 -- nosy: +python-dev ___ Python

[issue18962] Add special case for single iterator in heapq.merge function

2013-09-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread David Halter
New submission from David Halter: I recently stumbled over the ``dir`` function not working correctly with classes. This means that ``dir(object)`` won't list ``object.__bases__`` or ``object.__subclasses`` (and many other useful methods). I think that we should change that. The C function

[issue18962] Add special case for single iterator in heapq.merge function

2013-09-11 Thread Wouter Bolsterlee
Wouter Bolsterlee added the comment: Thanks for the quick response. Btw, do I understand correctly code cleanups are not welcome, even when touching the code anyway? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962

[issue18962] Add special case for single iterator in heapq.merge function

2013-09-11 Thread Wouter Bolsterlee
Wouter Bolsterlee added the comment: (In case you missed it: my latest comment included a cleaned up version of an earlier patch.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Daniel
Daniel added the comment: Here are some solutions which might help you until MS fixed the bug. 1) Even if the subsystem is Windows one solution is to call AllocConsole() before Py_Initialize() to create a console. 2) Second Solution: If you don't want to open a console and your application

[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-11 Thread Sam Ferencik
Sam Ferencik added the comment: Unfortunately, I don't have a patch. Some thoughts: To discover a 32-bit interpreter running on a 64-bit system, we could use platform.architecture(), which returns platform.architecture() ('32bit', 'ELF') What then, though? How do you turn '32bit' to

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19002 ___ ___ Python-bugs-list

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19002 ___

[issue19003] email.generator.BytesGenerator corrupts data by changing line endings

2013-09-11 Thread Alexander Kruppa
New submission from Alexander Kruppa: This is a follow-up to #16564. In that issue, BytesGenerator was changed to accept a bytes payload, however processing binary data that way leads to data corruption. Repost of the update I posted in #16564:

[issue16564] email.generator.BytesGenerator fails with bytes payload

2013-09-11 Thread Alexander Kruppa
Alexander Kruppa added the comment: Opened #19003. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16564 ___ ___ Python-bugs-list mailing list

[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Automatic generation of NEWS file from commit logs. Commit messages can't be modified after being published, this would be annoying to fix typos etc. From what I record of the ML discussions, the proposed solutions actually sounded more annoying than the

[issue18986] Add a case-insensitive case-preserving dict

2013-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a preliminary C implementation. -- Added file: http://bugs.python.org/file31728/ctransformdict.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18986

[issue18986] Add a case-insensitive case-preserving dict

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file31728/ctransformdict.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18986 ___

[issue18986] Add a case-insensitive case-preserving dict

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file31729/ctransformdict.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18986 ___

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, tim.golden, tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17797 ___

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- priority: normal - high resolution: out of date - stage: - needs patch versions: +Python 3.3, Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17797

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Which 3.2 version does this break with? As far as I can tell, it should be fixed in 3.2.3: see changeset f15943505db0, issue #7111. -- nosy: +pitrou resolution: - fixed stage: needs patch - status: open - pending versions: +Python 3.2 -Python 3.3,

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: @Antoine (Re msg197480) I'm not sure which minor version of Python 3.2 it was, but in my comment in msg187362, I confirmed that I have tested the later version with added is_valid_fd function. As far as I understand, the changes in

[issue19004] datetime: Read in isoformat() output

2013-09-11 Thread Timothy Pederick
New submission from Timothy Pederick: At present, the datetime module does not provide the capability to parse its own output from the isoformat() methods. strptime() can't handle timezones with colons in them (and anyway it seems to me you'd need to try several possible format strings

[issue19005] PyIter_Next crashes if passed a non-iterator

2013-09-11 Thread Evgeny Kapun
New submission from Evgeny Kapun: According to the documentation, PyIter_Next should raise TypeError if passed an object which is not an iterator as an argument. Instead, it calls a function through a null pointer, which leads to a crash. -- components: Interpreter Core messages:

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Daniel
Daniel added the comment: Sorry, I used the latest Python3.4 branch, I haven't tested this with prior versions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17797 ___

[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-11 Thread R. David Murray
R. David Murray added the comment: I agree with Antoine, but then as I said I don't run into huge merge conflicts very often. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___

[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-11 Thread Olivier Grisel
Olivier Grisel added the comment: Maybe it would be better to have separate contexts for each start method. That way joblib could use the forkserver context without interfering with the rest of the user's program. Yes in general it would be great if libraries could customize the

[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-11 Thread Ezio Melotti
Ezio Melotti added the comment: IMHO the status quo is fine. Most of the time HG gets the merge right on its own. Some times kdiff3 pops up and asks me to solve the conflict [0]. Rarely something goes wrong so I just revert Misc/NEWS and re-add the entry manually. It seems to me that they

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread R. David Murray
R. David Murray added the comment: As far as I know dir has always worked this way with classes (certainly back as far as 2.4, which is the oldest python I have on my dev system). So I doubt that this behavior can be open to change, whether or not we think the original decision was correct.

[issue19004] datetime: Read in isoformat() output

2013-09-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - datetime: add ability to parse RFC 3339 dates and times versions: +Python 3.4 -Python 3.3 ___ Python

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2013-09-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +perey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15873 ___ ___ Python-bugs-list

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure which minor version of Python 3.2 it was, but in my comment in msg187362, I confirmed that I have tested the later version with added is_valid_fd function. As far as I understand, the changes in http://hg.python.org/cpython/rev/f15943505db0/

[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-11 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think I've *ever* had NEWS successfully merge when working on a bug fix (even after the move to hg). It's one of the reasons I prefer working on new features, or bugs where the fix is too intrusive for a maintenance release :P --

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: It's going to take more than I think that that's not true, to get a change made. From http://docs.python.org/2/library/functions.html#dir : Because dir() is supplied primarily as a convenience for use at an interactive prompt, it tries to supply an

[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-11 Thread Vlad Shcherbina
Changes by Vlad Shcherbina vlad.shcherb...@gmail.com: Added file: http://bugs.python.org/file31730/tempfile_collision_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18945 ___

[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-11 Thread Vlad Shcherbina
Changes by Vlad Shcherbina vlad.shcherb...@gmail.com: Removed file: http://bugs.python.org/file31697/tempfile_collision_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18945 ___

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2013-09-11 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15873 ___ ___ Python-bugs-list mailing

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2013-09-11 Thread Yuri Bochkarev
Changes by Yuri Bochkarev baltazar...@gmail.com: -- nosy: +Yuri.Bochkarev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3566 ___ ___

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: So when you do a `dir(int)` you don't want to know what you can call on 7? You'd rather know what you can call on 'type'? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19002

[issue19006] UnitTest docs should have a single list of assertions

2013-09-11 Thread Ezio Melotti
Ezio Melotti added the comment: There's nothing fundamentally different about the two lists I made that division because the ones in the first table are the most common and widely used, and are quite general too. The second table contains assert methods about catching exceptions and

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ramchandra Apte
Ramchandra Apte added the comment: On 11 September 2013 21:41, Ethan Furman rep...@bugs.python.org wrote: Ethan Furman added the comment: So when you do a `dir(int)` you don't want to know what you can call on 7? You'd rather know what you can call on 'type'? --

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ramchandra Apte
Ramchandra Apte added the comment: -1 classes themselves are objects, so dir should list the attributes/methods of the class object, not the instances. -- nosy: +Ramchandra Apte ___ Python tracker rep...@bugs.python.org

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: On 11 September 2013 12:34, Antoine Pitrou rep...@bugs.python.org wrote: I'm not sure which minor version of Python 3.2 it was, but in my comment in msg187362, I confirmed that I have tested the later version with added is_valid_fd function. As far as I

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread R. David Murray
R. David Murray added the comment: That's not how people use it at the interactive prompt, though. I call dir(str) to find what methods I can call on an str object, not what methods I can call on the str class object. Same goes for my own classes. Yes, I also call it on instances, but it

[issue11163] iter() documentation code doesn't work

2013-09-11 Thread purplezephyr
purplezephyr added the comment: This does not seem to have been changed in any version, per msg135246. If it's not going to be replaced, there's another issue, which is that the link to readline() in the text is incorrect - it goes to the readline module, not file.readline(). --

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nick, could you help me with documentation? I'm sure my wording needs improving. And there is one question left. Is this change appropriate for 2.7 and 3.3, or only for 3.4? -- ___ Python tracker

[issue18995] Enum does not work with reversed

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: Cool, I didn't even know __reversed__ existed! -- assignee: - ethan.furman stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18995 ___

[issue19006] UnitTest docs should have a single list of assertions

2013-09-11 Thread Roy Smith
New submission from Roy Smith: http://docs.python.org/2/library/unittest.html#assert-methods The docs say, The TestCase class provides a number of methods to check for and report failures, such as, and then when you scroll a couple of screens down, there's another list, There are also other

[issue19006] UnitTest docs should have a single list of assertions

2013-09-11 Thread Roy Smith
Roy Smith added the comment: Adding a note that there are more methods in the tables below would be useful. Otherwise, you assume you've seen them all when you've read the first table. I agree that the assertions about exceptions and warnings belong in a different group, but I don't see any

[issue19006] UnitTest docs should have a single list of assertions

2013-09-11 Thread Ezio Melotti
Ezio Melotti added the comment: One reason is that if I list all those assert methods first and keep the assertRaises/Warns in a separate group, they will be pushed way down, and people might miss them. I'll try to prepare a patch that adds links to the other tables and/or changes the wording

[issue11163] iter() documentation code doesn't work

2013-09-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the current 3.3.2 docs, 'STOP' has been replaced by '', so there is a change, and no infinite loop. However, this is still does not strike me as an example of 'useful' as for line in iter(fp.readline, STOP): # is a bad version of for line in fp: It

[issue18911] minidom does not encode correctly when calling Document.writexml

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18911 ___

[issue18988] Tab key doesn't work sometimes.

2013-09-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset c882395e8ed8 by Serhiy Storchaka in branch '3.3': Issue #18988: The Tab key now works when a word is already autocompleted. http://hg.python.org/cpython/rev/c882395e8ed8 New changeset 7d38784092d8 by Serhiy Storchaka in branch 'default': Issue

[issue18844] allow weights in random.choice

2013-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed patch add two methods to the Random class and two module level functions: weighted_choice() and weighted_choice_generator(). weighted_choice(data) accepts either mapping or sequence and returns a key or index x with probability which is

[issue18844] allow weights in random.choice

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18844 ___ ___

[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: -serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18730 ___ ___

[issue18988] Tab key doesn't work sometimes.

2013-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18988

[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2013-09-11 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +georg.brandl, ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18730 ___ ___

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Shortly, is_valid_fd always returns true because fd 0 is always false as my tests with Visual Studio 2012 Well, that's not all there is, is_valid_fd() does other checks before returning true. -- ___ Python

[issue13107] Text width in optparse.py can become negative

2013-09-11 Thread Elazar Gershuni
Elazar Gershuni added the comment: ok. how about argparse_ugly.patch? below some width it simply won't do any wrapping. (I hadn't touch optparse yet) -- Added file: http://bugs.python.org/file31731/argparse_ugly.patch ___ Python tracker

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-11 Thread Mateusz Loskot
Mateusz Loskot added the comment: On 12 September 2013 00:06, Antoine Pitrou rep...@bugs.python.org wrote: Shortly, is_valid_fd always returns true because fd 0 is always false as my tests with Visual Studio 2012 Well, that's not all there is, is_valid_fd() does other checks before

[issue18995] Enum does not work with reversed

2013-09-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Simplified unit test. I reused enum Season in the test class. By the way, there is another way to add support for enum without implementing __reversed__ method, which is adding support indexing by number (in __getitem__ method), e.g. Season[1] = Season.SPRING.

[issue18995] Enum does not work with reversed

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: Yes, I was aware of that method (not that we would add it that way). __reversed__ is definitely better for Enum. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18995

[issue18844] allow weights in random.choice

2013-09-11 Thread Neil Girdhar
Neil Girdhar added the comment: Should this really be implemented using the cumulative distribution and binary search algorithm? Vose's Alias Method has the same initialization and memory usage cost (O(n)), but is constant time to generate each sample. An excellent tutorial is here:

[issue14927] add Do not supply 'int' argument to random.shuffle docstring

2013-09-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 82bdd5fc7a71 by Senthil Kumaran in branch '2.7': Improve the docstring of random.shuffle. Inform users not to provide int arg. http://hg.python.org/cpython/rev/82bdd5fc7a71 New changeset 4782faf29480 by Senthil Kumaran in branch '3.3': Improve the

[issue14927] add Do not supply 'int' argument to random.shuffle docstring

2013-09-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: This is fixed in all versions. Thank you! -- nosy: +orsenthil resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org