[issue16799] start using argparse.Namespace in regrtest

2013-08-12 Thread Eli Bendersky
Eli Bendersky added the comment: On Mon, Aug 12, 2013 at 12:41 PM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Here is a preliminary patch which get rids of > _convert_namespace_to_getopt() and directly uses a Namespace object. > Unfortunately it breaks tests because test

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- components: Interpreter Core nosy: rhettinger priority: normal severity: normal status: open title: Remove false optimizaton for equality comparison of hashed strings versions: Python 3.4 ___ Python tracker

[issue16799] start using argparse.Namespace in regrtest

2013-08-12 Thread Eli Bendersky
Eli Bendersky added the comment: On Mon, Aug 12, 2013 at 1:33 PM, Eli Bendersky wrote: > > Eli Bendersky added the comment: > > On Mon, Aug 12, 2013 at 12:41 PM, Serhiy Storchaka > wrote: > > > > > Serhiy Storchaka added the comment: > > > > Here is a preliminary patch which get rids of > > _con

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Raymond Hettinger
New submission from Raymond Hettinger: This code is only run when the kinds, lengths, and hashes match. So, the probability of the strings being equal is VERY high. Accordingly, there is no benefit to an earlier out test to see if the first characters differ. There is a modest benefit to com

[issue18585] Add a text truncation function

2013-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've committed after having addressed (most of) RDM's comments. -- resolution: -> fixed stage: patch review -> committed/rejected ___ Python tracker __

[issue18585] Add a text truncation function

2013-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset c27ec198d3d1 by Antoine Pitrou in branch 'default': Issue #18585: Add :func:`textwrap.shorten` to collapse and truncate a piece of text to a given length. http://hg.python.org/cpython/rev/c27ec198d3d1 -- nosy: +python-dev _

[issue18585] Add a text truncation function

2013-08-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Alex Gaynor
Alex Gaynor added the comment: does this show demonstrable results (in either direction) on stringbench or the benchmarks repo? -- nosy: +alex ___ Python tracker ___ ___

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread STINNER Victor
STINNER Victor added the comment: See also issues #16286 and #17628. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2013-08-12 Thread Tim Golden
Tim Golden added the comment: Thanks for the review, Ben. Updated patches attached. 1 & 3) default_encoding -- Your two points appear to contradict each other slightly. What's in the updated patches is: 3.x has no encoding (because everything's unicode end-to-end); 2.7 attempts to apply the d

[issue18718] datetime documentation contradictory on leap second support

2013-08-12 Thread David Wolever
David Wolever added the comment: Here's the relevant diff. Will commit on a +1. diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1664,7 +1664,7 @@ | ``%M``| Minute as a zero-padded| 00, 01, ..., 59

[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-12 Thread Eli Bendersky
New submission from Eli Bendersky: As part of original plan and since issue #18264 has been resolved, it's time to dust off some old patches I have for the socket.* module. The socket.AF_* and socket.SOCK_* constants are good candidates for IntEnum conversion. I'm attaching an initial patch th

[issue17701] Improving strftime documentation

2013-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1d4b02d8fa8a by David Wolever in branch '3.3': Issue #17701: Improving strftime documentation. http://hg.python.org/cpython/rev/1d4b02d8fa8a New changeset ab550dac6209 by David Wolever in branch 'default': Merge issue #17701: Improving strftime docu

[issue17701] Improving strftime documentation

2013-08-12 Thread David Wolever
David Wolever added the comment: Done, pushed to 2.7, 3.3, default. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue18585] Add a text truncation function

2013-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about a multiline summarize? The textwrap module is designed to work with multiline text. Let we want wrap 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' in 40 column and s

[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue18694] getxattr on Linux ZFS native filesystem happily returns partial values

2013-08-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: No, this extra code you're adding. :) 2013/8/12 Benjamin Peterson : > > Benjamin Peterson added the comment: > > Okay. Hopefully, we can kill that thing one day... > > -- > > ___ > Python tracker >

