Re: Implicit initialization is EXCELLENT

2011-07-07 Thread Ulrich Eckhardt
Ian Kelly wrote: On Wed, Jul 6, 2011 at 12:49 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Mel wrote: In wx, many of the window classes have Create methods, for filling in various attributes in two-step construction. [...] Just guessing, is it legacy, C-with-classes code

Re: web browsing short cut

2011-07-07 Thread Cousin Stanley
Chris Angelico wrote: frameset rows=50%,50% frameset cols=50%,50% frame src=http://blah/blah; frame src=http://another/blah; /frameset frameset cols=50%,50% frame src=http://third/blah; frame src=http://final/blah; /frameset /frameset That should divide your

TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Kannan Varadhan
Hi Folks, Here is something I don't fully understand. 1 def DefaultTracer(fmt, *args): 2 fmt = 'in DefaultTracer ' + fmt 3 print(fmt % args) 4 pass 5 def myTracer(fmt, *args): 6 fmt = 'in myTracer ' + fmt 7 print(fmt % args) 8 9 class MyClass: 10 ClassDefaultTracer

Re: wx MenuItem - icon is missing

2011-07-07 Thread Laszlo Nagy
I can understand why it's frustrating but a menu items with icons on them aren't exactly common, so you're wandering into territory that's probably not so throughly explored (nor standard across platforms). Now that I think about it, I don't know that I've ever seen one under OSX, and I

more advanced learning resources (code structure, fundamentals)

2011-07-07 Thread John [H2O]
Hello, I've been programming in Python for a few years now. I have read most the typical learning resources, such as 'Dive Into Python', 'A Byte of Python', etc. In general I feel I have a good overview of the language. However, as I advanced toward trying to create more OO styled programs, I

Re: TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Peter Otten
Kannan Varadhan wrote: Here is something I don't fully understand. 1 def DefaultTracer(fmt, *args): 2 fmt = 'in DefaultTracer ' + fmt 3 print(fmt % args) 4 pass 5 def myTracer(fmt, *args): 6 fmt = 'in myTracer ' + fmt 7 print(fmt % args) 8 9 class MyClass:

Re: Large number multiplication

2011-07-07 Thread Ulrich Eckhardt
Billy Mays wrote: On 07/06/2011 04:02 PM, Ian Kelly wrote: According to Wikipedia: In practice the Schönhage–Strassen algorithm starts to outperform older methods such as Karatsuba and Toom–Cook multiplication for numbers beyond 2**2**15 to 2**2**17 (10,000 to 40,000 decimal digits). I

find max and min values from a column of a csv file

2011-07-07 Thread prakash jp
Hi All , Could any one help to get max and min values from a specified column of a csv file. The* csv file is large* and hence the below code did go bad. *Alternate methods would be highly appreciated ** minimum.py*: import csv filename = testLog_4.csv f = open(filename) def col_min(mincname):

Re: bash: testing whether anyone is or has recently been logged in?

2011-07-07 Thread Adam Funk
On 2011-04-20, Bill Marcum wrote: On 2011-04-20, Adam Funk a24...@ducksburg.com wrote: I'd appreciate any suggestions for testing (preferably from a bash script, although perl or python would be OK too) whether anyone is currently logged in, and whether anyone has been logged in during the

Re: find max and min values from a column of a csv file

2011-07-07 Thread John [H2O]
I think you would benefit from reading the data into a numpy array first, then using numpy min, max functions. prakash jp wrote: Hi All , Could any one help to get max and min values from a specified column of a csv file. The* csv file is large* and hence the below code did go bad.

Re: more advanced learning resources (code structure, fundamentals)

2011-07-07 Thread Mel
John [H2O] wrote: [ ... ] What are the key points to the classes? Is it okay to reference or pass classes to instantiate a class? Yes. The standard library does this in BaseHTTPServer (via its parent SocketServer.) Maybe looks abstruse at the outset, but it's the natural way to assign a

Re: Does hashlib support a file mode?

