PyCon Australia 2010 update

2010-04-22 Thread Richard Jones
Hi everyone, Here's some updates for PyCon Australia 2010, to be held at the Sydney Masonic Center over the weekend of June 26 and 27. 1. Registration is now open 2. Keynotes announced 3. Call For Proposals proceeds 4. Several sponsors confirmed Please pass this message on to those you feel

Re: Download Proprietary Microsoft Products Now

2010-04-22 Thread Martin v. Loewis
... or because Mingw32 doesn't provide the header files (in particular wrt. C++), or because linking with a library is necessary that uses the MSVC mangling, not the g++ one (again, for C++). Again, that would be code that’s not portable off Windows. Probably (although it *is* possible to

Re: Download Proprietary Microsoft Products Now

2010-04-22 Thread Martin v. Loewis
... or because Mingw32 doesn't provide the header files (in particular wrt. C++), or because linking with a library is necessary that uses the MSVC mangling, not the g++ one (again, for C++). Again, that would be code that’s not portable off Windows. Probably (although it *is* possible to

Re: socked and bytes operation

2010-04-22 Thread luca72
On 21 Apr, 20:42, John Nagle na...@animats.com wrote: luca72 wrote: Hello i have this question : i connect to the server in this way: sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) sock.connect(('192.168.1.11',11502)) rcv = sock.recv(8124) here i get 14 random bytes , in a

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-22 Thread Sebastian
This works fine as long as they are in English: ??? is not a valid  value for BrowseNodeId.    Please change this value and retry your request.,   for instance, will raise an InvalidParameterValue exception. However, the Japanese version returns the error message ???

a.extend(b) better than a+=b ?

2010-04-22 Thread candide
Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before appending, right ? --

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Alf P. Steinbach
* candide: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before appending, right ? No. But in

python

2010-04-22 Thread matthewwintibbals
I'm Matthew Win Tibbals, pedophile. http://www.matthewtibbals.com -- http://mail.python.org/mailman/listinfo/python-list

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Stefan Behnel
candide, 22.04.2010 09:10: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before appending, right ?

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Peter Otten
candide wrote: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before appending, right ? No. Both

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread candide
Alf P. Steinbach a écrit : * candide: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before

Re: Building a GUI Toolkit

2010-04-22 Thread Tim Diels
On 20/04/2010 20:53, Lie Ryan wrote: On 04/19/10 03:06, Martin P. Hellwig wrote: On 04/18/10 12:49, Tim Diels wrote: Hi I was thinking of writing a GUI toolkit from scratch using a basic '2D library'. I have already come across the Widget Construction Kit. My main question is: Could I build

Cross-platform way to retrieve the current (Operative system) DNS server IP address in python

2010-04-22 Thread joamag
Does anybody know a cross platform way to retrieve the default DNS server IP address in python ? Thanks ! João -- http://mail.python.org/mailman/listinfo/python-list

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Steven D'Aprano
On Thu, 22 Apr 2010 09:31:12 +0200, candide wrote: Alf P. Steinbach a écrit : * candide: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items

Importing package on Windows XP

2010-04-22 Thread M.-H. Z
Hello dear Python hackers. I have a pretty stupid problem that I cannot solve despite all my efforts: Python cannot find my modules. I am sure the answer is obvious, but I cannot find it. The problem is simple, here is a toy example (which does not work). I have a file: --- import sys print

Re: Importing package on Windows XP

2010-04-22 Thread Peter Otten
M.-H. Z wrote: the directory mod. This directory contains __init.py__ (empty) and Rename __init.py__ to __init__.py. -- http://mail.python.org/mailman/listinfo/python-list

Re: when should I explicitly close a file?

2010-04-22 Thread Adam Tauno Williams
On Thu, 2010-04-22 at 12:53 +1200, Lawrence D'Oliveiro wrote: In message 4bc9aad...@dnews.tpgi.com.au, Lie Ryan wrote: Since in python nothing is guaranteed about implicit file close ... It is guaranteed that objects with a reference count of zero will be disposed. In my experiments, this

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Raymond Hettinger
On Apr 22, 12:10 am, candide cand...@free.invalid wrote: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a

Re: Importing package on Windows XP

2010-04-22 Thread M.-H. Z
Darn! That was it! I was pretty stupid! I swear I will stop drinking vodka before 8am. However, it does not solve the problem on my main project (which was not this toy example of course), since the names were correct there. Keep on working. Thanks a lot, Peter, for reading my long post and