[issue18721] test for FTP cwd function

2013-08-12 Thread Muhammad Jehanzeb
New submission from Muhammad Jehanzeb: Test coverage for cwd function of ftplib directory. -- components: Tests messages: 195023 nosy: mjehanzeb priority: normal severity: normal status: open title: test for FTP cwd function versions: Python 3.3 ___ P

[issue18722] Remove uses of the register keyword

2013-08-12 Thread Antoine Pitrou
New submission from Antoine Pitrou: Attached patch removes all uses of the C "register" keyword in the CPython sources. -- components: Interpreter Core files: remove_register.patch keywords: patch messages: 195024 nosy: pitrou priority: low severity: normal stage: patch review status: o

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-12 Thread Felix Crux
Felix Crux added the comment: Working with wolever on the process, generated the attached patch. -- keywords: +patch nosy: +felixc, wolever Added file: http://bugs.python.org/file31263/18680.patch ___ Python tracker

[issue18722] Remove uses of the register keyword

2013-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: The benchmark suite doesn't show any significant speedup or slowdown generally: Report on Linux fsol 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64 x86_64 Total CPU cores: 4 ### django_v2 ### Min: 0.672909 -> 0.659464: 1.02x faster Avg: 0.6

[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-12 Thread Eli Bendersky
Eli Bendersky added the comment: Attaching updated patch answering Ethan's review. Also added a tiny sanity test that makes sure that AF_INET is indeed an enum. A more comprehensive test probably won't hurt for the final patch. -- Added file: http://bugs.python.org/file31264/socket-int

[issue18722] Remove uses of the register keyword

2013-08-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +mark.dickinson, skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue18722] Remove uses of the register keyword

2013-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: (amusingly, the two Python executables generated by gcc - with or without register - have exactly the same size, although their md5 hashes differ) -- ___ Python tracker __

[issue18722] Remove uses of the register keyword

2013-08-12 Thread STINNER Victor
STINNER Victor added the comment: +1 for removal of the register keyword. I hope that nowadays, no compiler needs register hint to be able to optimize correctly a function. GCC knows better than me which variables must be "optimized". -- nosy: +haypo _

[issue18721] test for FTP cwd function

2013-08-12 Thread Muhammad Jehanzeb
Changes by Muhammad Jehanzeb : -- keywords: +patch Added file: http://bugs.python.org/file31265/issue18721.patch ___ Python tracker ___ __

[issue18721] test for FTP cwd function

2013-08-12 Thread Muhammad Jehanzeb
Changes by Muhammad Jehanzeb : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
Eric Snow added the comment: This bit me today (under 2.7). -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f11683963558 by Felix Crux in branch 'default': Documenting that json.load may raise a ValueError. http://hg.python.org/cpython/rev/f11683963558 New changeset 905fad4cb40a by Felix Crux in branch 'default': Documenting that json.load may raise a Val

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-12 Thread David Wolever
Changes by David Wolever : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2013-08-12 Thread Ben Hoyt
Ben Hoyt added the comment: All looks great. I like what you've done with default_encoding now. Thanks, Tim (and Dave for the original report). -- ___ Python tracker ___ ___

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f8cf0f997dfa by Felix Crux in branch '3.3': Documenting that json.load may raise a ValueError. http://hg.python.org/cpython/rev/f8cf0f997dfa New changeset 524693d62093 by Felix Crux in branch '2.7': Documenting that json.load may raise a ValueError.

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eric, Could you share details of your use-case? My experience with subclassing from basic python types including date/time has been mostly negative. The problem is that when I subclass, I want to inherit the rich set of operations such as +, -, *, etc

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
Eric Snow added the comment: I'm doing some string-based serialization of datetimes and need to be able to specify the type somewhat declaratively. So I'm using a datetime subclass. This is more or less the code I'm using: class Timestamp(datetime.datetime): def __new__(cls, raw_value,

[issue18583] Idle: enhance FormatParagraph

