[issue11610] Improved support for abstract base classes with descriptors

2011-12-06 Thread Nick Coghlan
Nick Coghlan added the comment: Added some review comments in Reitveld - core functionality changes look good, but there are some other aspects that need addressing before the patch will be good to go (primarily relating to only doing a minimal documented deprecation of the legacy APIs withou

[issue13524] critical error with import tempfile

2011-12-06 Thread Tim Golden
Changes by Tim Golden : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Instead of requiring bit_length(), couldn't you simply compare self to 2**(bits-1) (for to_unsigned) and 2**bits (for to_signed)? -- nosy: +pitrou ___ Python tracker

[issue13536] ast.literal_eval fails on sets

2011-12-06 Thread Georg Brandl
Georg Brandl added the comment: Alex: IMO the operator support is only required for complex "literals". -- ___ Python tracker ___ ___

[issue13505] Bytes objects pickled in 3.x with protocol <=2 are unpickled incorrectly in 2.x

2011-12-06 Thread sbt
sbt added the comment: > One *dirty* trick I am thinking about would be to use something like > array.tostring() to construct the byte string. array('B', ...) objects are pickled using two bytes per character, so there would be no advantage: >>> pickle.dumps(array.array('B', b"hello"), 2)

[issue13537] Namedtuple instances can't be pickled in a daemonized process

2011-12-06 Thread Popa Claudiu
New submission from Popa Claudiu : On Unix world, in a daemonized process, any namedtuple instance can't be pickled, failing with error: _pickle.PicklingError: Can't pickle class X: attribute lookup __main__.t failed. This can't be reproduced with the attached code. If I add the created class i

[issue13537] Namedtuple instances can't be pickled in a daemonized process

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: As far as I can tell, this has nothing to do with daemon processes and all to do with the fact that user-defined classes have to be globally visible for their instances to be pickled. It is because pickles reference classes by name, and local names obviously

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread Guillaume Bouchard
New submission from Guillaume Bouchard : The docstring associated with str() says: str(string[, encoding[, errors]]) -> str Create a new string object from the given encoded string. encoding defaults to the current default string encoding. errors can be 'strict', 'replace' or 'ignore'

[issue13539] A return is missing in TimeEncoding of calendar.py

2011-12-06 Thread psam
New submission from psam : The v2.6 of __enter__() of TimeEncoding has been fixed in v2.7 in relation with the return of setlocale(), but for no apparent reason, its necessary returned value is no more there. Patch: def __enter__(self): self.oldlocale = _locale.getlocale(_locale.L

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread R. David Murray
R. David Murray added the comment: I agree with you that this is inconsistent. However, having str raise an error is pretty much a non-starter as a suggestion. str always falls back to the repr; in general str(obj) should always return some value, otherwise the assumptions of a *lot* of Pyt

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Personally I'm not at all sure why str takes encoding and errors > arguments (I never use them). Probably because the unicode type also did in 2.x. And also because it makes it compatible with arbitrary buffer objects: >>> str(memoryview(b"foo"), "ascii") 'f

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread Guillaume Bouchard
Guillaume Bouchard added the comment: > str always falls back to the repr; in general str(obj) should always return > some value, otherwise the assumptions of a *lot* of Python code would be > broken. Perhaps it may raises a warning ? ie, the only reason encoding exists if for the conversion

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread R. David Murray
R. David Murray added the comment: A diff would be great. We try to use warnings sparingly, and I don't think this is a case that warrants it. Possibly a .. note is worthwhile, perhaps with an example for the bytes case, but even that may be too much. I also wouldn't use the wording "is tot

[issue13520] Patch to make pickle aware of __qualname__

2011-12-06 Thread sbt
sbt added the comment: It looks like Issue 3657 is really about builtin methods (i.e. builtin_function_or_method objects where __self__ is not a module). It causes no problem for normal python instance methods. If we tried the getattr approach for builtin methods too then it should only be

[issue13540] Document the Action API

2011-12-06 Thread Jason R. Coombs
New submission from Jason R. Coombs : In http://docs.python.org/dev/library/argparse.html#action, when describing an arbitrary action, the documentation states, "You can also specify an arbitrary action by passing an object that implements the Action API." This statement does not link to any d

[issue13540] Document the Action API in argparse

2011-12-06 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- title: Document the Action API -> Document the Action API in argparse ___ Python tracker ___ ___ Pytho

[issue13538] Docstring of str() and/or behavior

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, I forgot to mention it in my previous message, but there is already a warning that you can activate with the -b option: $ ./python -b Python 3.3.0a0 (default:6b6c79eba944, Dec 6 2011, 11:11:32) [GCC 4.5.2] on linux Type "help", "copyright", "credits" o

[issue2057] difflib: add patch capability

2011-12-06 Thread Éric Araujo
Éric Araujo added the comment: Hi Marco, thanks for your interest in improving Python. Do you want to propose a patch for this request? If so, guidelines and help are found in the devguide. (For the other bug, please read the discussion there to see why 2.7 is not possible.) -- __

[issue13408] Rename packaging.resources back to datafiles

2011-12-06 Thread Éric Araujo
Éric Araujo added the comment: MvL also thought the “resources” term to be non-obvious: http://mail.python.org/pipermail/python-dev/2006-April/063966.html Other people mentioned its prior use within the Mac, the X system or Web frameworks. Someone mentioned “assets” in the game industry (als

[issue13408] Rename packaging.resources back to datafiles

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sounds reasonable to me. (is it normal that there's no online help for it: $ ./python -m pydoc packaging.resources no Python documentation found for 'packaging.resources' ) -- nosy: +pitrou ___ Python tracker

[issue13408] Rename the packaging “resources” concept back to “data files”

2011-12-06 Thread Éric Araujo
Éric Araujo added the comment: The resources subsystem has code in the install_data command, the p7g.database module and internal classes. There used to be a p7g.resources module but it was merged into database because it contained only a few lines. -- title: Rename packaging.resourc

[issue13408] Rename the packaging “resources” concept back to “data files”

2011-12-06 Thread Éric Araujo
Éric Araujo added the comment: Regarding reST docs, there’s a good bit in packaging/setupcfg and I have plans to explain it more (what it does, how it works with sysconfig.cfg, how it obsoletes package_data, how to use it and keep compat with distutils). -- __

[issue13541] HTTPResponse (urllib) has no attribute read1 needed for TextIOWrapper

2011-12-06 Thread Peter
New submission from Peter : Use case: I want to open an HTTP URL, and treat the handle as though it were opened in text mode (i.e. unicode strings not bytes). $ python3 Python 3.2 (r32:88445, Feb 28 2011, 17:04:33) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credit

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread Mark Dickinson
Mark Dickinson added the comment: The 'self.bit_length() >= bits' condition for to_unsigned doesn't look right to me. E.g., if bits == 32, I'd expect the acceptable range of values to be range(-2**31, 2**31)---i.e., including -2**31, but excluding 2**31. But the ValueError for 'self.bit_len

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread Mark Dickinson
Mark Dickinson added the comment: On the feature request itself, I have to say that I'm unconvinced. Doing x % (2**32) seems good enough to me, in situations where you don't need the bounds checking. (And it's not clear to me that needing the bounds checks is the more common situation.) --

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > On the feature request itself, I have to say that I'm unconvinced. > Doing x % (2**32) seems good enough to me, in situations where you > don't need the bounds checking. Ah, I didn't know that modulo worked for that. Nice trick. -- _

[issue13534] test_cmath fails on ppc with glibc-2.14.90 due to optimized architecture-specific "hypot"

2011-12-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13500] Hitting EOF gets cmd.py into a infinite EOF on return loop

2011-12-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- assignee: -> jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue13500] Hitting EOF gets cmd.py into a infinite EOF on return loop

2011-12-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5910c385fab6 by Jesus Cea in branch '2.7': Close #13500: Hitting EOF gets cmd.py into a infinite EOF on return loop http://hg.python.org/cpython/rev/5910c385fab6 New changeset b6b4d74b8d42 by Jesus Cea in branch '3.2': Close #13500: Hitting EOF get

[issue13500] Hitting EOF gets cmd.py into a infinite EOF on return loop

2011-12-06 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Garrett, please verify the fix. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue13534] test_cmath fails on ppc with glibc-2.14.90 due to optimized architecture-specific "hypot"

2011-12-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue13534] test_cmath fails on ppc with glibc-2.14.90 due to buggy architecture-specific "hypot"