2011-07-07 Thread Anssi Saari
Mel mwil...@the-wire.com writes: def file_to_hash(path, m = hashlib.md5()): hashlib.md5 *is* called once; that is when the def statement is executed. Very interesting, I certainly wasn't clear on this. So after that def, the created hashlib object is in the module's scope and can be accessed

blist question

2011-07-07 Thread dmitrey
hi all, I feel lack of native Python lists operations (e.g. taking N greatest elements with the involved key function and O(n) speed) and occasionally found blist http://pypi.python.org/pypi/blist/ Its entry says it is better than Python list. Did anyone ensure? Will it ever be merged into Python

Re: Does hashlib support a file mode?

2011-07-07 Thread Paul Rudin
Anssi Saari a...@sci.fi writes: Mel mwil...@the-wire.com writes: def file_to_hash(path, m = hashlib.md5()): hashlib.md5 *is* called once; that is when the def statement is executed. Very interesting, I certainly wasn't clear on this. So after that def, the created hashlib object is in the

Re: find max and min values from a column of a csv file

2011-07-07 Thread Peter Otten
prakash jp wrote: Could any one help to get max and min values from a specified column of a csv file. The* csv file is large* and hence the below code did go bad. *Alternate methods would be highly appreciated ** minimum.py*: import csv filename = testLog_4.csv f = open(filename) def

Re: TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Steven D'Aprano
Kannan Varadhan wrote: Hi Folks, Here is something I don't fully understand. 1 def DefaultTracer(fmt, *args): 2 fmt = 'in DefaultTracer ' + fmt 3 print(fmt % args) 4 pass 5 def myTracer(fmt, *args): 6 fmt = 'in myTracer ' + fmt 7 print(fmt % args) Please

Re: TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Paul Rudin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Please don't post code with line numbers. That makes it difficult to copy and paste your function into an interactive session, so that we can run it and see what it does. C-x r d --

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.06 06:16 PM, Steven D'Aprano wrote: Phlip wrote: Note the fix also avoids comparing to None, which, as usual, is also icky and less typesafe! Typesafe? Are you trying to make a joke? Maybe he has a duck phobia. Maybe he denies the existence of ducks. Maybe he doesn't like the

Re: TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Peter Otten
Peter Otten wrote: or you wrap the callable in a descriptor: def DefaultTracer(*args): print args ... class D(object): ... def __init__(self, f): ... self.f = f ... def __get__(self, *args): ... return self.f ... After skimming over Steven's post: use

Re: Does hashlib support a file mode?

2011-07-07 Thread Phlip
On 2011.07.06 06:16 PM, Steven D'Aprano wrote: Phlip wrote: Note the fix also avoids comparing to None, which, as usual, is also icky and less typesafe! Typesafe? Are you trying to make a joke? No, I was pointing out that passing a type is more ... typesafe. --

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:11 AM, Phlip wrote: No, I was pointing out that passing a type is more ... typesafe. None is a type. None.__class__ class 'NoneType' -- http://mail.python.org/mailman/listinfo/python-list

Re: Does hashlib support a file mode?

2011-07-07 Thread Phlip
On Jul 7, 6:24 am, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.07.07 08:11 AM, Phlip wrote: No, I was pointing out that passing a type is more ... typesafe. None is a type. I never said it wasn't. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:39 AM, Phlip wrote: On Jul 7, 6:24 am, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.07.07 08:11 AM, Phlip wrote: No, I was pointing out that passing a type is more ... typesafe. None is a type. I never said it wasn't. You are talking about this code, right?

Re: Testing if a global is defined in a module

2011-07-07 Thread Grant Edwards
On 2011-07-06, Waldek M. wm@localhost.localdomain wrote: Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisa?(a): Because unless you are extremely disciplined, code and the comments describing them get out of sync. [...] True, but that gets far worse with external docs. Do you have

Tips/lessons learned for writing a Python powered DSL?

2011-07-07 Thread python
Looking for tips and lessons learned (advice on what to do and not do) for writing a Python based DSL. Googling python dsl yields some wonderful content which I've just started to read. If there are specific articles or 3rd party libraries that you used to implement a DSL, I would appreciate

Re: Tips/lessons learned for writing a Python powered DSL?

