[issue4653] Patch to fix typos for Py3K

2008-12-12 Thread Johnny Lee
New submission from Johnny Lee : I ran my typo.pl perl script that locates possible C/C++ typos. I found four that looked valid. Two of the typos were in the Python directory {pythonrun.c, dynload_win.c}, two were in PC/bdist_wininst {install.c, extract.c}. Python/dynload_win.c: Win32 API For

[issue4652] IDLE does not work with Unicode

2008-12-12 Thread Aki Wakabayashi
New submission from Aki Wakabayashi : I have installed python 3.0 on Ubuntu 8.10 yesterday and played around with the new unicode features and had no problems with Japanese characters(both in interactive and script mode). However, after rebooting, IDLE will no longer let me input any Japanese cha

[issue4616] tarfile does not set the creation date and time of the extracted directories

2008-12-12 Thread Lars Gustäbel
Changes by Lars Gustäbel : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue4651] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun : I created #4629 a couple of days ago. And besides that issue, for Python 3.x, I guess we can remove getopt.error since Python 3.x does not have to backward compatible with Python 2.x. And another issue is, GetoptError does not render right error message with uni

[issue4650] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun : I created #4629 a couple of days ago. And besides that issue, for Python 3.x, I guess we can remove getopt.error since Python 3.x does not have to backward compatible with Python 2.x. And another issue is, GetoptError does not render right error message with uni

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, here is a link to faster algorithms: http://www-graphics.stanford.edu/~seander/bithacks.html#IntegerLog ___ Python tracker ___ __

[issue4605] 3.0 documentation mentions using maketrans from within the string module.

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks for the report! Fixed in r67724. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue4649] Fix a+b to a + b

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is silly. The current version better communicates its intended purpose. -- resolution: -> wont fix status: open -> closed ___ Python tracker _

[issue4649] Fix a+b to a + b

2008-12-12 Thread David W. Lambert
David W. Lambert added the comment: That phrase of PEP 8 means to me "Use spaces to visually group expressions according to precedence." ___ Python tracker ___ __

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
Retro added the comment: Let's set a good example in the documentation and follow PEP 8. For God's sake, this is the documentation of Python! Where else to set a good example than here? Let's see some PEP 8 in action, in the documentation! ___ Python tracker

[issue4644] Minor documentation fault in 2to3 script

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks for the report! Fixed in r67723. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue4649] Fix a+b to a + b

2008-12-12 Thread David W. Lambert
David W. Lambert added the comment: I do think your interpretation of PEP8 is overly strict. Here's the source code of the first j interpreter. (Ken Iverson) typedef char C;typedef long I; typedef struct a{I t,r,d[3],p[2];}*A; #define P printf #define R return #define V1(f) A f(w)A w; #defin

