[issue3329] API for setting the memory allocator used by Python

2008-07-10 Thread Jukka Laurila
Jukka Laurila [EMAIL PROTECTED] added the comment: Brett, the ability to define the allocator dynamically at runtime could be a compile time option, turned on by default only on small memory platforms. On most platforms you can live with plain old malloc and may want to avoid the indirection. If

[issue3287] Fraction constructor should raise TypeError instead of AttributeError

2008-07-10 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Applied in r64835. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3287 ___

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Carl Johnson
New submission from Carl Johnson [EMAIL PROTECTED]: Compare the following behaviors: Python 3.0a5 (r30a5:62856, May 10 2008, 10:34:28) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. def f(x): ... if x 5:

[issue3329] API for setting the memory allocator used by Python

2008-07-10 Thread Nick Coghlan
Nick Coghlan [EMAIL PROTECTED] added the comment: Given where we are in the release cycle, I've bumped the target releases to 2.7/3.1. So Symbian are probably going to have to do something port-specific anyway in order to get 2.6/3.0 up and running. And in terms of hooking into this kind of

[issue3274] Py_CLEAR(tmp) seg faults

2008-07-10 Thread Nick Coghlan
Nick Coghlan [EMAIL PROTECTED] added the comment: A better option may be to append _tmp to the passed in token: #define Py_CLEAR(op)\ do {\ if (op) { \ PyObject

[issue3329] API for setting the memory allocator used by Python

2008-07-10 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: I think it is reasonable to get a macro definition change into 2.6. The OP's request is essential for his application (running Python on Nokia phones) and it would be a loss to wait two years for this. Also, his request for a macro will

[issue3274] Py_CLEAR(tmp) seg faults

2008-07-10 Thread Daniel Stutzbach
Daniel Stutzbach [EMAIL PROTECTED] added the comment: Appending _tmp is a good idea, but it won't work when the parameter isn't a simple symbol. For example, there's a line in cPickle.c like this: Py_CLEAR(*p). ___ Python tracker [EMAIL PROTECTED]

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-07-10 Thread Raymond Hettinger
Changes by Raymond Hettinger [EMAIL PROTECTED]: -- assignee: rhettinger - ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1700288 ___ ___

[issue1568] PATCH: Armin's attribute lookup caching for 3.0

2008-07-10 Thread Raymond Hettinger
Changes by Raymond Hettinger [EMAIL PROTECTED]: -- assignee: rhettinger - ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1568 ___ ___ Python-bugs-list

[issue3332] DocTest and dict sort.

2008-07-10 Thread Jens Diemer
New submission from Jens Diemer [EMAIL PROTECTED]: The doctest doesn't work good, if a function returns a dict. Here a simple example: def test(d): This works: test({A:1, B:2, C:3}) {'A': 1, 'C': 3, 'B': 2} This failed, because of different dict sort: test({A:1,

[issue3301] DoS when lo is negative in bisect.insort_right() / _left()

2008-07-10 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Fixed in 64845. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3301 ___

[issue3332] DocTest and dict sort.

2008-07-10 Thread Tarek Ziadé
Tarek Ziadé [EMAIL PROTECTED] added the comment: This is not a bug: dict do not guarantee the ordering of the keys, so it may change on every run. A good practice is to test a sorted .items() output of your dict in your doctest. -- nosy: +tarek ___

[issue3332] DocTest and dict sort.

2008-07-10 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Closing as not a bug. FWIW, here's the relevant text from the docs: - 23.2.3.6 Warnings doctest is serious about requiring exact matches in expected output. If even a single character doesn't

[issue3285] Fraction.from_any()

2008-07-10 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Adopted the solution used by functions in the math module. Functions that accept floats also accept integral inputs. This improves usability in face of mixed float/int data or decimal/int data. See r64846. -- resolution: -

[issue3333] Need -3 warning for exec statement becoming a function

2008-07-10 Thread Raymond Hettinger
Changes by Raymond Hettinger [EMAIL PROTECTED]: -- nosy: rhettinger priority: high severity: normal status: open title: Need -3 warning for exec statement becoming a function versions: Python 2.6 ___ Python tracker [EMAIL PROTECTED]

