[issue19087] bytearray front-slicing not optimized

2013-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't see much sense in differences between bytea_slice2.patch and bytea_slice3.patch, because bytea_slice3.patch is not smaller and simpler than bytea_slice2.patch. I meant that you can continue use self->ob_bytes instead of PyByteArray_AS_STRING(self) i

[issue19156] Enum helper functions test-coverage

2013-10-04 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman nosy: +ethan.furman stage: -> patch review ___ Python tracker ___ ___ Python-

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not a bug, str accepts the encoding argument in Python 3. And in contrast to the decode method it works with arbitrary byte-like objects (i.e. array.array). -- nosy: +serhiy.storchaka ___ Python tracker <

[issue19087] bytearray front-slicing not optimized

2013-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I meant that you can continue use self->ob_bytes instead of > PyByteArray_AS_STRING(self) if self->ob_bytes points not to the > start of physical buffer, but to the start of logical byte array. > *This* will simplify the patch a lot. It will make the diff smal

[issue10049] Add a "no-op" (null) context manager to contextlib

2013-10-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue1673203] add identity function

2013-10-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue11011] More functools functions

2013-10-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Adam Davison
New submission from Adam Davison: If you pass an array containing nan to collections.Counter, rather than counting the number of 'nan's it outputs "'nan': 1" n times into the dictionary. I appreciate using this on an array of floats is a bit of an unusual case but I don't think this is the exp

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Mark Dickinson
Mark Dickinson added the comment: > Presumably this relates to the fact that nan != nan. Yep. What you're seeing is pretty much expected behaviour, and it matches how NaNs behave with respect to containment in other Python contexts: >>> x = float('nan') >>> y = float('nan') >>> s = {x} >>> x

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Adam Davison
Adam Davison added the comment: Thanks for the quick response. I'm really using a pandas Series, which is effectively a numpy array behind the scenes as far as I understand, the example I pasted was just to illustrate the behaviour. So the nans are being produced elsewhere, I don't really have

[issue19162] datetime.datetime.min.strftime('%Y') not working

2013-10-04 Thread Filip Zyzniewski
New submission from Filip Zyzniewski: The datetime class provides a min datetime object which is not formattable: on Python 2: $ python Python 2.7.3 (default, Apr 10 2013, 05:13:16) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime

[issue19163] PyString_Format with dict

2013-10-04 Thread hiroaki itoh
New submission from hiroaki itoh: http://docs.python.org/2.7/c-api/string.html#PyString_Format The documents says `The args argument must be a tuple.', But if format is like '%(key)s', PyString_Format claims args must be mapping protocol. (At least 2.7.3.) -- assignee: docs@python compo