[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: This has been fixed in 2.6.1 and will be in 2.5.3. -- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed ___ Python tracker

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
Retro added the comment: And please fix the code example mentioned in issue4648. Line 4 has a little fix to be made: from ... print(n, 'equals', x, '*', n//x) to ... print(n, 'equals', x, '*', n // x) ___ Python tracker

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
New submission from Retro : http://docs.python.org/3.0/tutorial/controlflow.html#defining-functions Please visit the above link and see line 6 in the example code. ... a, b = b, a+b should be fixed to ... a, b = b, a + b because PEP 8 recommends to - Use spaces around arith

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, any thoughts? -- assignee: pje -> gvanrossum nosy: +gvanrossum ___ Python tracker ___ ___

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-12 Thread Phillip J. Eby
Phillip J. Eby added the comment: I could argue either way on this one; it's true that deleting a nested-scope variable is sometimes desirable, but it also seems to me like closing over an except: variable is a Potentially Bad Idea. In neither case, however, do I think it's appropriate to drop

[issue4645] configparser DEFAULT

2008-12-12 Thread Quentin Gallet-Gilles
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 behavi

[issue4648] Fix n//x to n/x in the Docs

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Retro, the code is correct as it stands. Floor division is intended (int // int --> int). I think you've misunderstood true division where the / operator used to mean floor division when supplied with integer arguments but now returns a float instead.

[issue4648] Fix n//x to n/x in the Docs

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis added the comment: > For Python 2.x that example code is fine, but Python 3.0 has this > switched now. Please read http://www.python.org/dev/peps/pep-0238/. > > True division in Python 3.0 is done with one division operator. Please > fix that code example to reflect that. I sti

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Are we talking about the same commit ? 59654 as in your original about > it breaking existing code. Oops, no. I now see that r59654 is fine for backporting. My last message was about r59653, which probably does introduce backward compatibility problems. The

[issue4648] Fix n//x to n/x in the Docs

2008-12-12 Thread Retro
Retro added the comment: For Python 2.x that example code is fine, but Python 3.0 has this switched now. Please read http://www.python.org/dev/peps/pep-0238/. True division in Python 3.0 is done with one division operator. Please fix that code example to reflect that. _

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo added the comment: On Fri, Dec 12, 2008 at 9:06 PM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > >> I don't see in what way it would break existing applications. The >> indices returned by that command in Tcl should all be represented as >> strings in Python,

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Terry, my motivation is that the sample code above runs correctly with python 2.6, but python 3.0 cannot even compile it. The sample looks valid python code, and should run. Yes, the same 'e' is used both as a nested variable and as an exception target,

[issue4648] Fix n//x to n/x in the Docs

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis added the comment: The code is correct as it stands. If you still think this is a problem, please explain why you think the example should be changed. -- nosy: +loewis resolution: -> invalid status: open -> closed ___ Python tracker

[issue4648] Fix n//x to n/x in the Docs

2008-12-12 Thread Retro
New submission from Retro : Please look at the example code in the following Python 3.0 documentation/tutorial: http://docs.python.org/3.0/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops The line 4 has a little fix to be made: from ... print(n, 'e

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Not sure the "del e" idea was a good solution to the garbage collection problem. Amaury's code looks correct to me. Maybe the existing e variable should be overwritten and the left intact (as it used to be) or perhaps it should be made both temporary and in

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis added the comment: > I don't see in what way it would break existing applications. The > indices returned by that command in Tcl should all be represented as > strings in Python, so I see this at max causing a double attempt to > convert it to str. I can't quite follow your term

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: -1 as I understand the proposal. Your code is bugged and should fail as soon as possible. If I understand correctly, you agree that the SyntaxError is correct as the language is currently defined, but you want the definition changed. It is not clear if you onl

[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Kay Schluehr
New submission from Kay Schluehr : I've added the following test method: test_parser.py -- class RoundtripLegalSyntaxTestCase(unittest.TestCase): def test_relative_import_statement(self): self.check_suite("from . import sys") The test fails raising the message: Traceb

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: The code looks fine. For speed, you could insert the following just before the while-loop: while (n >= 256) { n >>= 8; result += 8; } Am not sure the "numbits" is the right-name. Is there precedent in other languages or texts on bi

[issue4477] Speed up PyEval_EvalFrameEx when tracing is off.

2008-12-12 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Merged to 3.1 in r67611, 3.0.x in r67721, and 2.6.x in r67722. -- keywords: -needs review status: open -> closed versions: +Python 2.6 ___ Python tracker

[issue4646] distutils chokes on empty options arg in the setup function

2008-12-12 Thread Thomas Heller
New submission from Thomas Heller : Distutils setup function accepts an 'options' named argument which allows to pass options to subcommands in a dictionary (At the moment I cannot find where this is documented). When an empty dictionary is passed, distutils spits out a warning: C:\sf\comtypes>p

[issue4645] configparser DEFAULT

2008-12-12 Thread Shawn Ashlee
New submission from Shawn Ashlee : using .add_section() and .set() for the DEFAULT section adds it twice: [u...@srv ~]$ cat test_configparser.py #!/usr/bin/env python import ConfigParser a = ConfigParser.SafeConfigParser() # borked a.add_section('DEFAULT') a.set('DEFAULT', 'foo', 'bar') # w

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: As far as I'm concerned, this patch is ready to be applied. Raymond, care to give a second opinion? -- assignee: marketdickinson -> rhettinger stage: patch review -> commit review ___ Python tracker

[issue4016] improve linecache: reuse tokenize.detect_encoding() and io.open()

2008-12-12 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file11678/linecache_refactor.patch ___ Python tracker ___ ___ Python-bugs-list

[issue4016] improve linecache: reuse tokenize.detect_encoding() and io.open()

2008-12-12 Thread STINNER Victor
STINNER Victor added the comment: It was easy to remove the itertools dependency: only itertools.chain() was really used and a simple "for ...: yield" is enough to get the same behaviour (test_tokenize.py runs fine). With the new version of the patch, the bootstrap works correctly. Added fil

[issue4640] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread David W. Lambert
David W. Lambert added the comment: When I use it on python 3 optparse reports no such option -e, which is correct since the form -debug permits a run of single character options. -- nosy: +LambertDW ___ Python tracker

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Changes by Mark Dickinson : Removed file: http://bugs.python.org/file12331/numbits-6a.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: > I choosed to use consistent result type. But now I would prefer int :-) I see > that PyInt_FromSize_t() returns a long if the value doesn't fit in an int. So > it's correct. Cool. I think int is better, simply because the result is almost always going to

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread STINNER Victor
STINNER Victor added the comment: > - why do you use PyLong_FromSize_t rather than PyInt_FromSize_t? I choosed to use consistent result type. But now I would prefer int :-) I see that PyInt_FromSize_t() returns a long if the value doesn't fit in an int. So it's correct. > - isn't the if (ndi

[issue4641] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Duplicate of issue #4640. -- nosy: +marketdickinson resolution: -> duplicate status: open -> closed ___ Python tracker ___

[issue4642] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Duplicate of issue #4640. -- nosy: +marketdickinson resolution: -> duplicate status: open -> closed ___ Python tracker ___

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Oops. Here's the patch. Added file: http://bugs.python.org/file12331/numbits-6a.patch ___ Python tracker ___ ___

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Here's Victor's patch, but with extra documentation. No code has been changed. Two more questions about the code, Victor; specifically about long_numbits: - why do you use PyLong_FromSize_t rather than PyInt_FromSize_t? - isn't the if (ndigits == 0) check

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread STINNER Victor
STINNER Victor added the comment: > I'll work on the documentation Ok, cool. > a description of the semantics of numbits for 0 and negative integers About the negative integer: the documentation should be "number of bits of the *absolute value* of x" and "by convention, 0.numbits() is 0".

[issue3439] create a numbits() method for int and long types

2008-12-12 Thread Mark Dickinson
Mark Dickinson added the comment: Victor, This looks good. If it's okay with you, I'll work on the documentation a little (we need an entry in whatsnew, and a description of the semantics of numbits for 0 and negative integers.) Then I think this will be ready. > I prefer to keep the "fast

[issue4616] tarfile does not set the creation date and time of the extracted directories

2008-12-12 Thread Lars Gustäbel
Lars Gustäbel added the comment: I checked the necessary changes in the trunk and the py3k, release26-maint, and release30-maint branches (r67717-r67720). Thank you for your report. -- status: open -> closed ___ Python tracker

[issue4643] cgitb.html fails if getattr call raises exception

2008-12-12 Thread Allan Crooks
Changes by Allan Crooks : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue4644] Minor documentation fault in 2to3 script

2008-12-12 Thread Allan Crooks
New submission from Allan Crooks : When I run the following command: C:\temp>\python26\Tools\scripts\2to3.py --help Usage: refactor.py [options] file|dir ... It mentions that the script name is refactor.py, rather than 2to3.py (I guess that was the scripts original name?) -- components

[issue4643] cgitb.html fails if getattr call raises exception

2008-12-12 Thread Allan Crooks
New submission from Allan Crooks : If cgitb.html tries to get the value of an attribute from an object, and the getattr call causes an exception to be raised (other than an AttributeError), then cgitb.html fails to work: If you run the attached file in Python 2.5.2 or 2.6, you get the following

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > We just need to finish the job of making the convenience wrapper > actually able to handle the task we would like it to handle. Your latest > patch goes a long way towards doing that for the 1 dimensional case - if > Travis doesn't get to it first, I plan on t

[issue4642] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala : I am using optparse for command-line parameters parsing. To follow common naming convention I defined -d (minus followed by a single character option) and --debug (double minus followed by a word). It looks like optparse doesn't complain when -debug (sin

[issue4641] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala : I am using optparse for command-line parameters parsing. To follow common naming convention I defined -d (minus followed by a single character option) and --debug (double minus followed by a word). It looks like optparse doesn't complain when -debug (sin

[issue4640] optparse - dosn't distinguish between '--option' and '-option'

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala : I am using optparse for command-line parameters parsing. To follow common naming convention I defined -d (minus followed by a single character option) and --debug (double minus followed by a word). It looks like optparse doesn't complain when -debug (sin

[issue4639] Build failure on OpenBSD 4.4-current regarding lstat()

2008-12-12 Thread Edd
New submission from Edd : Hi, I just had to move the "extern lstat..." outside the "ifndef HAVE_LSTAT" to get python 2.6.1 to build on OpenBSD 4.4-current/i386. I'm not suggesting this is correct, but it fixes the build for my platform at least. --- Modules/posixmodule.c.orig Fri Dec 12 11

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo added the comment: On Wed, Dec 10, 2008 at 6:21 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > Can you remind me what problem was fixed with r59653? I can't find the > Tk tracker anymore on which this apparently was reported. > I had trouble finding it to

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo added the comment: On Wed, Dec 10, 2008 at 6:15 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > I'm skeptical about backporting r59654. Doing so might break existing > applications. > I don't see in what way it would break existing applications. The indice

[issue3248] ScrolledText can't be placed in a PanedWindow

2008-12-12 Thread Guilherme Polo
Guilherme Polo added the comment: On Wed, Dec 10, 2008 at 6:44 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > > What problem is solved by ScrolledText.diff that isn't already solved by > scrolledtext_masterstr.diff? None. The later is a cleanup of ScrolledText.py. __

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-12 Thread Nick Coghlan
Nick Coghlan added the comment: Trying another way of getting the point across... if Py_buffer wasn't defined in PEP 3118, there would have to be some *other* API there whereby the memoryview implementation could ask an object for a description of the data layout of the object's buffer. It is P

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-12 Thread Nick Coghlan
Nick Coghlan added the comment: I still don't see the problem: Py_buffer is a minimal description of a region of memory. No more, no less. It doesn't *do* anything, it's just a description. memoryview is an object that will (when it's finished) provide an easy way to access the memory of anoth