2011-07-07 Thread Paul Woolcock
For me, diving into the data model really helped me grasp some of the metaprogramming capabilities that python has, which is helping me as I am implementing my own DSL in python. http://docs.python.org/reference/datamodel.html On Thu, Jul 7, 2011 at 10:20 AM, pyt...@bdurham.com wrote: Looking

Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread António Rocha
Greetings I'm running Python (32b) in Windows7 (at 64bits) and I would like to know how can I check if my machine is a 32b or 64b in Python. Is it possible? I saw a few examples (like platform) but they only provide information about Python not the machine. Thanks Toze --

Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Andrew Berg
On 2011.07.07 10:21 AM, António Rocha wrote: I'm running Python (32b) in Windows7 (at 64bits) and I would like to know how can I check if my machine is a 32b or 64b in Python. Is it possible? I saw a few examples (like platform) but they only provide information about Python not the machine.

Re: Large number multiplication

2011-07-07 Thread Ian Kelly
On Thu, Jul 7, 2011 at 2:30 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Even worse, most people would actually pay for its use, because they don't use numbers large enough to merit the Schönhage–Strassen algorithm. As it stands, Karatsuba is only used for numbers greater than a

Re: Large number multiplication

2011-07-07 Thread Ian Kelly
On Thu, Jul 7, 2011 at 9:49 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Jul 7, 2011 at 2:30 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Even worse, most people would actually pay for its use, because they don't use numbers large enough to merit the Schönhage–Strassen

Re: Implicit initialization is EXCELLENT

2011-07-07 Thread Ian Kelly
On Thu, Jul 7, 2011 at 1:12 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Just guessing, is it legacy, C-with-classes code rather than C++ code perhaps? Haven't looked at wx for a while. Such code typically lacks understanding of exceptions, which are the only way to signal failure

Re: Large number multiplication

2011-07-07 Thread Parerga
Hi, Billy Mays wrote: On 07/06/2011 04:02 PM, Ian Kelly wrote: On Wed, Jul 6, 2011 at 1:30 PM, Billy Maysno...@nohow.com wrote: I was looking through the python source and noticed that long multiplication is done using the Karatsuba method (O(~n^1.5)) rather than using FFTs O(~n

Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Philip Reynolds
On Thu, 07 Jul 2011, Andrew Berg wrote: On 2011.07.07 10:21 AM, António Rocha wrote: I'm running Python (32b) in Windows7 (at 64bits) and I would like to know how can I check if my machine is a 32b or 64b in Python. Is it possible? I saw a few examples (like platform) but they only provide

Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Robert Kern
On 7/7/11 11:33 AM, Philip Reynolds wrote: On Thu, 07 Jul 2011, Andrew Berg wrote: On 2011.07.07 10:21 AM, António Rocha wrote: I'm running Python (32b) in Windows7 (at 64bits) and I would like to know how can I check if my machine is a 32b or 64b in Python. Is it possible? I saw a few

Re: blist question

2011-07-07 Thread Daniel Stutzbach
On Thu, Jul 7, 2011 at 5:08 AM, dmitrey dmitre...@gmail.com wrote: I feel lack of native Python lists operations (e.g. taking N greatest elements with the involved key function and O(n) speed) and occasionally found blist http://pypi.python.org/pypi/blist/ Its entry says it is better than

Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Brian Curtin
2011/7/7 António Rocha toyze.ro...@gmail.com Greetings I'm running Python (32b) in Windows7 (at 64bits) and I would like to know how can I check if my machine is a 32b or 64b in Python. Is it possible? I saw a few examples (like platform) but they only provide information about Python not

Programming tips :-)

2011-07-07 Thread Martin Schöön
I just found the following url in my archives at work and thought you might enjoy it: http://thc.org/root/phun/unmaintain.html /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: module problem on windows 64bit

2011-07-07 Thread miamia
On Jul 5, 5:05 pm, Thomas Jollans t...@jollybox.de wrote: On 06/27/2011 06:59 PM, miamia wrote: Hello, on 32-bit windows everything works ok but on 64-bit win I am getting this error: Traceback (most recent call last):   File app.py, line 1040, in do_this_now   File

