[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-10 Thread Maciej Szulik
Changes by Maciej Szulik : -- hgrepos: -232 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21194] json.dumps with ensure_ascii=False doesn't escape control characters

2014-04-10 Thread Weeble
New submission from Weeble: The JSON spec (http://www.json.org/) does not allow unescaped control characters. (See the railroad diagram for strings and the grammar on the right.) If json.dumps is called with ensure_ascii=False, it fails to escape control codes in the range U+007F to U+009F. He

[issue21194] json.dumps with ensure_ascii=False doesn't escape control characters

2014-04-10 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, pitrou, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue20539] math.factorial may throw OverflowError

2014-04-10 Thread Stefan Krah
Stefan Krah added the comment: OverflowError during initialization dates back to the early days of Python: http://hg.python.org/cpython/rev/0437738279a8 Integer arithmetic actually did raise OverflowError back then: >>> 2 * 22 Traceback (most recent call last): File

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

2014-04-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: #21140 is about saving Output Window (renamed) as .txt instead of .py. Same method should be used to save shell log as .txt. My idea is that File menu for shell window should, if possible, have both Save as log Save as runnable code -- __

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
New submission from Eric O. LEBIGOT: The documentation for a None (empty) format for floats indicates that it is equivalent to the g format. This does not appear to be correct (http://stackoverflow.com/questions/16525924/precise-definition-of-float-string-formatting). The Python 3.4 documentat

[issue21196] Name mangling example in Python tutorial

2014-04-10 Thread Chandan Kumar
New submission from Chandan Kumar: The example used for demonstrating name mangling could be better if two versions of code are shown - one with name mangling and one without. I have modified the original example to incorporate this (see attached). -- assignee: docs@python components:

[issue20539] math.factorial may throw OverflowError

2014-04-10 Thread Mark Dickinson
Mark Dickinson added the comment: Looks like this harmless-looking issue has opened up a can of worms. > the whole idea of OverflowError seems slightly outdated. Well, not entirely. It's still got a place for overflow of mathematical operations, and I think it's clearly the correct exception

[issue21196] Name mangling example in Python tutorial

2014-04-10 Thread Chandan Kumar
Chandan Kumar added the comment: Adding the second code sample, since only one attachment allowed at one go. -- Added file: http://bugs.python.org/file34782/without_name_mangling.py ___ Python tracker _

[issue21196] Name mangling example in Python tutorial

2014-04-10 Thread Chandan Kumar
Chandan Kumar added the comment: Here is a link to the documentation section in question: https://docs.python.org/2/tutorial/classes.html#private-variables-and-class-local-references -- ___ Python tracker

[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-10 Thread Jurko Gospodnetić
Jurko Gospodnetić added the comment: Just ran into this problem and it's so uncomfortable researching dynamic structures at run-time using PDB without this. :-( As a workaround, you can use a trick similar to this one to 'import' your locals into the list comprehension body: [l['r'](x) for

[issue20539] math.factorial may throw OverflowError

2014-04-10 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson wrote: > > the whole idea of OverflowError seems slightly outdated. > > Well, not entirely. It's still got a place for overflow of mathematical > operations, and I think it's clearly the correct exception in that case > (indeed, it's about the on

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: An empty format specifier can (and to my knowledge, does) match str(). So you get: >>> format(1e10, '') '100.0' >>> format(1e10, 'g') '1e+10' >>> str(1e10) '100.0' The SO question is asking about an empty "presentation type", which is indeed si

[issue20539] math.factorial may throw OverflowError

2014-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 273e17260d25 by Mark Dickinson in branch 'default': Issue #20539: Improve math.factorial error messages and types for large inputs. http://hg.python.org/cpython/rev/273e17260d25 -- nosy: +python-dev ___ P

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: These examples are good. I am confused, though, about "The SO question is asking about an empty "presentation type", which is indeed similar to 'g' for floats.": the question is actually about why the '' format gives a result that differs from the 'g' format

[issue20539] math.factorial may throw OverflowError

2014-04-10 Thread Mark Dickinson
Mark Dickinson added the comment: Patch applied to the default branch (but with OverflowError instead of ValueError for large positive inputs). I don't see a lot of benefit in applying the fix to the maintenance branches. Closing this issue. -- resolution: -> fixed status: open -> c

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Mark Dickinson
Mark Dickinson added the comment: I was wondering how the TypeError got there in the first place. Diving into the history is instructive: changeset cdfdd5359411 modified the exception message: taniyama:cpython mdickinson$ hg log -r19719 changeset: 19719:cdfdd5359411 branch: legacy-trun

[issue21197] venv does not create lib64 directory and appropriate symlinks

2014-04-10 Thread Matthias Dahl
New submission from Matthias Dahl: Creating a new venv on a multilib system does not install an appropriate link from lib to lib64 or the other way around. Currently, venv creates a single lib dir, but everything installed with pip within the venv, will be installed to lib64/... instead while

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agreed that there is no need to patch 2.7/3.4; this is a pedantic correctness fix, not a serious bug. -- ___ Python tracker ___ ___

[issue20434] Process crashes if not enough memory to import module

2014-04-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Could someone please review this patch? I'd like to see it committed asap. -- ___ Python tracker ___ ___

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue11975] Fix referencing of built-in types (list, int, ...)

2014-04-10 Thread Brigitta S
Brigitta S added the comment: I would like to reference the list methods in a documentation using intersphinx-ing e.g ":meth:`list.append`" etc. However there are no links generated for these. I may underestimate issues raised in this thread, but it naively seems that removing the :noindex:

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: The rule is: - if the entire format specifier is the empty string (not None, but ''), then return str(value) - else, look at the presentation type. if it is missing, set it to something like 'g' - do the normal float formatting using the presentation type The f

[issue21192] Idle: Print filename when running a file from editor

2014-04-10 Thread Adnan Umer
Adnan Umer added the comment: Method: runcode Class: ModifiedInterpreter Line: 752 Added if code.co_filename[0] != '<': self.tkconsole.write('Executing ' + code.co_filename + '\n') To print file path that is executed -- nosy: +Adnan.Umer versions: +Python 3.4 Added file: ht

[issue11975] Fix referencing of built-in types (list, int, ...)

2014-04-10 Thread Éric Araujo
Éric Araujo added the comment: > I may underestimate issues raised in this thread I re-read the discussion, these are the two main issues: 1) We’d like list/tuple/etc. documented in two different pages (as functions and as types), which causes issues when Sphinx builds its index of referencea

[issue20434] Process crashes if not enough memory to import module

2014-04-10 Thread Eric Snow
Eric Snow added the comment: I don't see a review link. Looks like your patch wasn't against tip (at attach-time) or you used the --git flag in diff. Having the patch in the review tool would be really would be really helpful. I'll take a look otherwise, but won't be able to immediately reg

[issue7980] time.strptime not thread safe

2014-04-10 Thread Erik Purins
Changes by Erik Purins : -- nosy: +epu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/m

[issue21198] Minor tarfile documentation bug

2014-04-10 Thread Andrew Scheller
New submission from Andrew Scheller: I've just noticed that the documentation for TarInfo.type says "To determine the type of a TarInfo object more conveniently, use the is_*() methods below." However none of the methods mentioned actually contain an underscore, so I believe the documentation

[issue20434] Process crashes if not enough memory to import module

2014-04-10 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ok, retrying without the --git flag (I thought that was recommended, it was once...) -- Added file: http://bugs.python.org/file34784/string_resize.patch ___ Python tracker

[issue20434] Process crashes if not enough memory to import module

2014-04-10 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : Removed file: http://bugs.python.org/file34779/string_resize.patch ___ Python tracker ___ ___ Python-bugs-

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Matt Mackall
New submission from Matt Mackall: Python's file_read uses an 'l' type to parse its args which results in a 31-bit size limit on reads on 64-bit Windows. It should instead use an ssize_t. Related Mercurial bug: http://bz.selenic.com/show_bug.cgi?id=4215 -- components: IO messages: 2158

[issue21198] Minor tarfile documentation bug

2014-04-10 Thread Berker Peksag
Changes by Berker Peksag : -- type: enhancement -> versions: -Python 3.1, Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python-b

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue9253] argparse: optional subparsers