[issue3330] webbrowser module doesn't correctly handle '|' character.

2008-07-10 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: I was able to duplicate this, but it's an issue with Firefox, not Python. webbrowser.open(url) just passes url as a command line argument to the web browser; it doesn't do any manipulation. Note that you get the exact same behaviour if you run

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: You seem to be suggesting that a StopIteration raised in the body of a for-loop should cause the loop to break. That isn't (as far as I know) the point of StopIteration. StopIteration is only used to break the for-loop when raised by the iterator,

[issue3300] urllib.quote and unquote - Unicode issues

2008-07-10 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: Setting Version back to Python 3.0. Is there a reason it was set to Python 3.1? This proposal will certainly break a lot of code. It's *far* better to do it in the big backwards-incompatible Python 3.0 release than a later release. --

[issue3331] Possible inconsistency in behavior of list comprehensions vs. generator expressions

2008-07-10 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: IMO the generator expression is wrong in interpreting the StopIteration as a break. It should fail just like the list comprehension fails. -- nosy: +gvanrossum ___ Python tracker [EMAIL PROTECTED]

[issue3334] 2to3 looses indentation on import fix

2008-07-10 Thread Christian Theune
New submission from Christian Theune [EMAIL PROTECTED]: I got this output from 2to3: (This is from setuptools egg_info.py) -import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) +from . import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) -- assignee:

[issue3329] API for setting the memory allocator used by Python

2008-07-10 Thread Adam Olsen
Adam Olsen [EMAIL PROTECTED] added the comment: Basically you just want to kick the malloc implementation into doing some housekeeping, freeing its caches? I'm kinda surprised you don't add the hook directly to your libc's malloc. IMO, there's no use-case for this until Py_Finalize can

[issue874900] threading module can deadlock after fork

2008-07-10 Thread Jesse Noller
Jesse Noller [EMAIL PROTECTED] added the comment: FWIW: the threading tests still hang for me with the latest patch. I'm confirming that the patch itself fixes the hanging MP tests though ___ Python tracker [EMAIL PROTECTED]

[issue3316] Proposal for fix_urllib

2008-07-10 Thread Collin Winter
Collin Winter [EMAIL PROTECTED] added the comment: - You should add tests to test_fixers to ensure that this does what you expect. This will make it much easier for others to modify this fixer later. You can probably just reuse the tests Brett initially added. - There's a better data structure

[issue3335] subprocess lib - opening same command fails

2008-07-10 Thread Justin Harper
New submission from Justin Harper [EMAIL PROTECTED]: When I make the same shell call a second time, a weird error occurs. It appears that the system is caching the call and then returning the same object the second time, which causes a problem because the stream is at EOF and there is no way

[issue3335] subprocess lib - opening same command fails

2008-07-10 Thread Justin Harper
Justin Harper [EMAIL PROTECTED] added the comment: Correction: line two should actually be: self.output = fout.readlines() The bug still exists with this change. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3335

[issue1673409] datetime module missing some important methods

2008-07-10 Thread Erik Stephens
Erik Stephens [EMAIL PROTECTED] added the comment: I'm not sure this is still being considered, so I just wanted to add my opinion. This seems like such a simple request being made overly complicated. We just want seconds since epoch since that is used in many other functions and libraries

[issue3336] datetime weekday() function

2008-07-10 Thread ryanboesch
New submission from ryanboesch [EMAIL PROTECTED]: Leap year ignored each century (2100, 2200, 2300, etc.) except 2000 for the weekday() function. This code reproduces the error: import datetime datetime.date(2100,2,29).weekday() Error message: ValueError: day is out of range for the month

[issue3336] datetime weekday() function

2008-07-10 Thread Tim Peters
Tim Peters [EMAIL PROTECTED] added the comment: The error message is correct. In the Gregorian calendar, years divisible by 100 are not leap years, unless they're also divisible by 400. So 2000, 2400, 2800, ..., are leap years, but 2100, 2200, 2300, 2500, 2600, 2700, 2900, ... are not leap

[issue3300] urllib.quote and unquote - Unicode issues

2008-07-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Setting Version back to Python 3.0. Is there a reason it was set to Python 3.1? 3.0b1 has been released, so no new features can be added to 3.0. ___ Python tracker [EMAIL PROTECTED]

