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

2008-12-12 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

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

2008-12-12 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

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

2008-12-12 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Wed, Dec 10, 2008 at 6:44 AM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: What problem is solved by ScrolledText.diff that isn't already solved by scrolledtext_masterstr.diff?

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Wed, Dec 10, 2008 at 6:15 AM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I'm skeptical about backporting r59654. Doing so might break existing applications. I don't see in what

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Wed, Dec 10, 2008 at 6:21 AM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: Can you remind me what problem was fixed with r59653? I can't find the Tk tracker anymore on which this

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

2008-12-12 Thread Edd
New submission from Edd vex...@gmail.com: 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

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

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala kszaw...@slb.com: 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

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

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala kszaw...@slb.com: 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

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

2008-12-12 Thread Krzysztof Szawala
New submission from Krzysztof Szawala kszaw...@slb.com: 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

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

2008-12-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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,

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

2008-12-12 Thread Allan Crooks
New submission from Allan Crooks a...@users.sourceforge.net: 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

[issue4644] Minor documentation fault in 2to3 script

2008-12-12 Thread Allan Crooks
New submission from Allan Crooks a...@users.sourceforge.net: 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

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

2008-12-12 Thread Allan Crooks
Changes by Allan Crooks a...@users.sourceforge.net: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4643 ___ ___

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

2008-12-12 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de 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

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

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

2008-12-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

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

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

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Duplicate of issue #4640. -- nosy: +marketdickinson resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4642

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Duplicate of issue #4640. -- nosy: +marketdickinson resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4641

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

2008-12-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

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

2008-12-12 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: Removed file: http://bugs.python.org/file12331/numbits-6a.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3439 ___

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

2008-12-12 Thread David W. Lambert
David W. Lambert lamber...@corning.com 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

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

2008-12-12 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

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

2008-12-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file11678/linecache_refactor.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4016 ___

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

2008-12-12 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

[issue4645] configparser DEFAULT

2008-12-12 Thread Shawn Ashlee
New submission from Shawn Ashlee shawn.ash...@rackspace.com: 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')

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

2008-12-12 Thread Thomas Heller
New submission from Thomas Heller thel...@ctypes.org: 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

[issue4477] Speed up PyEval_EvalFrameEx when tracing is off.

2008-12-12 Thread Jeffrey Yasskin
Jeffrey Yasskin jyass...@gmail.com 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 rep...@bugs.python.org

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

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Kay Schluehr
New submission from Kay Schluehr k...@fiber-space.de: 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

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

2008-12-12 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2008-12-12 Thread Retro
New submission from Retro vinet...@gmail.com: 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 ...

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

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2008-12-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com 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

[issue4342] (Tkinter) Please backport these

2008-12-12 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Fri, Dec 12, 2008 at 9:06 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I don't see in what way it would break existing applications. The indices returned by that command in Tcl

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

2008-12-12 Thread Retro
Retro vinet...@gmail.com 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 Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2008-12-12 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue4645] configparser DEFAULT

2008-12-12 Thread Quentin Gallet-Gilles
Quentin Gallet-Gilles qgal...@gmail.com 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

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

2008-12-12 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com 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

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

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Guido, any thoughts? -- assignee: pje - gvanrossum nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4617

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
New submission from Retro vinet...@gmail.com: 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

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
Retro vinet...@gmail.com 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

[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson musiccomposit...@gmail.com 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 rep...@bugs.python.org

[issue4649] Fix a+b to a + b

2008-12-12 Thread David W. Lambert
David W. Lambert lamber...@corning.com 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

[issue4644] Minor documentation fault in 2to3 script

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson musiccomposit...@gmail.com added the comment: Thanks for the report! Fixed in r67723. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4644

[issue4649] Fix a+b to a + b

2008-12-12 Thread Retro
Retro vinet...@gmail.com 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!

[issue4649] Fix a+b to a + b

2008-12-12 Thread David W. Lambert
David W. Lambert lamber...@corning.com added the comment: That phrase of PEP 8 means to me Use spaces to visually group expressions according to precedence. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4649

[issue4649] Fix a+b to a + b

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: This is silly. The current version better communicates its intended purpose. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org

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

2008-12-12 Thread Benjamin Peterson
Benjamin Peterson musiccomposit...@gmail.com added the comment: Thanks for the report! Fixed in r67724. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4605

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

2008-12-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, here is a link to faster algorithms: http://www-graphics.stanford.edu/~seander/bithacks.html#IntegerLog ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3439

[issue4650] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: 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

[issue4651] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: 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

[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 l...@gustaebel.de: -- resolution: - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4616 ___ ___ Python-bugs-list

[issue4652] IDLE does not work with Unicode

2008-12-12 Thread Aki Wakabayashi
New submission from Aki Wakabayashi zzyzx2...@gmail.com: 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

[issue4653] Patch to fix typos for Py3K

2008-12-12 Thread Johnny Lee
New submission from Johnny Lee typo...@gmail.com: 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}.