[issue1146] TextWrap vs words 1-character shorter than the width
Quentin Gallet-Gilles added the comment: The bug is present in trunk and has been there since rev 33955. This revision contained a fix to an infinite loop when indentation was set longer than width with long word breaking enabled. In that case, it would strip off at least one character on every pass. The fix was however a bit too general, leading to the reported bug. The added patch makes sure this doesn't happen anymore when indentation isn't involved. -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1146> __Index: Lib/textwrap.py === --- Lib/textwrap.py (revision 58153) +++ Lib/textwrap.py (working copy) @@ -173,7 +173,12 @@ Handle a chunk of text (most likely a word, not whitespace) that is too long to fit in any line. """ -space_left = max(width - cur_len, 1) +# Figure out when indent is larger than the specified width, and make +# sure at least one character is stripped off on every pass +if self.width > width: +space_left = max(width - cur_len, 1) +else: +space_left = width - cur_len # If we're allowed to break long words, then do so: put as much # of the next chunk onto the current line as will fit. Index: Lib/test/test_textwrap.py === --- Lib/test/test_textwrap.py (revision 58153) +++ Lib/test/test_textwrap.py (working copy) @@ -398,6 +398,19 @@ ' o'], subsequent_indent = ' '*15) +# bug 1146. Prevent a long word to be wrongly wrapped when the +# preceding word is exactly one character shorter than the width +self.check_wrap(self.text, 12, +['Did you say ', + '"supercalifr', + 'agilisticexp', + 'ialidocious?', + '" How *do*', + 'you spell', + 'that odd', + 'word,', + 'anyways?']) + def test_nobreak_long(self): # Test with break_long_words disabled self.wrapper.break_long_words = 0 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1146] TextWrap vs words 1-character shorter than the width
Quentin Gallet-Gilles added the comment: The previous patch is suboptimal and doesn't solve all cases. This one does. My apologies. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1146> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1146] TextWrap vs words 1-character shorter than the width
Changes by Quentin Gallet-Gilles: __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1146> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1127] No tests for inspect.getfullargspec()
New submission from Quentin Gallet-Gilles: I created 4 tests, see attached 'test_getfullargspec.diff' patch. 2 tests verify that getargspec raises ValueError when trying to call it with the function containing keyword-only arguments or annotations. The 2 others call getfullargspec and check everything returned is as expected. Are some more tests needed ? -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1127> __Index: Lib/test/test_inspect.py === --- Lib/test/test_inspect.py (revision 58231) +++ Lib/test/test_inspect.py (working copy) @@ -306,9 +306,8 @@ got = inspect.getmro(D) self.assertEqual(expected, got) -def assertArgSpecEquals(self, routine, args_e, varargs_e = None, -varkw_e = None, defaults_e = None, -formatted = None): +def assertArgSpecEquals(self, routine, args_e, varargs_e=None, +varkw_e=None, defaults_e=None, formatted=None): args, varargs, varkw, defaults = inspect.getargspec(routine) self.assertEqual(args, args_e) self.assertEqual(varargs, varargs_e) @@ -318,14 +317,48 @@ self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults), formatted) +def assertFullArgSpecEquals(self, routine, args_e, varargs_e=None, +varkw_e=None, defaults_e=None, +kwonlyargs_e=[], kwonlydefaults_e=None, +ann_e={}, formatted=None): +args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \ +inspect.getfullargspec(routine) +self.assertEqual(args, args_e) +self.assertEqual(varargs, varargs_e) +self.assertEqual(varkw, varkw_e) +self.assertEqual(defaults, defaults_e) +self.assertEqual(kwonlyargs, kwonlyargs_e) +self.assertEqual(kwonlydefaults, kwonlydefaults_e) +self.assertEqual(ann, ann_e) +if formatted is not None: +self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults, +kwonlyargs, kwonlydefaults, ann), + formatted) + def test_getargspec(self): -self.assertArgSpecEquals(mod.eggs, ['x', 'y'], formatted = '(x, y)') +self.assertArgSpecEquals(mod.eggs, ['x', 'y'], formatted='(x, y)') self.assertArgSpecEquals(mod.spam, ['a', 'b', 'c', 'd', 'e', 'f'], 'g', 'h', (3, 4, 5), '(a, b, c, d=3, e=4, f=5, *g, **h)') +self.assertRaises(ValueError, self.assertArgSpecEquals, + mod2.keyworded, []) + +self.assertRaises(ValueError, self.assertArgSpecEquals, + mod2.annotated, []) + +def test_getfullargspec(self): +self.assertFullArgSpecEquals(mod2.keyworded, [], varargs_e='arg1', + kwonlyargs_e=['arg2'], + kwonlydefaults_e={'arg2':1}, + formatted='(*arg1, arg2=1)') + +self.assertFullArgSpecEquals(mod2.annotated, ['arg1'], + ann_e={'arg1':types.ListType}, + formatted='(arg1: list)') + def test_getargspec_method(self): class A(object): def m(self): Index: Lib/test/inspect_fodder2.py === --- Lib/test/inspect_fodder2.py (revision 58231) +++ Lib/test/inspect_fodder2.py (working copy) @@ -97,3 +97,11 @@ return 42 return X method_in_dynamic_class = f().g.im_func + +#line 101 +def keyworded(*arg1, arg2=1): +pass + +#line 105 +def annotated(arg1: list): +pass ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1127] No tests for inspect.getfullargspec()
Quentin Gallet-Gilles added the comment: Alright, thanks! __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1127> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1437] List member inside a class is shared by all instances of the class
Quentin Gallet-Gilles added the comment: That's the expected behavior, actually. The variables 'arr' and 's' are static variables in the class Blah. This is discussed in several places in the doc and the FAQ, e.g. http://www.python.org/doc/faq/programming/#how-do-i-create-static-class-data-and-static-class-methods What you're looking for is : class Blah: def __init__(self, s): self.arr= [] self.s = s ... -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1437> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1486] Idle tab command completion
Quentin Gallet-Gilles added the comment: Couldn't reproduce it either, with the following IDLE config: Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 IDLE 1.2.1 No Subprocess -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1486> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2775] Implement PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I'm working on renaming the ConfigParser module. -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2775> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2775] Implement PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I've found some places where configparser, copyreg, queue and socketserver haven't been renamed. The attached patch 'renaming_leftovers_2.6.patch' corrects this. I'm working on renaming markupbase in 2.6 as of now. Added file: http://bugs.python.org/file10326/renaming_leftovers_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2775> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
New submission from Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Before applying the attached patch, the command 'svn move Lib/markupbase.py Lib/_markupbase.py" must be invoked. Little reminder : since the changes are already applied in the 3.0 codebase, the patch should also be blocked from the py3k branch. I'll also add another patch with the 2to3 import fixer. -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool), Library (Lib) files: markupbase_renaming_2.6.patch keywords: patch messages: 66850 nosy: collinwinter, quentin.gallet-gilles severity: normal status: open title: Patch to rename markupbase to _markupbase type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file10327/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10328/markupbase_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Updated patch : I forgot to add a check in test___all__ Added file: http://bugs.python.org/file10329/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10327/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Actually, the test___all__ check is an error since _markupbase has no __all__ attribute. I've restored the first version of the patch. Added file: http://bugs.python.org/file10330/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10329/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I'll update the patches to reflect that. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] 2to3 fixer to rename markupbase to _markupbase
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Well, there's only the fixer to apply. -- components: -Library (Lib) title: Patch to rename markupbase to _markupbase -> 2to3 fixer to rename markupbase to _markupbase Added file: http://bugs.python.org/file10388/markupbase_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10330/markupbase_renaming_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] Patch to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10328/markupbase_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I'm working on it. -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] 2to3 fixer to rename markupbase to _markupbase
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Thanks Brett. About the Misc/ACKS file I promise I'll contribute more than just an import fixer ! On Thu, May 22, 2008 at 5:19 AM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Brett Cannon <[EMAIL PROTECTED]> added the comment: > > Applied in r63533 to 2to3 in the fixer. I also added you, Quentin to > Misc/ACKS in the trunk. > > -- > resolution: -> accepted > status: open -> closed > > __ > Tracker <[EMAIL PROTECTED]> > <http://bugs.python.org/issue2861> > __ > ___ > Python-bugs-list mailing list > Unsubscribe: > http://mail.python.org/mailman/options/python-bugs-list/qgallet%40gmail.com > > Added file: http://bugs.python.org/file10396/unnamed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __Thanks Brett. About the Misc/ACKS file I promise I'll contribute more than just an import fixer !On Thu, May 22, 2008 at 5:19 AM, Brett Cannon <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> wrote: Brett Cannon <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> added the comment: Applied in r63533 to 2to3 in the fixer. I also added you, Quentin to Misc/ACKS in the trunk. -- resolution: -> accepted status: open -> closed __ Tracker <mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> <http://bugs.python.org/issue2861"; target="_blank">http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/qgallet%40gmail.com"; target="_blank">http://mail.python.org/mailman/options/python-bugs-list/qgallet%40gmail.com ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2861] 2to3 fixer to rename markupbase to _markupbase
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10396/unnamed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2861> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Ok, here are the patches. Since it's a combination of renaming and removing, I had to improvize a little, particularly in the 2.6 documentation. Hope it's done correctly. I still have doubts about the following issue, as commented in test_commands.py : # The module says: # "NB This only works (and is only relevant) for UNIX." # # Actually, getoutput should work on any platform with an os.popen, but # I'll take the comment as given, and skip this suite. I played it safe as well and didn't change the platform test (both in trunk/test_py3kwarn and py3k/test_subprocess). Should this restriction remain ? -- keywords: +patch Added file: http://bugs.python.org/file10412/remove_commands.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Ok, here are the patches. Since it's a combination of renaming and removing, I had to improvise a little (particularly in the 2.6 documentation). Hope it's done correctly. I still have doubts about the following issue. As commented in test_commands.py: # The module says: # "NB This only works (and is only relevant) for UNIX." # # Actually, getoutput should work on any platform with an os.popen, but # I'll take the comment as given, and skip this suite. I also decided to play it safe and didn't change the test (both in trunk/test_py3kwarn and py3k/test_subprocess). Should this restriction remain? Added file: http://bugs.python.org/file10413/remove_commands.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10412/remove_commands.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Sorry for the double post Added file: http://bugs.python.org/file10414/commands_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2872] Remove commands for PEP 3108
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10415/commands_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2872> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2775] Implement PEP 3108
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: While working on the commands module removal, I found two missed import renaming in the py3k branch that made regrtest skip some tests. The attached patch corrects them. Added file: http://bugs.python.org/file10416/import_renames_py3k.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2775> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2877] Backport UserString move from 3.0
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I only see UserString in the collections module. Has MutableString been removed in 3.0 ? -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2877> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2878] Backport UserList move in 3.0
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Attaching a patch for the import fixer of UserList. -- keywords: +patch nosy: +quentin.gallet-gilles Added file: http://bugs.python.org/file10448/userlist_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2878> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2877] Backport UserString move from 3.0
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Attaching a patch for the deprecation warning in 2.6 of the MutableString class. The import fixer for 2to3 is coming next. -- keywords: +patch Added file: http://bugs.python.org/file10454/userstring_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2877> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2877] Backport UserString move from 3.0
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10455/userstring_import_fixer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2877> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2419] Remove all IRIX dependant modules from aifc module
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I think this issue should be closed as a duplicate of issue 2847. -- nosy: +quentin.gallet-gilles ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2419> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2847] Remove cl usage from aifc
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I'm working on this one. -- nosy: +quentin.gallet-gilles ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2847> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2847] Remove cl usage from aifc
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: The attached patch removes all cl references from the aifc module and updates it to make it usable in 3.0. It also supports more compression types because audioop has been enhanced throughout the years (i.e. support for alaw encoding since 2.5). The changes are the following : - replace strings with bytes for frames read from an aiff/aifc file. - replace / by // to have integer division back - added ulaw (as an alternative of ULAW) and alaw/ALAW compression because audioop supports them (I've tested them successfully, using the samples from this URL : http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Samples.html ) - removed all tests when trying to import audioop : they can't fail anymore. - a bit of PEP-8 cleanup I'm not an AIFF/AIFC expert, so criticism is welcome! -- keywords: +patch Added file: http://bugs.python.org/file10499/aifc_3.0.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2847> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2847] Remove cl usage from aifc
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Updated the patch with the following corrections/improvements : - corrected a missed str -> bytes - replace % formatting occurrences with str.format() - more PEP-8 conformance Added file: http://bugs.python.org/file10506/aifc_3.0.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2847> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2847] Remove cl usage from aifc
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10499/aifc_3.0.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2847> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue798876] windows sys.path contains nonexistant directory
Quentin Gallet-Gilles added the comment: I'm able to reproduce it on 2.4, 2.5 and it's most likely still here in the trunk. Is it still considered a bug ? >>> import sys >>> import os >>> for file in sys.path: ... print "%s - %s" % (file, os.path.exists(file)) ... : False C:\WINNT\system32\python25.zip : False C:\PYTHON25 : True C:\Python25\DLLs : True C:\Python25\lib : True C:\Python25\lib\plat-win : False C:\Python25\lib\lib-tk : True C:\Python25\lib\site-packages : True -- nosy: +quentin.gallet-gilles versions: +Python 2.4, Python 2.5 Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue798876> ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1658] "RuntimeError: dictionary changed size during iteration" in Tkinter
New submission from Quentin Gallet-Gilles: While investigating for the stdlib reorg of Tkinter, I came across the following error: ~/dev/py3k$ ./python Lib/lib-tk/Dialog.py Traceback (most recent call last): File "Lib/lib-tk/Dialog.py", line 45, in Pack: {}}) File "/home/quentin/dev/py3k/Lib/lib-tk/Tkinter.py", line 1996, in __init__ Widget.__init__(self, master, 'button', cnf, kw) File "/home/quentin/dev/py3k/Lib/lib-tk/Tkinter.py", line 1921, in __init__ for k in cnf.keys(): RuntimeError: dictionary changed size during iteration The attached patch adds list() around the dict.keys() call. On a related note, this doesn't appear to be an isolated error, since a similar issue (#1649) was recently fixed in r59554. Would it be a good idea to look for other identical cases ? -- components: Tkinter files: tkinter_dictkeys.patch messages: 58805 nosy: quentin.gallet-gilles severity: normal status: open title: "RuntimeError: dictionary changed size during iteration" in Tkinter type: crash versions: Python 3.0 Added file: http://bugs.python.org/file8995/tkinter_dictkeys.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1658> __Index: Lib/lib-tk/Tkinter.py === --- Lib/lib-tk/Tkinter.py (revision 59567) +++ Lib/lib-tk/Tkinter.py (working copy) @@ -1918,7 +1918,7 @@ self.widgetName = widgetName BaseWidget._setup(self, master, cnf) classes = [] -for k in cnf.keys(): +for k in list(cnf.keys()): if isinstance(k, type): classes.append((k, cnf[k])) del cnf[k] ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1671] "World" tool ported to py3k
New submission from Quentin Gallet-Gilles: The title says it all. I also updated the country codes and other TLDs as things have evolved a bit since 2002. -- components: Demos and Tools files: world_tool.patch messages: 58874 nosy: quentin.gallet-gilles severity: normal status: open title: "World" tool ported to py3k versions: Python 3.0 Added file: http://bugs.python.org/file9011/world_tool.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1671> __Index: Tools/world/world === --- Tools/world/world (révision 59567) +++ Tools/world/world (copie de travail) @@ -42,7 +42,7 @@ The latest known change to this information was: -Friday, 5 April 2002, 12.00 CET 2002 +Monday, 10 October 2006, 17:59:51 UTC 2006 This script also knows about non-geographic top-level domains, and the additional ccTLDs reserved by IANA. @@ -91,9 +91,9 @@ def usage(code, msg=''): -print __doc__ % globals() +print(__doc__ % globals()) if msg: -print msg +print(msg) sys.exit(code) @@ -104,11 +104,11 @@ # no top level domain found, bounce it to the next step return rawaddr addr = parts[-1] -if nameorgs.has_key(addr): -print rawaddr, 'is in the', nameorgs[addr], 'top level domain' +if addr in nameorgs: +print(rawaddr, 'is in the', nameorgs[addr], 'top level domain') return None -elif countries.has_key(addr): -print rawaddr, 'originated from', countries[addr] +elif addr in countries: +print(rawaddr, 'originated from', countries[addr]) return None else: # Not resolved, bounce it to the next step @@ -129,11 +129,11 @@ return regexp if len(matches) == 1: code = matches[0] -print regexp, "matches code `%s', %s" % (code, all[code]) +print(regexp, "matches code `%s', %s" % (code, all[code])) else: -print regexp, 'matches %d countries:' % len(matches) +print(regexp, 'matches %d countries:' % len(matches)) for code in matches: -print "%s: %s" % (code, all[code]) +print("%s: %s" % (code, all[code])) return None @@ -141,14 +141,16 @@ def parse(file, normalize): try: fp = open(file) -except IOError, (err, msg): -print msg, ':', file +except IOError as err: +errno, msg = err.args +print(msg, ':', file) +return cre = re.compile('(.*?)[ \t]+([A-Z]{2})[ \t]+[A-Z]{3}[ \t]+[0-9]{3}') scanning = 0 if normalize: -print 'countries = {' +print('countries = {') while 1: line = fp.readline() @@ -163,7 +165,7 @@ elif line[0] == '-': break else: -print 'Could not parse line:', line +print('Could not parse line:', line) continue country, code = mo.group(1, 2) if normalize: @@ -173,30 +175,30 @@ # XXX special cases if w in ('AND', 'OF', 'OF)', 'name:', 'METROPOLITAN'): words[i] = w.lower() -elif w == 'THE' and i <> 1: +elif w == 'THE' and i != 1: words[i] = w.lower() elif len(w) > 3 and w[1] == "'": words[i] = w[0:3].upper() + w[3:].lower() elif w in ('(U.S.)', 'U.S.'): pass -elif w[0] == '(' and w <> '(local': +elif w[0] == '(' and w != '(local': words[i] = '(' + w[1:].capitalize() -elif w.find('-') <> -1: +elif w.find('-') != -1: words[i] = '-'.join( [s.capitalize() for s in w.split('-')]) else: words[i] = w.capitalize() code = code.lower() country = ' '.join(words) -print '"%s": "%s",' % (code, country) +print('"%s": "%s",' % (code, country)) else: -print code, country +print(code, country) elif line[0] == '-'
[issue1671] "World" tool ported to py3k
Quentin Gallet-Gilles added the comment: You're welcome :-) __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1671> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1671] "World" tool ported to py3k
Quentin Gallet-Gilles added the comment: That was quick, thanks! I'll make sure to remember that sorted() and keys() aren't needed together. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1671> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1146] TextWrap vs words 1-character shorter than the width
Quentin Gallet-Gilles added the comment: As i revisited this one for the Bug Day, I found I could optimize the patch a little bit. Here's the updated diff. Also... I think it's a good candidate for 2.5 maintenance release. Any thoughts ? Added file: http://bugs.python.org/file9216/textwrap_revised_r60075.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1146> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1714] ConfigParser.py do not allow leading (and trailing) space in values.
Quentin Gallet-Gilles added the comment: Attached patch contain the added behavior, some unit tests to validate it and updated documentation. -- nosy: +quentin.gallet-gilles Added file: http://bugs.python.org/file9217/cfgparser_doublequotes.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1714> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1714] ConfigParser.py do not allow leading (and trailing) space in values.
Quentin Gallet-Gilles added the comment: Here's an updated patch, taking in account akuchling and schmir suggestions. -- keywords: +patch Added file: http://bugs.python.org/file9523/cfgparser_doublequotes_r61014.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1714> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1524825] ConfigParser: accept leading whitespace on options+comments
Quentin Gallet-Gilles added the comment: I tried to come up with a patch, but the issue isn't as easy as it seems, the proposed change is too simplistic. Leading spaces in a line is already used for one purpose : continuations of a previous line. For instance : option = value continued here gives "option" as key and "value\n continued here" as value. The proposal conflicts with this behavior, since having : option1 = value1 option2 = value2 creates only one key-value pair "option1":"value1\n option2=value2" Adding blank lines doesn't solve the issue. The only case when it's treated correctly is when the options is the first one of a section/file: there's no continuation since there's no previous option defined. One solution could be to check for the presence of a delimiter (colon or equals sign) and not treat it as a continuation if that's the case, but that could potentially break existing configurations files, since nothing forbids you from using delimiters in the values. Any opinion ? (By the way, the leading whitespaces for comments isn't affected by all this, the implementation is simple) -- nosy: +quentin.gallet-gilles _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1524825> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1524825] ConfigParser: accept leading whitespace on options+comments
Quentin Gallet-Gilles added the comment: Okay, I'll upload a patch with unit tests and doc changes for the comment part in the next few days. _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1524825> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1524825] ConfigParser: accept leading whitespace on options+comments
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Didn't think "a few days" would translate into a month. My bad! Anyway, here's the promised patch. -- keywords: +patch Added file: http://bugs.python.org/file9848/cfgparser_comments.patch _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1524825> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1714] ConfigParser.py do not allow leading (and trailing) space in values.
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9217/cfgparser_doublequotes.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1714> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2479] Bytearray and io backport
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: I've just updated my trunk checkout on Ubuntu and run the regression test suite. All tests OK. -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2479> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2402] get rid of warnings in regrtest with -3
Changes by Quentin Gallet-Gilles <[EMAIL PROTECTED]>: -- nosy: +quentin.gallet-gilles __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2402> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2769] Small typo in whatsnew/2.6.rst
New submission from Quentin Gallet-Gilles <[EMAIL PROTECTED]>: In the "What's new" documentation for 2.6, a code marker is missing in the paragraph about itertools.permutations. Attached patch corrects this. -- assignee: georg.brandl components: Documentation files: whatsnew_2.6.patch keywords: patch messages: 66268 nosy: georg.brandl, quentin.gallet-gilles severity: normal status: open title: Small typo in whatsnew/2.6.rst versions: Python 2.6 Added file: http://bugs.python.org/file10197/whatsnew_2.6.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2769> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4620] Memory leak with datetime used with time.strptime
Quentin Gallet-Gilles <[EMAIL PROTECTED]> added the comment: Tried it with Python 2.5.2 on WinXP, I see no memory growth either. -- nosy: +quentin.gallet-gilles ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4620> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4645] configparser DEFAULT
Quentin Gallet-Gilles added the comment: This is already fixed in 2.6 since r60976, the related issue is #1781 I'm not sure this is a good candidate for 2.4.6 and 2.5.3 : this isn't a security fix, but I doubt fixing this would break existing code as I can't imagine people relying on this behavior. Adding Martin to the nosy list so he can pronounce. -- nosy: +loewis, quentin.gallet-gilles ___ Python tracker <http://bugs.python.org/issue4645> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4645] configparser DEFAULT
Changes by Quentin Gallet-Gilles : -- versions: +Python 2.5.3 -Python 2.4, Python 2.5 ___ Python tracker <http://bugs.python.org/issue4645> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1524639] Fix Tkinter Tcl-commands memory-leaks
Quentin Gallet-Gilles added the comment: A little remark : please replace "if not globals().has_key('TkinterError'):" by "if 'TkinterError' not in globals():". has_key is now deprecated in 2.6 and should be avoided. -- nosy: +quentin.gallet-gilles versions: -Python 2.5 ___ Python tracker <http://bugs.python.org/issue1524639> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4779] Can't import Tkinter
Quentin Gallet-Gilles added the comment: Tkinter has been renamed to tkinter (and been made a package) as part of the stdlib reorganisation : http://www.python.org/dev/peps/pep-3108/#tkinter-package -- nosy: +quentin.gallet-gilles ___ Python tracker <http://bugs.python.org/issue4779> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4786] xml.etree.ElementTree module name in Python 3
Quentin Gallet-Gilles added the comment: ElementTree is maintained externally, that's why it wasn't renamed during the stdlib reorganization : http://www.python.org/dev/peps/pep-3108/#open-issues -- nosy: +quentin.gallet-gilles ___ Python tracker <http://bugs.python.org/issue4786> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6964] import new fails
Quentin Gallet-Gilles added the comment: The 'new' module has been removed in python 3.0. The documentation advices you to use the 'types' modules instead (http://docs.python.org/library/new.html). I'm also pretty sure you get a message for this module if you enable the warnings at interpreter startup in python 2.6. -- nosy: +quentin.gallet-gilles ___ Python tracker <http://bugs.python.org/issue6964> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com