2014-04-10 Thread paul j3
paul j3 added the comment: http://stackoverflow.com/questions/22990977/why-does-this-argparse-code-behave-differently-between-python-2-and-3 is answered by this change in how `required` arguments are tested, and how subparsers fell through the cracks. -- __

[issue7980] time.strptime not thread safe

2014-04-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-10 Thread Dima Tisnek
Dima Tisnek added the comment: I'm not sure if you are referring to Python's C-level fdopen or GNU libc fdopen. GNU libc fdopen does not consume file descriptor on error: #include #include #include #include #include #include #include int main(int argc, char** argv) { int fd = -1;

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Larry Hastings
Larry Hastings added the comment: Benjamin: given the brave new world of 2.7 living even longer, Guido said this sort of bug fix was fair game. Will you accept a patch for this in 2.7? -- assignee: -> larry nosy: +benjamin.peterson ___ Python track

[issue19628] maxlevels -1 on compileall for unlimited recursion

2014-04-10 Thread Claudiu.Popa
Claudiu.Popa added the comment: Ping. :) Can someone review this patch, please? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21194] json.dumps with ensure_ascii=False doesn't escape control characters

2014-04-10 Thread akira
akira added the comment: json.dumps works correctly in this case. Both json/application rfc [1] and ecma json standard [2] say: > All characters may be placed within the quotation marks, except for the > characters that must be escaped: quotation mark (U+0022), reverse solidus > (U+005C), and

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is much simpler for Mercurial to add a workaround (which they already did, apparently :-)), than to risk introducing regressions by fixing this. AFAIK nobody else complained before. -- nosy: +pitrou ___ Python tr

[issue7980] time.strptime not thread safe

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: There are probably reasons why the import is currently done lazily, so I would advise against changing this in 2.7, unless the reasons are investigated and clearly understood. -- ___ Python tracker