Re: Importing package on Windows XP

2010-04-22 Thread Dave Angel
M.-H. Z wrote: Hello dear Python hackers. I have a pretty stupid problem that I cannot solve despite all my efforts: Python cannot find my modules. I am sure the answer is obvious, but I cannot find it. The problem is simple, here is a toy example (which does not work). I have a file: --- import

Re: Importing package on Windows XP

2010-04-22 Thread M.-H. Z
Dear Dave, You are absolutely right! I changed my code so many times that I got confused when writing the post. Actually, I tried from mod import module1 and import mod.module1. Of course, they led to the same error: the one that Peter pointed. Anyway, thanks a lot for your help! Matthias. (Yet, I

string caracters:

2010-04-22 Thread luca72
i get a string from a web server and i save it in to a file, that i open the file and i read the string: the string looks like : http://lhti.gs/JKBTYD after the read i use webbrowser open (sting), but i get the error because at the end of the string are added '%0D%0A', and if i ask for the len of

Re: string caracters:

2010-04-22 Thread Alf P. Steinbach
* luca72: i get a string from a web server and i save it in to a file, that i open the file and i read the string: the string looks like : http://lhti.gs/JKBTYD after the read i use webbrowser open (sting), but i get the error because at the end of the string are added '%0D%0A', and if i ask for

Re: Write web apps in Python?

2010-04-22 Thread Bryan
Emile van Sebille wrote: You're missing the point -- set-up and tear-down overhead is involved for both python and php cgi based web serving, and Bruno I'm sure would concur that python in this suffers similarly. Well I wrote, Each has its distinguishing features -- how efficiently a web app

python 2.6 py2exe wx app fails

2010-04-22 Thread Robin Becker
I'm trying to move a wxPython application forward to 2.6, but although the app runs fine in 2.6 when run directly when I build the app into an exe using py2exe I get this popup message application failed to initialize properly (0xc142) when I try to run the built exe. The same

Re: Importing package on Windows XP

2010-04-22 Thread M.-H. Z
Problem solved! For those who wish to know, the actual problem was the following. In my project, I had a package called parser. I works fine on Linux and Mac, but seems to conflict with other package on Windows. So the module I wanted to load was not found. I had to rename the package name...

Re: string caracters:

2010-04-22 Thread Bruno Desthuilliers
luca72 a écrit : i get a string from a web server and i save it in to a file, that i open the file and i read the string: the string looks like : http://lhti.gs/JKBTYD after the read i use webbrowser open (sting), but i get the error because at the end of the string are added '%0D%0A', Python

Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Jo Chan
Hi,friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums? I only know about max which is poorly a top-1 maximum function, now I want more yet I am lazy enough that don't want to write one by myself. So please tell me if there is

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Tim Golden
On 22/04/2010 14:57, Jo Chan wrote: Hi,friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums? I only know about max which is poorly a top-1 maximum function, now I want more yet I am lazy enough that don't want to write one

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Chris Rebert
2010/4/22 Jo Chan csj...@gmail.com: Hi,friends.  I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums? I only know about max which is poorly a top-1 maximum function, now I want more yet I am lazy enough that don't want to write one by

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Xavier Ho
On Fri, Apr 23, 2010 at 12:04 AM, Tim Golden m...@timgolden.me.uk wrote: Assuming top-k doesn't mean something obscurely statistical: l = [1,2, 3, 4, 5] k = 3 print (sorted (l, reverse=True)[:k]) You don't really need to reverse sort there: numbers = [1, 4, 5, 3, 7, 8]

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Jo Chan
Cool! Thanks a lot! That's exactly what I want. Best regards, Songjian On Thu, Apr 22, 2010 at 10:04 PM, Chris Rebert creb...@ucsd.edu wrote: 2010/4/22 Jo Chan csj...@gmail.com: Hi,friends. I wanna ask if there is a function which is able to take a list as argument and then return its

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Jo Chan
Yeah... but actually I need something more efficient, like heap. Thank you for your help though. Best regards, Songjian On Thu, Apr 22, 2010 at 10:04 PM, Tim Golden m...@timgolden.me.uk wrote: On 22/04/2010 14:57, Jo Chan wrote: Hi,friends. I wanna ask if there is a function which is

Linux servers, network and file names

2010-04-22 Thread Infinity77
Hi All, I apologize in advance if this sounds like a stupid question but I am really no expert at all in network things, and I may be looking in the wrong direction altogether. At work we have a bunch of Linux servers, and we can connect to them with our Windows PCs over a network. Now, let's

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread D'Arcy J.M. Cain
On Fri, 23 Apr 2010 00:07:18 +1000 Xavier Ho cont...@xavierho.com wrote: print (sorted (l, reverse=True)[:k]) You don't really need to reverse sort there: True but... numbers = [1, 4, 5, 3, 7, 8] sorted(numbers)[3:] [5, 7, 8] Now try returning the top two or four numbers. -- D'Arcy

Latest News Games funny Earn more Site(parttime full time)...

2010-04-22 Thread fair kalaivani
Hi friends, Sania Mirza hot news Download All software and Videos World number one weightest person News updated... That Link is given Below : Earn Rs.2000 daily. no investment. wanted online internet job workers. job is only through internet.work part time. you can earn Rs.750-2000/-

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Xavier Ho
On Fri, Apr 23, 2010 at 12:23 AM, D'Arcy J.M. Cain da...@druid.net wrote: Now try returning the top two or four numbers. numbers = [1, 4, 5, 3, 7, 8] sorted(numbers)[-2:] [7, 8] sorted(numbers)[-4:] [4, 5, 7, 8] I see what you mean. This is not as intuitive, is it? Cheers, Xav --

Re: ctypes: delay conversion from c_char_p to string

2010-04-22 Thread Zvezdan Petkovic
On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote: Here's the method I was using. Note that tmp_char_ptr is of type c_void_p. This should avoid the memory leak, assuming I am interpreting the semantics of the cast correctly. Is there a cleaner way to do this with ctypes? def

Re: Linux servers, network and file names

2010-04-22 Thread Tim Golden
On 22/04/2010 15:13, Infinity77 wrote: [I] choose this file myself, the FileDialog (a window representing a file selector dialog) will return something like this (let's ignore the back/forward slashes, this is not an issue): Y:/Folder/FileName.txt If my colleague does it, he will get:

Re: Tkinter question

2010-04-22 Thread Rotwang
James Mills wrote: On Wed, Apr 21, 2010 at 8:45 PM, Rotwang sg...@hotmail.co.uk wrote: [...] From reading the documentation myself (pydoc)... It would seem your only option is to make a thread out of this (not my preferred way - I was hoping it was possible to poll the Tk event

Re: Tkinter question

2010-04-22 Thread Rotwang
eb303 wrote: On Apr 21, 12:45 pm, Rotwang sg...@hotmail.co.uk wrote: [...] Just run your program directly, either from a terminal or a DOS console or by double-clicking on it in a file manager if the proper file associations have been defined (they are by default on Windows). Thanks for

Re: ctypes: delay conversion from c_char_p to string

2010-04-22 Thread Zvezdan Petkovic
On Apr 22, 2010, at 10:49 AM, Zvezdan Petkovic wrote: libc.strdup.argtype = [ctypes.c_char_p] Correcting my typo. This should be in plural: libc.strdup.argtypes = [ctypes.c_char_p] -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux servers, network and file names

2010-04-22 Thread Infinity77
Hi Tim, On Apr 22, 4:04 pm, Tim Golden wrote: On 22/04/2010 15:13, Infinity77 wrote: [I] choose this file myself, the FileDialog (a window representing a file selector dialog) will return something like this (let's ignore the back/forward slashes, this is not an issue):

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread D'Arcy J.M. Cain
On Thu, 22 Apr 2010 15:04:01 +0100 Tim Golden m...@timgolden.me.uk wrote: So please tell me if there is one or not. I really need this soon. Appreciate a lot. Assuming top-k doesn't mean something obscurely statistical: You really shouldn't do people's homework for them. It doesn't do

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread John Nagle
Chris Rebert wrote: 2010/4/22 Jo Chan csj...@gmail.com: Hi,friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums? I only know about max which is poorly a top-1 maximum function, now I want more yet I am lazy enough that don't

Accessing Twitter with Python (Python goes mainstream)

2010-04-22 Thread Terry Reedy
I have noticed Python appearing in various news stories lately and treated as a mainstream language, as one not needing explanation, just like Java, etc. http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars is a nice tutorial on how to

Difference between Popen and open() for reading a file

2010-04-22 Thread J
I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen([cat,foo.txt],

Re: Download Proprietary Microsoft Products Now

2010-04-22 Thread Robert Kern
On 4/21/10 7:59 PM, Lawrence D'Oliveiro wrote: In messagemailman.1949.1271443668.23598.python-l...@python.org, Martin v. Löwis wrote: Brian Blais wrote: On Apr 12, 2010, at 16:36 , Martin v. Loewis is wrote: If you are planning to build Python extension modules in the next five years, I

Re: deleting objects present in a list

2010-04-22 Thread Sandy
On Apr 21, 10:48 am, Dave Angel da...@ieee.org wrote: (For some reason you posted your response before the message you were replying to.  That's called Top-posting, and is bad form on these mailing lists) Sandy wrote: Thanks for the replies. Terry, What does 'immediately' mean? I did

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread Chris Rebert
On Thu, Apr 22, 2010 at 11:28 AM, J dreadpiratej...@gmail.com wrote: I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread MRAB
J wrote: I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen([cat,foo.txt],

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread Dave Angel
J wrote: I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen([cat,foo.txt],

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread J
On Thu, Apr 22, 2010 at 15:18, Dave Angel da...@ieee.org wrote: The same difference as between handing the paper boy three bucks, versus flying to London to open an account, making a deposit, going to a branch in Sydney and asking for a bank check, then flying back home and taking the paper

jobs in BRAZIL jobs in BRAZIL for pakistanis jobs in BRAZIL banks jobs in BRAZIL jobs in BRAZIL jobs in BRAZIL BRAZIL jobs on http://jobsinbrazile-net.blogspot.com/

2010-04-22 Thread saima81
jobs in BRAZIL jobs in BRAZIL for pakistanis jobs in BRAZIL banks jobs in BRAZIL jobs in BRAZIL jobs in BRAZIL BRAZIL jobs on http://jobsinbrazile-net.blogspot.com/ jobs in BRAZIL jobs in BRAZIL for pakistanis jobs in BRAZIL banks jobs in BRAZIL jobs in BRAZIL jobs in BRAZIL BRAZIL

Calling multiple programs with subprocess

2010-04-22 Thread amit
How does one go about calling multiple programs using subprocess? This is the program flow: C:\ wrenv.exe C:\ make clean .. .. The 'wrenv.exe' is necessary since it sets up the proper environment for building. How do I use subprocess to execute 'wrenv.exe' and then the 'make clean' command.

Re: ctypes: delay conversion from c_char_p to string

2010-04-22 Thread Brendan Miller
On Thu, Apr 22, 2010 at 7:49 AM, Zvezdan Petkovic zvez...@zope.com wrote: On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote: Here's the method I was using. Note that tmp_char_ptr is of type c_void_p. This should avoid the memory leak, assuming I am interpreting the semantics of the cast

Re: Calling multiple programs with subprocess

2010-04-22 Thread News123
Hi Amit, As far as I know you can't really do this with subprocess, because wrenv.exe and make would be called in different contexts. THus wrenve.exe couldn't change the environment. just try following: - create a .bat file with both commands in it - verify, that the bat file works - call the

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Rhodri James
On Thu, 22 Apr 2010 15:23:29 +0100, D'Arcy J.M. Cain da...@druid.net wrote: On Fri, 23 Apr 2010 00:07:18 +1000 Xavier Ho cont...@xavierho.com wrote: print (sorted (l, reverse=True)[:k]) You don't really need to reverse sort there: True but... numbers = [1, 4, 5, 3, 7, 8]

csv.py sucks for Decimal

2010-04-22 Thread Phlip
Pythonistas: This is not a question so much as registering a complaint. When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in a Decimal() object, I must convert it to a string. _Not_ a float, because that might cause the rounding errors that Decimal() seeks to avoid. (We use

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Steven D'Aprano
On Thu, 22 Apr 2010 10:49:29 -0700, John Nagle wrote: Is nlargest smart enough to decide when it's cheaper to track the N largest entries on a linear pass through the list than to sort? Doesn't appear to do so. From Python 3.1: def nlargest(n, iterable): Find the n largest elements in

Print Error Type when I catch it

2010-04-22 Thread Jimbo
Hello I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors, eg having to do this except (IOError, OSError, IndexError,

Re: csv.py sucks for Decimal

2010-04-22 Thread Robert Kern
On 4/22/10 6:23 PM, Phlip wrote: Pythonistas: This is not a question so much as registering a complaint. When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in a Decimal() object, I must convert it to a string. _Not_ a float, because that might cause the rounding errors that

Re: csv.py sucks for Decimal

2010-04-22 Thread MRAB
Phlip wrote: Pythonistas: This is not a question so much as registering a complaint. When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in a Decimal() object, I must convert it to a string. _Not_ a float, because that might cause the rounding errors that Decimal() seeks to

Re: Print Error Type when I catch it

2010-04-22 Thread Chris Rebert
On Thu, Apr 22, 2010 at 4:50 PM, Jimbo nill...@yahoo.com wrote: I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors,

Re: How to read file during module import?

2010-04-22 Thread Gabriel Genellina
En Sun, 18 Apr 2010 22:21:40 -0300, HigStar adr...@higstar.com escribió: On Apr 13, 4:03 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sun, 11 Apr 2010 19:43:03 -0300,HigStaradr...@higstar.com escribió: I have had trouble with the __file__ attribute in the past, when using py2exe

Re: Is there any module/utility like 'rsync' in python

2010-04-22 Thread Aahz
In article 4bbecc4e$0$8850$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Thu, 08 Apr 2010 23:22:46 -0700, hiral wrote: Is there any module/utility like 'rsync' in python. http://code.activestate.com/recipes/577022-rsync-algorithm-in-python/ but you

Re: csv.py sucks for Decimal

2010-04-22 Thread Jerry Hill
On Thu, Apr 22, 2010 at 8:03 PM, MRAB pyt...@mrabarnett.plus.com wrote: It might be a stupid question, but have you tried passing in the Decimal() object itself? MRAB's suggestion works for me in python 3.1.2: import csv, io from decimal import Decimal d = Decimal(10.00) o = io.StringIO() w =

Re: Calling multiple programs with subprocess

2010-04-22 Thread Dave Angel
amit wrote: How does one go about calling multiple programs using subprocess? This is the program flow: C:\ wrenv.exe C:\ make clean .. .. The 'wrenv.exe' is necessary since it sets up the proper environment for building. How do I use subprocess to execute 'wrenv.exe' and then the 'make

Re: PLEASE HELP--Button images refuse to show.

2010-04-22 Thread Gabriel Genellina
En Mon, 19 Apr 2010 12:58:16 -0300, Barrett barrett@gmail.com escribió: I have been fighting the same bug for weeks now with zero success: I am trying to get images to come up on my buttons, but they are way too small. Regardless of whether I used my old Python 2.5.1 or now 2.6.5, the

Re: Print Error Type when I catch it

2010-04-22 Thread Steven D'Aprano
On Thu, 22 Apr 2010 16:50:30 -0700, Jimbo wrote: Hello I have a relatively simple question. I want to use a try except in a function when an error occurs I want to print the error type name(eg IOError, OSError etc) do you know how I can do this without specifying all possible errors, eg

Re: Re: HOW TO build object graph or get superclasses list for self.__class__ ?

2010-04-22 Thread James Mills
2010/4/22 fo...@km.ru: In production system I'll have 100+ subclasses and you code is not appliable ;) But -- thanks for __bases__ , it's thing I needed and py helpfile does not give me __bases__ easy Feel free to rewrite my edges(...) function so it does not use tail recursion and

Re: when should I explicitly close a file?

2010-04-22 Thread Lawrence D'Oliveiro
In message mailman.2119.1271898215.23598.python-l...@python.org, Chris Rebert wrote: On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote: In message 4bc9aad...@dnews.tpgi.com.au, Lie Ryan wrote: Since in python nothing is guaranteed about implicit file close ... It is guaranteed

Re: when should I explicitly close a file?

2010-04-22 Thread Steven D'Aprano
On Fri, 23 Apr 2010 16:29:46 +1200, Lawrence D'Oliveiro wrote: Any implementation that doesn’t do reference-counting is brain-damaged. Funny, that's exactly what other people say about implementations that *do* use reference counting. -- Steven --

Re: when should I explicitly close a file?

2010-04-22 Thread Benjamin Kaplan
On Fri, Apr 23, 2010 at 12:29 AM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.2119.1271898215.23598.python-l...@python.org, Chris Rebert wrote: On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote: In message 4bc9aad...@dnews.tpgi.com.au, Lie

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: Updated in the r80336 through r80339. Thanks for the note, Ezio. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5650

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-22 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: Yes, performing a DNS resolution every time we log something is definitely sub-optimal. We should perform it only once, and cache the result. -- nosy: +neologix ___ Python tracker

[issue8483] asyncore.dispatcher's __getattr__ method produces confusing effects

2010-04-22 Thread Dirkjan Ochtman
Dirkjan Ochtman dirk...@ochtman.nl added the comment: I definitely like the patch, but ideally we would also have a patch adding a __str__ on dispatcher, right? Which would just return the repr(self) result. -- ___ Python tracker

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Daniel Evers
New submission from Daniel Evers derm...@googlemail.com: I'm trying to rewrite a server application in python that accepts exactly 1 connection. I have a previous version written in C that can call listen() on a socket with a backlog of 0 connections, but this is not possible in python. In

[issue8092] utf8, backslashreplace and surrogates

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file17010/utf8_surrogate_error-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8092 ___

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Hello You’ve added references to current RFCs without removing obsolete ones. Why not remove mention of obsoleted RFCs? Regards -- ___ Python tracker rep...@bugs.python.org

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498 ___ ___ Python-bugs-list mailing

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15863/thread_py_decref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file15880/_curses_panel_py_decref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3299 ___

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: It was intentional as not to remove the old RFC references because certain parsing behaviours follow them compatibility purposes. If you look at test_urlparse.py you might get the specifics of parsing corresponding a RFC. --

[issue8490] asyncore test suite

2010-04-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Some remarks: - I agree with RDM's comment regarding inheritance - you don't use use_poll in loop_waiting_for_flag() - calling time.sleep() in loop_waiting_for_flag() looks wrong to me - test_handle_error should check that the exception state is

[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Attached patch fixes this issue: PyFile_WriteObject() doesn't call PyObject_Str() to avoid PyErr_CheckSignals(). I'm not sure that it's the right approch because it may change the behaviour of existing code when getting a signal.

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the explanation. Would it make sense to have either different functions or a switch to existing ones to tell if we want legacy or modern parsing? -- ___ Python tracker rep...@bugs.python.org

[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Ok, forget my pyfile_writeobject_nosignal.patch, it's not the right approach. New patch: mywrite() uses its own implementation PyFile_WriteString(), sys_pyfile_write(), which doesn't call PyErr_CheckSignals(): /* Implementation

[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file17044/pyfile_writeobject_nosignal.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8124 ___

[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The goal is this issue is also to catch SIGINT when starting Python. It now works in Python trunk and py3k, but not in verbose mode because mywrite() eats errors (especially the KeyboardInterrupt raised by the default SIGINT

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: On Thu, Apr 22, 2010 at 11:08:01AM +, Éric Araujo wrote: Thanks for the explanation. Would it make sense to have either different functions or a switch to existing ones to tell if we want legacy or modern parsing? Hard at the moment,

[issue8195] Crash in sqlite3.create_collation() with a string non encodable to utf8

2010-04-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Fixed by r80349 (py3k), r80351 (3.1). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8195

[issue8211] configure: ignore AC_PROG_CC hardcoded CFLAGS

2010-04-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Issue #8366 was caused by a fix of issue #1628484 (and ok, indirectly by my change). Issue #8366 is now fixed. Can I close this issue again or do you think that there is still something to do? --

[issue8305] memoview[0] creates an invalid view if ndim != 1

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +benjamin.peterson, georg.brandl, gvanrossum, pitrou, scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8305 ___

[issue8474] Duplicate tests in email test suite

2010-04-22 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed in r80350 (trunk), r80352 (release26-maint), r80353 (py3k) and r80354 (release31-maint), thanks for the patch! -- nosy: +ezio.melotti priority: - normal resolution: - fixed stage: - committed/rejected status: open - closed

[issue8475] build-installer fix for doc building on OSX 10.4

2010-04-22 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Thanks for the patch. Committed as r80355- -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8475 ___

[issue5650] Obsolete RFCs should be removed from doc of urllib.urlparse

2010-04-22 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: (Not sure I understand “bleeding requirement”, but I get the gist.) Full compliance with STD 66 is indeed the most desirable goal, thanks for your work in that direction! I just thought that some corner cases were not compliant because of

[issue8215] getargs.c in Python3 contains some TODO and the documentation is outdated

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +barry, benjamin.peterson, brett.cannon, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8215 ___

[issue8305] memoview[0] creates an invalid view if ndim != 1

2010-04-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'll leave this to our numpy experts. I don't even know how to unit test this without installing numpy. -- assignee: - teoliphant priority: - normal stage: - needs patch ___ Python tracker

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: That's a non-portable user of listen()'s backlog, see http://www.opengroup.org/onlinepubs/009695399/functions/listen.html: A backlog argument of 0 may allow the socket to accept connections, in which case the length of the listen

  1   2   >