Re: blist question

2011-07-07 Thread Miki Tebeka
Have you looked at http://docs.python.org/library/collections.html#collections.deque ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EVIL!

2011-07-07 Thread rantingrick
On Jul 7, 12:34 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: rantingrick wrote: Yes but what benefit does that gain over say, Tkinter's design (because that has been your argument). Like I said, it's a tangential issue. Agreed. The important thing is that it's okay for an app to

Re: Large number multiplication

2011-07-07 Thread casevh
On Jul 7, 1:30 am, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Billy Mays wrote: On 07/06/2011 04:02 PM, Ian Kelly wrote: According to Wikipedia: In practice the Schönhage–Strassen algorithm starts to outperform older methods such as Karatsuba and Toom–Cook multiplication

making socket.getaddrinfo use cached dns

2011-07-07 Thread high bandwidth
I use cached dns lookups with pdnsd on my ubuntu machine to speed up web access as regular lookups can take 15-30 seconds. However, python's mechanize and urllib etc use socket.getaddrinfo, which seems not to be using dns cacheing or taking a long time because of ipv6 lookups. In either case, I

i get different answers based on run platform

2011-07-07 Thread linda
I have this simple palindrome program that yields different results depending on whether I run it from Windows or from IDLE. The answer is correct off IDLE, but why is this the case? Here's the code: def reverse(text): return text[::-1] def is_palindrome(text): return

Re: Implicit initialization is EVIL!

2011-07-07 Thread Chris Angelico
On Fri, Jul 8, 2011 at 3:29 AM, rantingrick rantingr...@gmail.com wrote: So your argument is:     A window hierarchy is bad because if your application requires a user to open a gazillion windows (read as: designed poorly) --each representing completely different transactions-- and if you

Re: making socket.getaddrinfo use cached dns

2011-07-07 Thread Chris Angelico
On Fri, Jul 8, 2011 at 4:18 AM, high bandwidth widebandwi...@gmail.com wrote: I use cached dns lookups with pdnsd on my ubuntu machine to speed up web access as regular lookups can take 15-30 seconds. However, python's mechanize and urllib etc use socket.getaddrinfo, which seems not to be using

Re: Programming tips :-)

2011-07-07 Thread Andrew Berg
On 2011.07.07 12:22 PM, Martin Schöön wrote: I just found the following url in my archives at work and thought you might enjoy it: http://thc.org/root/phun/unmaintain.html That's awesome. If a maintenance programmer can't quote entire Monty Python movies from memory, he or she has *no*

Re: i get different answers based on run platform

2011-07-07 Thread John Gordon
In 842fce9d-1b3f-434a-b748-a6dc4828c...@h12g2000pro.googlegroups.com linda posts...@gmail.com writes: I have this simple palindrome program that yields different results depending on whether I run it from Windows or from IDLE. The answer is correct off IDLE, but why is this the case? Here's

Re: i get different answers based on run platform

2011-07-07 Thread Ethan Furman
linda wrote: I have this simple palindrome program that yields different results depending on whether I run it from Windows or from IDLE. The answer is correct off IDLE, but why is this the case? Here's the code: def reverse(text): return text[::-1] def is_palindrome(text): return

Re: i get different answers based on run platform

2011-07-07 Thread MRAB
On 07/07/2011 19:18, linda wrote: I have this simple palindrome program that yields different results depending on whether I run it from Windows or from IDLE. The answer is correct off IDLE, but why is this the case? Here's the code: def reverse(text): return text[::-1] def

Re: i get different answers based on run platform

2011-07-07 Thread Ethan Furman
John Gordon wrote: By the way, I could not make your program work as you provided it; I had to replace input() with raw_input(). Does it really work for you this way? input() is the 3.x name for raw_input() ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: i get different answers based on run platform

2011-07-07 Thread MRAB
On 07/07/2011 19:37, John Gordon wrote: In842fce9d-1b3f-434a-b748-a6dc4828c...@h12g2000pro.googlegroups.com lindaposts...@gmail.com writes: I have this simple palindrome program that yields different results depending on whether I run it from Windows or from IDLE. The answer is correct off