2013-08-12 Thread Phil Webster
Phil Webster added the comment: I've attached a patch that attempts to address the issues above. For the tests, I made some changes because the cursor doesn't end in exactly the same spot with line endings. Here's a quick summary of the changes: 1. Removed format_paragraph and format_comment m

[issue18707] the readme should also talk about how to build doc.

2013-08-12 Thread Madison May
Madison May added the comment: Here's a patch that adds a short sentence to the README's `Documentation` section that refers readers to the Doc/README.txt file. -- nosy: +madison.may Added file: http://bugs.python.org/file31267/README_v2.diff ___ Pyt

[issue18707] the readme should also talk about how to build doc.

2013-08-12 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the patch! One thing: Doc/README.txt does not actually mention how to contribute to the doc, does it? Maybe the main README should link to the devguide instead of or in addition to Doc/README.txt -- ___ Py

[issue18707] the readme should also talk about how to build doc.

2013-08-12 Thread Madison May
Madison May added the comment: Good point, Éric. It refers readers to the bug tracker, the Sphinx bug tracker, and d...@python.org in the `Contributing` section, but a link to the devguide would probably be more useful. I've tweaked the patch a bit to reflect this. -- Added file: htt

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Profiling the test suite shows that the short-cut branch NEVER gets taken. There are no cases where the string lengths, kinds, and 64-bit hashes match, but the stings themselves are a mismatch. The whole theory behind this optimization is invalid. The firs

[issue18707] the readme should also talk about how to build doc.

2013-08-12 Thread Madison May
Madison May added the comment: Or perhaps with an alternate wording: README_v4.diff -- Added file: http://bugs.python.org/file31269/README_v4.diff ___ Python tracker ___

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Alex Gaynor
Alex Gaynor added the comment: The statistic that htis is *never* hit across a large python program is great evidence that this isn't useful. +1 on removing from me. -- ___ Python tracker _

[issue18704] IDLE: PEP8 Style Check Integration

2013-08-12 Thread R. Jayakrishnan
Changes by R. Jayakrishnan : -- nosy: +philwebster ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue18583] Idle: enhance FormatParagraph

2013-08-12 Thread R. Jayakrishnan
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4073)

2013-08-12 Thread Arun Babu Neelicattu
Arun Babu Neelicattu added the comment: This issue has been assigned CVE-2013-4238 [1]. Please use CVE-2013-4238 for this issue in Python for patches and references. [1] http://www.openwall.com/lists/oss-security/2013/08/13/2 -- nosy: +abn ___ Pytho

[issue17997] ssl.match_hostname(): sub string wildcard should not match IDNA prefix

2013-08-12 Thread Ben Darnell
Changes by Ben Darnell : -- nosy: +Ben.Darnell ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- versions: +Python 2.7, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue18719] Remove false optimizaton for equality comparison of hashed strings

2013-08-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file31270/27.diff ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue18721] test for FTP cwd function

2013-08-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed in 6816ae6c49ce (2.7) 68b599740aa0 (3.3) f8942b8e6774 (tip) -- assignee: -> orsenthil nosy: +orsenthil resolution: -> fixed status: open -> closed versions: +Python 2.7, Python 3.4 ___ Python tracker

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-12 Thread Vajrasky Kok
New submission from Vajrasky Kok: In shorten function of textwrap module, the placeholder becomes a hole where we can inject non-normalized whitespaces to the text. >>> text = "Hello there, how are you this fine day? I'm glad to hear it!" >>> from textwrap import shorten >>> shorten(text, 40, p

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not convinced this is a bug. The whitespace right-stripping is more of an implementation detail. You can really put what you want inside the placeholder. -- ___ Python tracker

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, nevermind about non-normalized whitespaces in placeholder, but what about this case? >>> text = "Hello there, how are you this fine day? I'm glad to hear it!" >>> from textwrap import shorten >>> shorten(text, 10, placeholder=" ") 'Hello' >>> shorten(te

<    1   2