[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Marco Buccini
New submission from Marco Buccini: When you try to use uuid.UUID() without arguments you get a TypeError exception saying that you can actually use an integer (while you cannot). Python 2.6.8 (default, Apr 26 2013, 16:24:53) [GCC 4.6.3] on linux2 >>> uuid.UUID() Traceback (most recent call la

[issue19162] datetime.datetime.min.strftime('%Y') not working

2013-10-04 Thread tomasz.zaleski
tomasz.zaleski added the comment: works correctly on python3.3: Python 3.3.2 (default, Oct 4 2013, 12:21:07) [GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime.min.strftime('%Y') '000

[issue19153] Embedding into a shared library fails again

2013-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > No custom builds. Every package from ubuntu repository. Psycopg2 installed by > pip You may have to rebuild packages using the custom Python, not the system Python, since the linker options have to be different (especially the "shared" part: Ubuntu's Python

[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Vajrasky Kok
Vajrasky Kok added the comment: The exception message is correct. You can give an integer argument. But you have to use keyword argument. >>> uuid.UUID(int=uuid.uuid4().int) UUID('62ad61e5-b492-4f01-81e6-790049051c4f') >From the documentation: __init__(self, hex=None, bytes=None, bytes_le=No

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Mark Dickinson
Mark Dickinson added the comment: > perhaps collections.Counter should handle nans as a special case I don't think that would be a good idea: I'd rather that collections.Counter didn't special case NaNs in any way, but instead treated NaNs following the same (admittedly somewhat awkward) rule

[issue19158] BoundedSemaphore.release() subject to races

2013-10-04 Thread Richard Oudkerk
Richard Oudkerk added the comment: Is BoundedSemaphore really supposed to be "robust" in the face of too many releases, or does it just provide a sanity check? I think that releasing a bounded semaphore too many times is a programmer error, and the exception is just a debugging aid for the pro

[issue19155] Display stack info with color in pdb (the "w" command)

2013-10-04 Thread R. David Murray
R. David Murray added the comment: I think we are unlikely to do this, as pdb is a very simple text interface. I'm sure a patch would be considered if one was offered, but the increase in complexity of the codebase would need to be minimal for it to be accepted, and I suspect the feature woul

[issue19155] Display stack info with color in pdb (the "w" command)

2013-10-04 Thread Ezio Melotti
Ezio Melotti added the comment: Agreed with David. You can use https://bitbucket.org/antocuni/pdb/src instead. -- nosy: +ezio.melotti resolution: -> rejected stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue19162] datetime.datetime.min.strftime('%Y') not working

2013-10-04 Thread R. David Murray
R. David Murray added the comment: Indeed, this is already fixed. This issue is a duplicate of issue 1777412. The bug will not be fixed in earlier versions for the reasons discussed in that issue. -- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status

[issue14455] plistlib unable to read json and binary plist files

2013-10-04 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'd really like to include this patch in 3.4, but haven't managed to do any opensource work in the previous period and don't know when I'll be able to actually commit this (and more importantly, be available when issues crop up) :-( -- _

[issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-10-04 Thread Brett Cannon
Brett Cannon added the comment: It looks like as long as you block _frozen_importlib and do a fresh import of importlib you can make sure to use the source version of importlib._bootstrap instead of _frozen_importlib. >>> from test.support import import_fresh_module >>> mod = import_fresh_mod

[issue16803] Make test_import & test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-10-04 Thread Brett Cannon
Changes by Brett Cannon : -- title: Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap -> Make test_import & test_importlib run tests under both _frozen_importlib and importlib._bootstrap ___ Python tracker

[issue19163] PyString_Format with dict

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 405245885569 by Benjamin Peterson in branch '2.7': dict is also allowed (closes #19163) http://hg.python.org/cpython/rev/405245885569 -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed __

[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Georg Brandl
Georg Brandl added the comment: Yeah, the first message should probably say "one of the hex, bytes, bytes_le, fields, or int arguments must be given" -- nosy: +georg.brandl ___ Python tracker _

[issue18716] Deprecate the formatter module

2013-10-04 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed ___ Python tracker ___

[issue18716] Deprecate the formatter module

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 04ff1cc40d62 by Brett Cannon in branch 'default': Issue #18716: Deprecate the formatter module http://hg.python.org/cpython/rev/04ff1cc40d62 -- nosy: +python-dev ___ Python tracker

[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-04 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: brett.cannon components: Library (Lib) nosy: brett.cannon priority: normal severity: normal status: open title: Change formatter warning to DeprecationWarning in 3.5 versions: Python 3.5 ___ Python tracker

[issue19166] Unusued variable in test_keys in Lib/test/test_dict.py

2013-10-04 Thread Vajrasky Kok
New submission from Vajrasky Kok: This is the test. def test_keys(self): d = {} self.assertEqual(set(d.keys()), set()) d = {'a': 1, 'b': 2} k = d.keys() self.assertIn('a', d) self.assertIn('b', d) self.assertRaises(TypeError, d.keys, Non

[issue16803] Make test_import & test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-10-04 Thread Brett Cannon
Brett Cannon added the comment: Turns out this isn't as clean-cut as simply using test.support.import_fresh_module() as you end up with different instances of importlib._bootstrap which kills any possible subclass checks, etc. between e.g. importlib.abc and importlib.machinery as the source ve

[issue6028] Interpreter aborts when chaining an infinite number of exceptions

2013-10-04 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue19158] BoundedSemaphore.release() subject to races

2013-10-04 Thread Tim Peters
Tim Peters added the comment: Richard, that's a strange argument ;-) Since, e.g., a BoundedSemaphore(1) is semantically equivalent to a mutex, it's like saying some_mutex.release() usually raises an exception if the mutex isn't held at the time - but maybe it won't. If the docs _say_ it's no

[issue16803] Make test_import & test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset f0416b2b5654 by Brett Cannon in branch 'default': Issue #16803: Run test.test_importlib.test_abc under both http://hg.python.org/cpython/rev/f0416b2b5654 -- nosy: +python-dev ___ Python tracker

[issue19153] Embedding into a shared library fails again

2013-10-04 Thread Rinat
Rinat added the comment: > Or perhaps you can dlopen the CPython shared library with the RTLD_GLOBAL > flag. I don't know. Yes, it works. I made it is my shared library before boost block like this { void* handle = dlopen("libpython2.7.so", RTLD_LAZY | RTLD_GLOBAL); // boost wrapper for py

[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2013-10-04 Thread Phil Connell
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue19153] Embedding into a shared library fails again

2013-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, making it a documentation issue in case it deserves clarification in the docs. -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python ___ Python tracker

[issue19119] duplicate test name in Lib/test/test_heapq.py

2013-10-04 Thread STINNER Victor
STINNER Victor added the comment: @Xavier de Gaye: Nice, you found many similar issues. How did you find them? Would it be possible to automate the detection of duplicated test names? -- nosy: +haypo ___ Python tracker

[issue19167] sqlite3 cursor.description varies across Linux (3.3.1), Win32 (3.3.2), when selecting from a view.

2013-10-04 Thread mpb
New submission from mpb: On Win32, when I select from an SQLite view, and enclose the column name in double quotes in the select query, the cursor description (erroneously?) contains the double quotes. On Linux (or on Win32 when selecting from a table rather than a view) the cursor descriptio

[issue18679] include a codec to handle escaping only control characters but not any others

2013-10-04 Thread Derek Wilson
Derek Wilson added the comment: Any update on this? Just so you can see what my work around is, I'll paste in the code I'm using. The major issue I have with this is that performance doesn't scale to large strings. This is also a bytes-to-bytes or str-to-str encoding, because this is the type

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: Correct, my characterization above was wrong (I shouldn't write these up without the interpreter right in front of me). What is wrong with the conversion is: unicode("", "utf-8") in python 2.x should become either str(b"", "utf-8") or, better, just "" in Py

[issue19119] duplicate test name in Lib/test/test_heapq.py

2013-10-04 Thread Xavier de Gaye
Xavier de Gaye added the comment: It was proposed, in issue 16056, to enhance `make patchcheck` with the detection of duplicate code names. This triggered the creation of issue 16079. The script named duplicate_code_names_2.py, in issue 16079, listed about 20 duplicate names among all the non-nes

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2013-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just add the "b" prefix to literal string argument of unicode() in Python 2. -- ___ Python tracker ___ ___

[issue19168] pprint.pprint(..., compact=True) not implemented

2013-10-04 Thread Alexis Layton
New submission from Alexis Layton: Documentation for 3.4 states that the compact keyword-only argument has been added to 3.4. However: Python 3.4.0a3 (default, Oct 2 2013, 14:05:02) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pprint >

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

2013-10-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue19168] pprint.pprint(..., compact=True) not implemented

2013-10-04 Thread Ezio Melotti
Ezio Melotti added the comment: This a very recent change, see #19132. Python 3.4.0a3+ (default:f0416b2b5654, Oct 5 2013, 02:10:25) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pprint >>> pprint.pprint(3, compact=True) 3 -- nos

[issue18594] C accelerator for collections.Counter is slow

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4cec1116e5c by Raymond Hettinger in branch '3.3': Issue #18594: Make the C code more closely match the pure python code. http://hg.python.org/cpython/rev/e4cec1116e5c -- ___ Python tracker

[issue19166] Unusued variable in test_keys in Lib/test/test_dict.py

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 92c2e76ca595 by Ezio Melotti in branch '2.7': #19166: use an unused var in a test. Patch by Vajrasky Kok. http://hg.python.org/cpython/rev/92c2e76ca595 New changeset 33bbc60705e8 by Ezio Melotti in branch '3.3': #19166: use an unused var in a test.

[issue19166] Unusued variable in test_keys in Lib/test/test_dict.py

2013-10-04 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report and the patch! -- assignee: -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> enhancement versions: +Python 2.7, Python 3.3 __

[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___ Python-bugs-l

[issue19111] 2to3 should remove from future_builtins import *

2013-10-04 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy nosy: +ezio.melotti stage: -> needs patch versions: +Python 2.7 -Python 2.6 ___ Python tracker ___ _

[issue19154] AttributeError: 'NoneType' in http/client.py when using select when file descriptor is closed.

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> test needed type: crash -> behavior versions: -Python 2.6, Python 3.1, Python 3.2 ___ Python tracker ___

[issue19124] os.execv executes in background on Windows

2013-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: In general, os module functions lightly wrap the corresponding operating system calls. It does not mask differences between OSes, or between versions of an OS. So the unix-windows difference is not a bug and the behavior will not change. The difference could,

[issue19129] 6.2.1. Regular Expression Syntax flags

2013-10-04 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> needs patch versions: +Python 2.7, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list ma

[issue19148] Minor issues with Enum docs

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset db94fc7218fa by Ezio Melotti in branch 'default': #19148: fix markup errors and wording in enum docs. Patch by Esa Peuha. http://hg.python.org/cpython/rev/db94fc7218fa -- nosy: +python-dev ___ Python tra

[issue19148] Minor issues with Enum docs

2013-10-04 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report and the patch! I used a slightly different wording than the one you suggested because the rest of the document doesn't seem to use "you". -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage

[issue19150] IDLE shell fails: "ModifiedInterpreter instance has no attribute 'interp'"

2013-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: By default, Idle runs user code in a separate process from the idle process that runs shell and edit windows. Because connecting the two processes sometimes fails, there is a start-up option -N (No subprocess) that run your code in the same process as idle cod

[issue19152] ExtensionFileLoader missing get_filename()

2013-10-04 Thread Eric Snow
Changes by Eric Snow : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue19152] ExtensionFileLoader missing get_filename()

2013-10-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 62d045a873bb by Eric Snow in branch 'default': [issue 19152] Ensure we have actually registered ExtensionFileLoader as an ExecutionLoader. http://hg.python.org/cpython/rev/62d045a873bb New changeset e9554199620f by Eric Snow in branch 'default': [i

[issue19154] AttributeError: 'NoneType' in http/client.py when using select when file descriptor is closed.

2013-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Changing the API of HTTPResponse.fileno is a feature change, not a bug fix. I do not think it should be changed as it would break existing code to no purpose. Instead, calls should continue to wrapped in try: except ValueError when failure is possible. And thi

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, serhiy.storchaka stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is the sort of issue that makes me think that there should be a single nan object (perhaps an instance of a Nan(float) subclass with a special __eq__ method ;-). Pending that, I agree with closing as "won't fix". -- nosy: +terry.reedy ___

[issue19129] 6.2.1. Regular Expression Syntax flags

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy type: -> enhancement versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list

[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2013-10-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue19161] collections Counter handles nan strangely

2013-10-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-10-04 Thread Eric Snow
Eric Snow added the comment: Here's an initial patch. Some key things left to do: * unit tests * documentation * implement exec_module() for the various importlib loaders. Once that's squared away there are further things that will be addressed in new tickets (or at least separate patches).

[issue18862] Implement __subclasshook__() for Finders and Loaders in importlib.abc

2013-10-04 Thread Eric Snow
Eric Snow added the comment: Here's a patch. -- keywords: +patch stage: test needed -> patch review Added file: http://bugs.python.org/file31960/issue18862-importlib-abc-subclasshooks.diff ___ Python tracker _