Serial reset of the device

2011-07-07 Thread yorick
Hello, I'm trying to access a hardware board of my company through a serial connection using a Python script and the pyserial module. I use Python 2.7.1 with Ubuntu 11.04 (pyserial is the package python- serial with version 2.5.2, http://pyserial.sourceforge.net/pyserial_api.html). The board to

multiprocessing.Manager().Namespace() and data copying

2011-07-07 Thread ichi
Hi! I'm trying to share data between processes using multiprocessing.Manager and  creating shared Namespace. I have the following code: from multiprocessing import Manager from scipy import rand x = rand(5000, 5000) m = Manager() n = m.Namespace() n.x = x   It seems that at n.x = x data is

Re: i get different answers based on run platform

2011-07-07 Thread linda
I tried something = input('enter text:').rstrip('\n') as suggested but the problem persists. BTW, the intermediate print commands agree and so are not an issue. The disagreement is in IDLE correctly identifying palindromes and Windows not. I do suspect it may be a trailing '\r' issue. Is there

Re: i get different answers based on run platform

2011-07-07 Thread Ethan Furman
linda wrote: I tried something = input('enter text:').rstrip('\n') as suggested but the problem persists. BTW, the intermediate print commands agree and so are not an issue. The disagreement is in IDLE correctly identifying palindromes and Windows not. I do suspect it may be a trailing '\r'

Re: i get different answers based on run platform

2011-07-07 Thread linda
On Jul 7, 2:42 pm, Ethan Furman et...@stoneleaf.us wrote: linda wrote: I tried something = input('enter text:').rstrip('\n') as suggested but the problem persists.  BTW, the intermediate print commands agree and so are not an issue.  The disagreement is in IDLE correctly identifying

Re: blist question

2011-07-07 Thread Raymond Hettinger
On Jul 7, 5:08 am, dmitrey dmitre...@gmail.com wrote: hi all, I feel lack of native Python lists operations (e.g. taking N greatest elements with the involved key function and O(n) speed) Take a look at heapq.nlargest()... and occasionally found blisthttp://pypi.python.org/pypi/blist/ Its

Re: Testing if a global is defined in a module

2011-07-07 Thread Chris Rebert
On Thu, Jul 7, 2011 at 7:18 AM, Grant Edwards invalid@invalid.invalid wrote: On 2011-07-06, Waldek M. wm@localhost.localdomain wrote: Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisa?(a): Because unless you are extremely disciplined, code and the comments describing them get out

Re: Implicit initialization is EVIL!

2011-07-07 Thread Steven D'Aprano
rantingrick wrote: On Jul 7, 12:34 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: The important thing is that it's okay for an app to stay alive until its *last* top level window is closed. I partially disagree with Greg on this. This is not the only model: on the Apple Mac, or any

Re: Does hashlib support a file mode?

2011-07-07 Thread Steven D'Aprano
Andrew Berg wrote: On 2011.07.07 08:39 AM, Phlip wrote: On Jul 7, 6:24 am, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.07.07 08:11 AM, Phlip wrote: No, I was pointing out that passing a type is more ... typesafe. None is a type. I never said it wasn't. Unfortunately, it

Re: Implicit initialization is EVIL!

2011-07-07 Thread Gregory Ewing
rantingrick wrote: So you prefer to close a gazillion windows one by one? If I want to close all the windows, I can use the application's Quit or Exit command, or whatever the platform calls it. (Note that if there is a separate instance of the application for each window -- as was suggested

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:46 PM, Steven D'Aprano wrote: None is not a type, it is an instance. isinstance(None, type) # is None a type? False isinstance(None, type(None)) # is None an instance of None's type? True So None is not itself a type, although it *has* a type: type(None) type

Re: Programming tips :-)

2011-07-07 Thread Phlip
On Jul 7, 11:36 am, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.07.07 12:22 PM, Martin Schöön wrote: I just found the following url in my archives at work and thought you might enjoy it: http://thc.org/root/phun/unmaintain.html That's awesome. That's How To Write Unmaintainable

Re: Does hashlib support a file mode?