[issue21197] venv does not create lib64 directory and appropriate symlinks

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Which third party apps are these? AFAIK, venv's directory layout is private - it shouldn't be "interpreted" by other programs (as opposed to the system-level lib/lib64 layout). -- nosy: +pitrou, vinay.sajip ___ Pyth

[issue20924] openssl init 100% CPU utilization

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks. It would be nice if you could investigate why the underlying NT socket is in non-blocking mode (AFAIK, this issue hasn't been reported before). Also, it would be nice if you could check with Python 3 as well. -- ___

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: +1 for ValueError as well. -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > There's no real problem. I find "must be in the range [0, 255]" easier to > understand, but I also would not make a big effort to change this. The problem is that [0, 255] looks very much like a Python list, not a range. -- _

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-10 Thread Stefan Krah
Stefan Krah added the comment: There's no real problem. I find "must be in the range [0, 255]" easier to understand, but I also would not make a big effort to change this. As for me, we can close this issue. -- ___ Python tracker

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Uh, from the context, it's clear that the error is that 256 doesn't fit in the average 8-bits byte. Is there an actual problem here? (if you don't know what a byte is, you probably shouldn't use that form of the bytes() constructor) -- nosy: +pitrou

[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-10 Thread Geoffrey Spear
Changes by Geoffrey Spear : -- nosy: +geoffreyspear ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm curious: what is the use case for str subclasses in Path objects? If this is to be supported, I think I'd rather force-cast to str rather than accept arbitrary subclasses. -- ___ Python tracker

[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The OpenSSL command advertise itself as 0.9.8y but it doesn't include > any ECDH ciphers. Really? Apple's packaging looks almost criminal here. > FreeBSD 9 is failing as well: It's not necessarily the same issue as on OS X. Stefan, can you post the output

[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-10 Thread Stefan Krah
Stefan Krah added the comment: This is for FreeBSD-9 (which, to be fair, has EOL status): [stefan@freebsd-amd64 ~]$ openssl ciphers -v DHE-RSA-AES256-SHA SSLv3 Kx=DH Au=RSA Enc=AES(256) Mac=SHA1 DHE-DSS-AES256-SHA SSLv3 Kx=DH Au=DSS Enc=AES(256) Mac=SHA1 AES256-SHA

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Tim Peters
Tim Peters added the comment: Yup, agreed with all: ValueError makes a lot more sense, but the change shouldn't be backported. -- ___ Python tracker ___ ___

[issue20351] Add doc examples for DictReader and DictWriter

2014-04-10 Thread Charles-Axel Dein
Charles-Axel Dein added the comment: Hey - is there anything else I need to do here? -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue21191] os.fdopen() may eat file descriptor and still raise exception

2014-04-10 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Thu, Apr 10, 2014, at 10:46, Dima Tisnek wrote: > > Dima Tisnek added the comment: > > I'm not sure if you are referring to Python's C-level fdopen or GNU libc > fdopen. > > GNU libc fdopen does not consume file descriptor on error: > > #include > #inc

[issue21195] None float format: incomplete documentation

2014-04-10 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: The Python 2.7 goes even as far as to say that format(1e10, ' ') should give "the same as" format(1e10, ' g') (not something "similar to g"), which is obviously incorrect. If the Python 3.4 documentation for the empty presentation type of floats were used in

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-10 Thread Konstantin Zemlyak
Konstantin Zemlyak added the comment: To clarify few things: - Yes, I know that 256 doesn't fit into byte. I was checking how bytes/bytearray are handling overflow. - I know that range() is a half-open interval. Yet this error message still gave me a "wtf" moment because I didn't realize it w

[issue20397] distutils --record option does not validate existence of byte-compiled files

2014-04-10 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo stage: -> needs patch title: distutils --record option does not validate existance of byte-compiled files -> distutils --record option does not validate existence of byte-compiled files versions: +Python 3.4, Python 3.5 -Python 3.1, Pytho

[issue17861] put opcode information in one place

2014-04-10 Thread Éric Araujo
Éric Araujo added the comment: Patch looks good to me. -- nosy: +eric.araujo versions: +Python 3.5 -Python 3.4 ___ Python tracker ___

[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2014-04-10 Thread Éric Araujo
Éric Araujo added the comment: Michael, a patch including tests is ready for this issue. -- nosy: +eric.araujo stage: patch review -> commit review versions: +Python 3.5 -Python 3.3 ___ Python tracker _

[issue21177] ValueError: byte must be in range(0, 256)

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Yet this error message still gave me a "wtf" moment because I didn't realize it was talking about python's range() builtin and not about mathematical term. So even though this message is technically 100% correct it still doesn't feel right. If that "wtf" momen

[issue17660] mock.patch could whitelist builtins to not need create=True

2014-04-10 Thread Éric Araujo
Éric Araujo added the comment: Reviewed on Rietveld. -- nosy: +eric.araujo stage: needs patch -> patch review versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___