2011-12-06 Thread Dave Malcolm
Dave Malcolm added the comment: The glibc bug has been fixed in that project's git repo: http://repo.or.cz/w/glibc.git/commit/850fb039cec802072f70ed9763927881bbbf639c -- title: test_cmath fails on ppc with glibc-2.14.90 due to optimized architecture-specific "hypot" -> test_cmath fails

[issue13541] HTTPResponse (urllib) has no attribute read1 needed for TextIOWrapper

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: For the record, readinto is handled in issue 13464. -- components: +Library (Lib) nosy: +pitrou stage: -> needs patch type: -> behavior versions: +Python 3.3 ___ Python tracker

[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()

2011-12-06 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13534] test_cmath fails on ppc with glibc-2.14.90 due to buggy architecture-specific "hypot"

2011-12-06 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report, and all the sleuthing. It's always good to see Python's test suite expose C library (or C compiler) bugs. :-) I propose closing this as 'won't fix': I certainly wouldn't want to add workarounds in the cmath source (though in theory th

[issue13534] test_cmath fails on ppc with glibc-2.14.90 due to buggy architecture-specific "hypot"

2011-12-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue13542] Memory leak in multiprocessing.pool

2011-12-06 Thread Yang Zhang
New submission from Yang Zhang : Calling Pool.map (and friends) on empty lists [] causes Pool._cache to hang on to the MapResults forever: tp = ThreadPool(5) xs = tp.map(lambda x: 'a' * int(10e6), range(100)) # now using 1GB mem = 100 * 10MB strs del xs gc.collect() # still using 1GB mem tp.clo