[issue2275] urllib2 header capitalization

2008-07-10 Thread John J Lee
John J Lee [EMAIL PROTECTED] added the comment: * The patch looks like it will break code that uses .header_items(), which is not acceptable. * The patch to the docs seems to muddy the waters even further (than the current slightly murky state) about whether and why .headers is to be preferred

[issue3008] Let bin/oct/hex show floats

2008-07-10 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Here's a slightly more polished version of the previous patch; no behaviour changes. Let me know if there's anything I can do to help get this in before next week's beta. Anybody want to trade patch reviews? Added file:

[issue3333] Need -3 warning for exec statement becoming a function

2008-07-10 Thread Benjamin Peterson
New submission from Benjamin Peterson [EMAIL PROTECTED]: No, I don't think we do. This is something that 2to3 can handle well, and also rather pointless because it would be impossible to get rid of the warning in 2.x because exec isn't a function in 2.x.(short of removing the exec completely!)

[issue2275] urllib2 header capitalization

2008-07-10 Thread Facundo Batista
Facundo Batista [EMAIL PROTECTED] added the comment: John: You say that it will break code because it changes the capitalization policy, or because other reason? Do you think that there's a way to fix this issue and not break the code? If you really think that this breaks code, please provide

[issue3316] Proposal for fix_urllib

2008-07-10 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: What Collin said. =) I will put robotparser and urlparse into fix_imports myself and continue to update the docs in 2.x for urllib(2). Thanks to the both of you for helping with this! It's going to be great once this fixer is ready to go as it

[issue3337] Fixer for dbm is failing

2008-07-10 Thread Brett Cannon
New submission from Brett Cannon [EMAIL PROTECTED]: The fixer for dbm to dbm.ndbm fails test_fixers.Test_imports . -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) messages: 69526 nosy: brett.cannon, collinwinter priority: critical severity: normal status: open

[issue2775] Implement PEP 3108

2008-07-10 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- dependencies: +Fixer for dbm is failing ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2775 ___ ___

[issue2775] Implement PEP 3108

2008-07-10 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- dependencies: +fix_imports does not handle intra-package renames ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2775 ___

[issue3337] Fixer for dbm is failing

2008-07-10 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: The failure seems to be from anydbm being mapped directly to dbm: import anydbm - import dbm - import dbm.ndbm A separate pass might be needed to handle dbm properly so that an import is not changed multiple times.

[issue2275] urllib2 header capitalization

2008-07-10 Thread Senthil
Senthil [EMAIL PROTECTED] added the comment: John J Lee [EMAIL PROTECTED] added the comment: * The patch looks like it will break code that uses .header_items(), which is not acceptable. Nope, it does not break. If the concern was subclassing dict may have adverse effect on .copy and

[issue3159] glob.py improvements

2008-07-10 Thread Facundo Batista
Facundo Batista [EMAIL PROTECTED] added the comment: If readability is enhanced is questionable, but is rejected on the basis that cosmetic-only changes are not generally recommended: only difficults following the code evolution in the repository. The only change that I see regarding

[issue2674] unittest.TestProgram uses sys.exit()

2008-07-10 Thread Facundo Batista
Facundo Batista [EMAIL PROTECTED] added the comment: That class is normally used at the end of the testing suite, as is recommended in the documentation. In any case, I don't see that like a bug, so we shouldn't be changing that behaviour, because of compatibility. What do you think? Maybe the

[issue3337] Fixer for dbm is failing

2008-07-10 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: I have a potential solution brewing; running the full test suite to verify. -- status: open - pending ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3337

[issue3338] cPickle segfault with deep recursion

2008-07-10 Thread Darryl Dixon
New submission from Darryl Dixon [EMAIL PROTECTED]: In at least Python 2.4, using cPickle.Pickler to try and pickle a nested chain of objects more than about 2590 objects deep causes the Python interpreter to segfault. This doesn't seem to happen when using the pure Python pickle module. It is

[issue3337] Fixer for dbm is failing

2008-07-10 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: r64870 has the fix through fix_imports2. -- resolution: - fixed status: pending - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3337 ___