2011-07-07 Thread Phlip
I worded that poorly. None is (AFAIK) the only instance of NoneType, but I should've clarified the difference. The is operator does not compare types, it compares instances for identity. None is typesafe, because it's strongly typed. However, what's even MORE X-safe (for various values of X)

Re: Serial reset of the device

2011-07-07 Thread Dan Stromberg
On Thu, Jul 7, 2011 at 12:34 PM, yorick yorick.bru...@gmail.com wrote: Hello, I'm trying to access a hardware board of my company through a serial connection using a Python script and the pyserial module. I use Python 2.7.1 with Ubuntu 11.04 (pyserial is the package python- serial with

Hello Sweet Friends.

2011-07-07 Thread Ashraf Ali
I bring you a source of entertaintment.Just visit the following link and know about Bollywood actresses www.bollywoodactresseshotpictures.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

[issue10278] add time.wallclock() method

2011-07-07 Thread Matt Joiner
Matt Joiner anacro...@gmail.com added the comment: What's the status of this bug? This is a very useful feature, I've had to use and add bindings to monotonic times for numerous applications. Can it make it into 3.3? -- ___ Python tracker

[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2011-07-07 Thread Saul Spatz
Changes by Saul Spatz saul.sp...@gmail.com: -- nosy: +spatz123 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8271 ___ ___ Python-bugs-list mailing

[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf
New submission from Andreas Hasenkopf webmas...@hasenkopf2000.net: I'm using 64bit Arch Linux and Python 2.7.2 compiled with GCC 4.6.1. I have noticed in several ocassions that the interpreter is complaining about AttributeError: XMLGenerator instance has no attribute '_write' (in case of

[issue9242] unicodeobject.c: use of uninitialized values

2011-07-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9242 ___ ___

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5505 ___ ___

[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Leaving open to discuss whether anything can/should be done for the case when reindent acts as an stdin sys.stdin.buffer and sys.stdout.buffer should be used with tokenize.detect_encoding(). We may read first stdin and write it

[issue10284] NNTP should accept bytestrings for username and password

2011-07-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- components: +Unicode nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10284 ___

[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-07-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Can't you only work with Unicode and avoid the MBCS encoding? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10945

[issue10872] Add mode to TextIOWrapper repr

2011-07-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10872 ___ ___

[issue12512] codecs: StreamWriter issue with stateful codecs after a seek

2011-07-07 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: The following code fails with an AssertionError('###\ufeffdef'): import codecs _open = codecs.open #_open = open filename = test with _open(filename, 'w', encoding='utf_16') as f: f.write('abc') pos = f.tell() with

[issue12512] codecs: StreamWriter issues with stateful codecs after a seek or with append mode

2011-07-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: There is a similar bug for append mode: import codecs _open = codecs.open #_open = open filename = test with _open(filename, 'w', encoding='utf_16') as f: f.write('abc') with _open(filename, 'a', encoding='utf_16') as f:

[issue12391] packaging install fails to clean up temp files

2011-07-07 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset a4405b799e1b by Vinay Sajip in branch 'default': Closes #12391: temporary files are now cleaned up. http://hg.python.org/cpython/rev/a4405b799e1b -- nosy: +python-dev resolution: - fixed stage: commit review -

[issue10647] scrollbar crash in non-US locale format settings

2011-07-07 Thread Hans Bering
Hans Bering hans.ber...@arcor.de added the comment: Ok, _now_ I have run into the same problem. I have attached a small script similar to the original entry (but shorter) which will reliably crash with Python 3.1.4 on Windows 7 (64bit) when using a locale with a comma decimal fraction marker

[issue10647] scrollbar crash in non-US locale format settings

2011-07-07 Thread Hans Bering
Changes by Hans Bering hans.ber...@arcor.de: Removed file: http://bugs.python.org/file22535/tkinterCrash.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10647 ___

[issue12167] test_packaging reference leak

2011-07-07 Thread Andreas Stührk
Andreas Stührk andy-pyt...@hammerhartes.de added the comment: Attached is a patch that replaces `lib2to3.fixer_Base.BaseFix.set_filename()` during tests. With the patch applied, I don't get any refleaks for packaging. Another approach would be to simply remove the logging attribute of lib2to3

[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-07-07 Thread Ralf Schlatterbeck
Ralf Schlatterbeck r...@runtux.com added the comment: On Thu, Jul 07, 2011 at 10:52:51AM +, STINNER Victor wrote: Can't you only work with Unicode and avoid the MBCS encoding? I'm trying to build a windows binary package on Linux. This usually works fine -- as long as the package

[issue12513] codec.StreamReaderWriter: issues with interlaced read-write

2011-07-07 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: The following test fails with an AssertionError('a' != 'b') on the first read. import codecs FILENAME = 'test' with open(FILENAME, 'wb') as f: f.write('abcd'.encode('utf-8')) with codecs.open(FILENAME, 'r+',

[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf
Andreas Hasenkopf webmas...@hasenkopf2000.net added the comment: I'd like to mention that Python 2.6.7 does not show this erroneous behavior. In Python 2.6.7 I can call the _write method of xml.sax.saxutils.XMLGenerator... Is this a bug or a feature in 2.7?? -- components: -XML

[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Andreas Hasenkopf
Andreas Hasenkopf webmas...@hasenkopf2000.net added the comment: The problem appeared to be the package from the Arch Linux repo. Compiling the source codes myselfes gave me a Python interpreter not showing this bug... -- resolution: - accepted status: open - closed

[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl
Changes by bjorn lofdahl bjorn.lofd...@gmail.com: -- versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4 -Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12506

[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl
Changes by bjorn lofdahl bjorn.lofd...@gmail.com: -- versions: +Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12506 ___ ___

[issue12511] class/instance xyz has no attribute '_abc'

2011-07-07 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: accepted - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12511 ___ ___

[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Gareth Rees
New submission from Gareth Rees g...@garethrees.org: If you call timeit.timeit and the timed code raises an exception, then garbage collection is disabled. I have verified this in Python 2.7 and 3.2. Here's an interaction with Python 3.2: Python 3.2 (r32:88445, Jul 7 2011, 15:52:49)

[issue10403] Use member consistently

2011-07-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Senthil, I’m not sure you read Alexander’s reply on Rietveld before committing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10403 ___

[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Gareth Rees
Gareth Rees g...@garethrees.org added the comment: Patch attached. -- keywords: +patch Added file: http://bugs.python.org/file22605/issue12514.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12514

[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12514 ___

[issue12514] timeit disables garbage collection if timed code raises an exception

2011-07-07 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thank you. The patch looks correct. I will apply it as soon as I get a chance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12514

[issue12515] The email package modifies the message structure (when the parsed email is invalid)

2011-07-07 Thread xavierd
New submission from xavierd xdelan...@cloudmark.com: the function 'email.message_from_file' modifies the message structure when the parsed is invalid (for example, when a closed boudary is missing). The attribute defects is also empty In the attachment (sample.tgz) you will find: -

[issue12504] packaging: fix uninstall and stop skipping its tests

2011-07-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for that! I agree that it’s a fake optimization to work with generators instead of lists when the list is small or when we depend on other resources like file handles. There are a few methods we could change in the database module.

[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks a lot for the diagnosis. To fix it, I don’t find the monkey-patching approach very good, I’d prefer properly using the logging API to remove handlers upon cleanup. Would you like to look into that? --

[issue12167] test_packaging reference leak

2011-07-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: To fix it, I don’t find the monkey-patching approach very good, I’d prefer properly using the logging API to remove handlers upon cleanup. I don't think such stuff exists. -- ___ Python tracker

[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: See http://hg.python.org/cpython/file/tip/Lib/packaging/tests/support.py#l81 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167 ___

[issue12167] test_packaging reference leak

2011-07-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: See http://hg.python.org/cpython/file/tip/Lib/packaging/tests/support.py#l81 AFAIU, the problem is that 2to3 creates a whole new logger for each different file. So it's not about cleaning the handlers, but cleaning up the loggers as well. And

[issue12167] test_packaging reference leak

2011-07-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for clarifying, I had misread. IMO, using one logger per file is a lib2to3 bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12167

  1   2   >