[issue13542] Memory leak in multiprocessing.pool

2011-12-06 Thread Yang Zhang
Yang Zhang added the comment: Oops, sorry - pasted a wrong example. In [38]: tp = ThreadPool(5) In [39]: xs = tp.map(lambda x: x, []) In [40]: xs Out[40]: [] In [41]: tp._cache Out[41]: {3: } -- ___ Python tracker

[issue13464] HTTPResponse is missing an implementation of readinto

2011-12-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 806cfe39f729 by Antoine Pitrou in branch 'default': Issue #13464: Add a readinto() method to http.client.HTTPResponse. http://hg.python.org/cpython/rev/806cfe39f729 -- nosy: +python-dev ___ Python tracke

[issue13464] HTTPResponse is missing an implementation of readinto

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, thank you. I've now committed the patch in the default branch. Congratulations! (since the documentation doesn't claim that HTTPResponse implements RawIOBase, I tend to consider this a feature request rather than a bugfix, hence no 3.2 commit) -

[issue13543] shlex with string ending in space gives "ValueError: No closing quotation"

2011-12-06 Thread ekorn
New submission from ekorn : It seems shlex fails on processing strings ending in space, causing this bug that I reported for IPython: https://github.com/ipython/ipython/issues/1109 Fernando Perez made a minimal example of the problem, quoted below. As he points out, it would be best to fix thi

[issue13543] shlex with string ending in space gives "ValueError: No closing quotation"

2011-12-06 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue13543] shlex with string ending in space gives "ValueError: No closing quotation"

2011-12-06 Thread R. David Murray
R. David Murray added the comment: Why do you consider this to be a bug? You set posix=False and whitespace_split=True, so it seems to me that according to the documented rules the " inside the word ("a is as documented not recognized as a quote character. If you use either posix=True or wh

[issue13544] Add __qualname__ to functools.WRAPPER_ASSIGNMENTS

2011-12-06 Thread Nick Coghlan
New submission from Nick Coghlan : functools.update_wrapper() and functools.wraps() should copy the new property by default. -- keywords: easy messages: 148943 nosy: ncoghlan priority: release blocker severity: normal stage: needs patch status: open title: Add __qualname__ to functools.

[issue12555] PEP 3151 implementation

2011-12-06 Thread Nick Coghlan
Changes by Nick Coghlan : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13390] Hunt memory allocations in addition to reference leaks

2011-12-06 Thread Meador Inge
Meador Inge added the comment: I looked at the 'ctypes' "leak" a bit. I haven't determined exactly what is going on, but the leak has something to do with a change in the patch that runs 'dash_R_cleanup' twice instead of once. The new behavior can be reduced to something like: import sys,

[issue13390] Hunt memory allocations in addition to reference leaks

2011-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So, I am not sure whether there really is a leak, if this is just > a very senstive area of 'regrtest.py', or something else I am missing. Well, test_ctypes seems to be the only test exhibiting that behaviour. And since your script reproduces it, it's probabl

[issue8641] IDLE 3 doesn't highlights b"", but u""

2011-12-06 Thread Roger Serwy
Roger Serwy added the comment: I applied the patch against the latest version in the repository and it works correctly. -- nosy: +serwy type: -> behavior versions: +Python 3.2, Python 3.3 ___ Python tracker _

[issue11838] IDLE: make interactive code savable as a runnable script

2011-12-06 Thread Roger Serwy
Roger Serwy added the comment: This issue relates to #1178 A traceback does not necessarily mean that the last statement had the error. For example: >>> a = lambda: 1/0 >>> a() Traceback (most recent call last): File "", line 1, in a() File "", line 1, in

[issue11051] system calls per import

2011-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13511] ./configure --includedir, --libdir accept multiple

2011-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: You should request this new feature on autoc...@gnu.org or bug-autoc...@gnu.org mailing list. -- nosy: +Arfrever ___ Python tracker _

[issue11838] IDLE: make interactive code savable as a runnable script

2011-12-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: Interesting example. This issue is a bit more complicated than I thought. Clearly, the call that reveals an error in previous lines should not be simply deleted. -- ___ Python tracker

[issue11682] PEP 380 reference implementation for 3.3

2011-12-06 Thread Ron Adam
Ron Adam added the comment: There is a test for 'yield from' as a function argument without the extra parentheses. f(yield from x) You do need them in the case of a regular yield. f((yield)) or f((yield value)) Shouldn't the same rule apply in both cases? * I'm trying to do a