[ANN] PyYAML-3.07: YAML parser and emitter for Python

2008-12-28 Thread Kirill Simonov
Announcing PyYAML-3.07 A new release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML Changes === * The emitter learned to use an optional indentation indicator for block scalars; thus scalars with leading whitespaces

Re: math module for Decimals

2008-12-28 Thread Steven D'Aprano
On Sat, 27 Dec 2008 21:50:09 -0800, jerry.carl.mi wrote: Which math functions? ln, log10, exp, sqrt already exist as methods of Decimal instances. At the end of the Decimal docs there are a few examples, including computing sin and cos (but apparently they naïvely use a McLaurin series like

Re: Need help getting MoinMoin to run under WSGI

2008-12-28 Thread Ron Garret
In article rnospamon-79fa22.21571527122...@news.gha.chartermi.net, Ron Garret rnospa...@flownet.com wrote: I successfully installed MoinMoin as a CGI according to the instructions on the moinmo.in site. But when I tried to switch over to running it under wsgi it failed thusly: [Sat Dec

Re: tkinter 3.0 multiple keyboard events together

2008-12-28 Thread Pavel Kosina
janislaw napsal(a): Um, I could be only guessing what are you meant to do, unless you describe your problem in more detailed way. I.e. describe the desired behaviour, show code which you have, and describe the current behaviour. well, I am working on a tutorial for youngster (thats why i

Re: Doing set operation on non-hashable objects

2008-12-28 Thread 5lvqbwl02
... db is a dict, where the values are also dicts. A function searches through db and returns a list of values, each of which is a dict as described above. I need to perform set operations on these lists (intersection and union) However the objects themselves are not hashable, and

Re: Doing set operation on non-hashable objects

2008-12-28 Thread 5lvqbwl02
On Dec 24, 12:21 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 24 Dec 2008 17:16:59 -0200, 5lvqbw...@sneakemail.com escribió: I'm writing an application which is structured roughly as follows: db is a dict, where the values are also dicts. A function searches through db and

Re: Need help getting MoinMoin to run under WSGI

2008-12-28 Thread Graham Dumpleton
On Dec 28, 7:22 pm, Ron Garret rnospa...@flownet.com wrote: In article rnospamon-79fa22.21571527122...@news.gha.chartermi.net,  Ron Garret rnospa...@flownet.com wrote: I successfully installed MoinMoin as a CGI according to the instructions on the moinmo.in site.  But when I tried to

Re: sys.stdout.write()'s bug or doc bug?

2008-12-28 Thread Qiangning Hong
On Dec 27, 12:31 am, Martin mar...@marcher.name wrote: Python 2.4.4 (#2, Oct 22 2008, 19:52:44) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type help, copyright, credits or license for more information. u = u\u554a print u 啊 sys.stdout.write(u + \n) Traceback (most

Re: assignment with [:]

2008-12-28 Thread James Stroud
Ben Bush wrote: On Dec 26, 4:46 pm, Tim Chase python.l...@tim.thechases.com wrote: What does *not* work is 3 * [0,1,2] As you know, this gives [0,1,2,0,1,2,0,1,2] What I am hoping for is [0,3,6] I see that I can use numpy.multiply(3,range(3)) but this seems

Re: assignment with [:]

2008-12-28 Thread James Stroud
James Stroud wrote: py a = [1, 2, 3] py a1 = a py a1[:] = [x*3 for x in a1] py a1 [3, 6, 9] py a1 [3, 6, 9] This should have been: py a = [1, 2, 3] py a1 = a py a1[:] = [x*3 for x in a1] py a [3, 6, 9] py a1 [3, 6, 9] James -- James Stroud UCLA-DOE Institute for Genomics

Re: ctypes strings

2008-12-28 Thread Hendrik van Rooyen
Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Hmmm, I don't think posting a potentially harmful example is actually a good idea... True - its my only example though, and nobody else was bothering to reply, so I kicked off and flushed out some response. Who was it that said that the way to

What is site-packages?

2008-12-28 Thread Hussein B
Hey, What is /usr/lib/pythonx.y/site-packages folder and for what it is used usually? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is site-packages?

2008-12-28 Thread Chris Rebert
On Sun, Dec 28, 2008 at 3:40 AM, Hussein B hubaghd...@gmail.com wrote: Hey, What is /usr/lib/pythonx.y/site-packages folder and for what it is used usually? I believe it's where third-party libraries are typically installed to. Cheers, Chris -- Follow the path of the Iguana...

Re: What is site-packages?

2008-12-28 Thread Hussein B
On Dec 28, 2:04 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Dec 28, 2008 at 3:40 AM, Hussein B hubaghd...@gmail.com wrote: Hey, What is /usr/lib/pythonx.y/site-packages folder and for what it is used usually? I believe it's where third-party libraries are typically installed to.

ftp EOF error, thread and process

2008-12-28 Thread nemo
Hi all, My code like this raise an EOFError, It happens if I use the Process module, while, if I use thread.start_new_thread(ftp.pwd,()), it seems works well. And I wondered why. from ftplib import FTP import thread from multiprocessing import Process if __name__ == '__main__': ftp =

Re: What is site-packages?

2008-12-28 Thread Marek Kubica
On Sun, 28 Dec 2008 04:06:36 -0800, Hussein B wrote: You mean like MoinMoin, Django or Pylons for example? Yes. Or lxml, BeautifulSoup, psycopg2 and basically anything that is available on PyPI. regards, Marek -- http://mail.python.org/mailman/listinfo/python-list

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
Hi Steven... thanks for your kind and extensive reply. Lots of good food for thought. I know it's easy to complain about lack of functionality, but it really was not my intention. Python is very cool as it is and I still know too little about it to even suggest anything. I just thought maybe I was

/kolab/bin/python: double free or corruption (fasttop)

2008-12-28 Thread aspineux
I got this. This is a test script, to help me to understand why I have unexpected result in application. But I got a more unexpected result, and probably wrong error message about the read-only cursor. The full script is at the end. db cleanup, 326 records deleted, 9990 remains Exception in

Re: strange behavior of math.sqrt() in new 3.0 version

2008-12-28 Thread Steve Holden
Tim Roberts wrote: Scott David Daniels scott.dani...@acm.org wrote: I avoid using single-letter variables except where I know the types from the name (so I use i, j, k, l, m, n as integers, s as string, and w, x, y, and z I am a little looser with (but usually float or complex). It's

Re: sys.stdout.write()'s bug or doc bug?

2008-12-28 Thread Steven D'Aprano
On Sun, 28 Dec 2008 02:37:55 -0800, Qiangning Hong wrote: So, my question is, as sys.stdout IS a file object, why it does not use its encoding attribute to convert the given unicode? An implementation bug? A documenation bug? hmm I always thought sys.stdout is a file-like object not that

Re: math module for Decimals

2008-12-28 Thread Mark Dickinson
On Dec 28, 12:02 am, jerry.carl...@gmail.com wrote: I have been looking for a Python module with math functions that would both eat and spit Decimals. The standard math module eats Decimals allright but spits floats. Yes: it just converts the input (whether float, int, Fraction or Decimal) to

Re: math module for Decimals

2008-12-28 Thread Mark Dickinson
On Dec 28, 7:28 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Ah crap, I forgot that from_float() has been left out of the decimal API. That's very annoying. Agreed. It's maybe even annoying enough that a feature request at bugs.python.org might be honoured. (Hint, hint!)

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
- are you using Decimal for the base-10-ness or the   extra precision Decimal provides?  Or significant zeros?   Or compatibility with existing Decimal code, or what? Oh boy, now I will finally prove myself illiterate... well, so be it. But i am after the extra precision: from math import *

Re: math module for Decimals

2008-12-28 Thread Mark Dickinson
On Dec 28, 3:55 pm, jerry.carl...@gmail.com wrote: But i am after the extra precision: from math import * (1+1e-16)-1 0.0 Sounds like you don't care too much about the base-10 part, so there may be other solutions out there. Have you tried: 1. mpmath? 2. sympy? 3. Sage? Any of these is

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
1. mpmath? 2. sympy? 3. Sage? Haven't tried those, i guess i have some studying to do. x=Decimal.__mod__(x,Decimal('2')*pi()) Works fine for what i need, but i am sure it's not the right way to do it. I don't know of any better way to deal with large arguments. The main problem

Cheetah

2008-12-28 Thread sopherfish
1. In Cheetah 2.0.1, both from python 2.5.2 and 2.6, after I do a #from datetime import date, most of the datetime objects seem to work fine. For example, $date(2008, 12, 15) works. However $date.today() does not work and I get an exception required argument year not found. In Python both 2.5.2

reportlab

2008-12-28 Thread sopherfish
In reportlab 2.2, when I generate a PDF, no matter how many nbsps I put it, I only get one space. I am using it with python 2.6. The PDF generates fine and one $nbsp works, but for some reason, when I put it in multiple times, I still only get one space. --

return in def

2008-12-28 Thread Roger
Hi Everyone, First I want to thank everyone that posts to this group. I read it daily and always learn something new even if I never feel like I have anything to contribute but my questions. When I define a method I always include a return statement out of habit even if I don't return anything

How to kill orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
Hi, I know that it's not possible to kill threads but I'm wondering if does exist some workaround for my problem. I have a test suite which does a massive usage of threads. Sometimes happens that one test fails, the test suite keeps running until the end, and when it's finished the program hangs

Re: return in def

2008-12-28 Thread r
On Dec 28, 11:19 am, Roger rdcol...@gmail.com wrote: Hi Everyone, First I want to thank everyone that posts to this group.  I read it daily and always learn something new even if I never feel like I have anything to contribute but my questions. When I define a method I always include a

Re: return in def

2008-12-28 Thread Steve Holden
Roger wrote: Hi Everyone, First I want to thank everyone that posts to this group. I read it daily and always learn something new even if I never feel like I have anything to contribute but my questions. When I define a method I always include a return statement out of habit even if I

Re: How to kill orphaned threads at program exit

2008-12-28 Thread Roy Smith
In article b133b978-fe63-4893-bb33-8c96bfb59...@v5g2000prm.googlegroups.com, Giampaolo Rodola' gne...@gmail.com wrote: Hi, I know that it's not possible to kill threads but I'm wondering if does exist some workaround for my problem. I have a test suite which does a massive usage of threads.

Re: return in def

2008-12-28 Thread Gerard Flanagan
On Dec 28, 5:19 pm, Roger rdcol...@gmail.com wrote: Hi Everyone, [...] When I define a method I always include a return statement out of habit even if I don't return anything explicitly: def something():         # do something         return Is this pythonic or excessive?  Is this an

Re: return in def

2008-12-28 Thread Bruno Desthuilliers
Roger a écrit : When I define a method I always include a return statement out of habit even if I don't return anything explicitly: def something(): # do something return Is this pythonic or excessive? If it's the last statement in the function body, it is indeed

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
mpmath... wow... just did what i needed :-) Thanks, Mark! Hopefully i did not waste too much of your time... and perhaps this discussion will send other lost sheeps in the right direction. (Still, it would make sense to have the goniometric functions in decimal.) --

Re: return in def

2008-12-28 Thread Manish Sinha
Roger wrote: Hi Everyone, First I want to thank everyone that posts to this group. I read it daily and always learn something new even if I never feel like I have anything to contribute but my questions. Same here, I always read the news, but hardly post anything since am not very much

Re: return in def

2008-12-28 Thread MRAB
Gerard Flanagan wrote: On Dec 28, 5:19 pm, Roger rdcol...@gmail.com wrote: Hi Everyone, [...] When I define a method I always include a return statement out of habit even if I don't return anything explicitly: def something(): # do something return Is this pythonic or

Re: return in def

2008-12-28 Thread Steven D'Aprano
On Sun, 28 Dec 2008 12:38:50 -0500, Steve Holden wrote: Roger wrote: Hi Everyone, First I want to thank everyone that posts to this group. I read it daily and always learn something new even if I never feel like I have anything to contribute but my questions. When I define a method I

Apache/mod_python: Registering a request handler dynamically

2008-12-28 Thread Samuel
Hi, Is there a way to dynamically overwrite the request handler from within mod_python scripts? Something along those lines: --- from mod_python import apache def myhandler(request): request.content_type = 'text/plain' request.write('Hello world')

Re: return in def

2008-12-28 Thread Roger
Curious. When I see a bare return, the first thing I think is that the author forgot to include the return value and that it's a bug. The second thing I think is that maybe the function is a generator, and so I look for a yield. If I don't see a yield, I go back to thinking they've left out

Re: tkinter 3.0 multiple keyboard events together

2008-12-28 Thread janislaw
On 28 Gru, 09:43, Pavel Kosina g...@post.cz wrote: well, I am working on a tutorial for youngster (thats why i need to stay the code as easy as possible). In this game you are hunted by robots. I could use key7 on numeric keypad for left-up moving but seems to me, that 4+8 is much more

A form validation library with javascript validation

2008-12-28 Thread Grigory Temchenko
Hey everyone, Can someone advice me a beautiful or just cool library for form validation with javascript supporting? -- http://mail.python.org/mailman/listinfo/python-list

error on windows with commands.getstatusoutput

2008-12-28 Thread Lee Harr
My application is trying to start twistd in a cross-platform way. Unfortunately, it works fine on my linux system, but I do not have windows, and I am trying to debug this remotely on a system I never use :o( Anyhow, here is the error I am getting: cmd = '%s -y %s -l %s' % (conf.twistd,

Re: error on windows with commands.getstatusoutput

2008-12-28 Thread Pierre Bourdon
The commands module is Unix only. See its documentation : http://docs.python.org/library/commands.html On Sun, Dec 28, 2008 at 10:03 PM, Lee Harr miss...@hotmail.com wrote: My application is trying to start twistd in a cross-platform way. Unfortunately, it works fine on my linux system, but I

Re: return in def

2008-12-28 Thread Benjamin
On Dec 28, 1:35 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The second thing I think is that maybe the function is a generator, and so I look for a yield. You shouldn't, though; Generators can't contain any return statement. --

Re: return in def

2008-12-28 Thread Robert Kern
Benjamin wrote: On Dec 28, 1:35 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The second thing I think is that maybe the function is a generator, and so I look for a yield. You shouldn't, though; Generators can't contain any return statement. Yes, they can. It doesn't

Re: return in def

2008-12-28 Thread John Machin
On Dec 29, 8:36 am, Benjamin musiccomposit...@gmail.com wrote: On Dec 28, 1:35 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The second thing I think is that maybe the function is a generator, and so I look for a yield. You shouldn't, though; Generators can't contain

Re: return in def

2008-12-28 Thread John Machin
On Dec 29, 7:06 am, Roger rdcol...@gmail.com wrote: Curious. When I see a bare return, the first thing I think is that the author forgot to include the return value and that it's a bug. The second thing I think is that maybe the function is a generator, and so I look for a yield. If I

Re: Need help getting MoinMoin to run under WSGI

2008-12-28 Thread Ron Garret
In article f97e6514-1d36-42ed-b0f7-98e2b3162...@d36g2000prf.googlegroups.com, Graham Dumpleton graham.dumple...@gmail.com wrote: On Dec 28, 7:22 pm, Ron Garret rnospa...@flownet.com wrote: In article rnospamon-79fa22.21571527122...@news.gha.chartermi.net,  Ron Garret rnospa...@flownet.com

Python 3.0 Curses Unicode

2008-12-28 Thread Damian Johnson
Hi, I've switched to Python 3.0 for a new Japanese vocab quizzing application due to its much improved Unicode support. However, I'm running into an issue with displaying Unicode characters via curses. In Python 2.x a simple hello-world looks like: #!/usr/bin/python # coding=UTF-8 import curses

Re: return in def

2008-12-28 Thread Roger
On Dec 28, 5:12 pm, John Machin sjmac...@lexicon.net wrote: On Dec 29, 7:06 am, Roger rdcol...@gmail.com wrote: Curious. When I see a bare return, the first thing I think is that the author forgot to include the return value and that it's a bug. The second thing I think is that maybe

Any equivalent to Ruby's 'hpricot' html/xpath/css selector package?

2008-12-28 Thread Kenneth McDonald
Ruby has a package called 'hpricot' which can perform limited xpath queries, and CSS selector queries. However, what makes it really useful is that it does a good job of handling the broken html that is so commonly found on the web. Does Python have anything similar, i.e. something that

Re: multiply each element of a list by a number

2008-12-28 Thread Colin J. Williams
s...@pobox.com wrote: Colin ... perhaps faster than numpy: ... For extremely short lists, but not for much else: % for n in 1 10 100 1000 1 10 ; do echo len: $n echo -n numpy: python -m timeit -s 'import numpy ; a = numpy.array(range('$n'))' 'a*3'

RE: game engine (as in rules not graphics)

2008-12-28 Thread Phil Runciman
See: Chris Moss, Prolog++: The Power of Object-Oriented and Logic Programming (ISBN 0201565072) This book is a pretty handy intro to an OO version Prolog produced by Logic Programming Associates. Prolog is a wonderful tool for such things as working out a factory layout for new car

RE: error on windows with commands.getstatusoutput

2008-12-28 Thread Lee Harr
cmd = '%s -y %s -l %s' % (conf.twistd, conf.tztac, conf.twistdlog) status, output = commands.getstatusoutput(cmd) The commands module is Unix only. See its documentation : http://docs.python.org/library/commands.html Ah. Doh! I was going back and forth between all of the different ways to

[ANN] PyYAML-3.07: YAML parser and emitter for Python

2008-12-28 Thread Kirill Simonov
Announcing PyYAML-3.07 A new release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML Changes === * The emitter learned to use an optional indentation indicator for block scalars; thus scalars with leading whitespaces

Need help getting MoinMoin to run under SCGI

2008-12-28 Thread Ron Garret
So I have a MoinMoin installation running as a cgi and also under wsgi. Since I was on a roll I decided to press my luck and try running it under scgi. Following a suggestion in the following article: http://www.linuxjournal.com/article/9310 I wrote this little server adapter: from

ZSI - ServiceContainer

2008-12-28 Thread Stephen Chapman
Does Anyone know how to Make the ServiceContainer work under SSL Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get involved

2008-12-28 Thread Ben Finney
kajnilss...@hotmail.com writes: I'm new to the open source comunnity and I was wondering if there are any bugs that I can trouble shoot or just some beginner tasks I can be sent? Here are some pointers to how you can assist Python: URL:http://wiki.python.org/moin/Advocacy

HTML Correctness and Validators

2008-12-28 Thread Xah Lee
recently i wrote a blog essay about html correctness and html validators, with relations to the programing lang communities. I hope programing lang fans will take more consideration on the correctness of the doc they produces. HTML Correctness and Validators •

ftp design question

2008-12-28 Thread nemo
Hi,all. I'm on a toy ftp project and I want it to be convinient for the user to cancel an undergoing downloading while continue others. The following code explains: for file in download_files: self.ftp.retrbinary('RETR '+file, fileHandler) Thers seems not a solid way to cancel this transfer

Re: ftp design question

2008-12-28 Thread Steve Holden
nemo wrote: Hi,all. I'm on a toy ftp project and I want it to be convinient for the user to cancel an undergoing downloading while continue others. The following code explains: for file in download_files: self.ftp.retrbinary('RETR '+file, fileHandler) Thers seems not a solid way to

Re: How to kill orphaned threads at program exit

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 15:47:24 -0200, Roy Smith r...@panix.com escribió: In article b133b978-fe63-4893-bb33-8c96bfb59...@v5g2000prm.googlegroups.com, Giampaolo Rodola' gne...@gmail.com wrote: I know that it's not possible to kill threads but I'm wondering if does exist some workaround for my

Re: How to display Chinese in a list retrieved from database via python

2008-12-28 Thread zxo102
On 12月27日, 下午4时08分, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sat, 27 Dec 2008 03:03:24 -0200,zxo102zxo...@gmail.com escribió: On 12月26日, 下午3时16分, Mark Tolonen metolone+gm...@gmail.com   wrote: I was able to display 中文 successfully with this code: f=open('test.html','wt')

Otra vez Python en xkcd

2008-12-28 Thread Gabriel Genellina
Hola En el especial de Navidad de este año: http://xkcd.com/521/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes strings

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 08:59:03 -0200, Hendrik van Rooyen m...@microcorp.co.za escribió: Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Hmmm, I don't think posting a potentially harmful example is actually a good idea... True - its my only example though, and nobody else was bothering to

Re: tkinter 3.0 multiple keyboard events together

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 06:43:20 -0200, Pavel Kosina g...@post.cz escribió: well, I am working on a tutorial for youngster (thats why i need to stay the code as easy as possible). In this game you are hunted by robots. I could use key7 on numeric keypad for left-up moving but seems to me, that

Re: ftp EOF error, thread and process

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 10:44:11 -0200, nemo nemoking...@gmail.com escribió: My code like this raise an EOFError, It happens if I use the Process module, while, if I use thread.start_new_thread(ftp.pwd,()), it seems works well. And I wondered why. from ftplib import FTP import thread from

why cannot assign to function call

2008-12-28 Thread scsoce
I have a function return a reference, and want to assign to the reference, simply like this: def f(a) return a b = 0 * f( b ) = 1* but the last line will be refused as can't assign to function call. In my thought , the assignment is very nature, but why the interpreter refused

Re: why cannot assign to function call

2008-12-28 Thread James Mills
On Mon, Dec 29, 2008 at 4:01 PM, scsoce scs...@gmail.com wrote: I have a function return a reference, and want to assign to the reference, simply like this: def f(a) return a b = 0 * f( b ) = 1* but the last line will be refused as can't assign to function call. In my thought ,

Re: /kolab/bin/python: double free or corruption (fasttop)

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 12:10:06 -0200, aspineux aspin...@gmail.com escribió: I got this. This is a test script, to help me to understand why I have unexpected result in application. But I got a more unexpected result, and probably wrong error message about the read-only cursor. def server():

Re: why cannot assign to function call

2008-12-28 Thread r
On Dec 29, 12:01 am, scsoce scs...@gmail.com wrote: I have a function return a reference, and want to assign to the reference, simply like this:  def f(a)           return a      b = 0     * f( b ) = 1* but the last line will be refused as can't assign to function call. In my thought , the

Re: parsing csv files class

2008-12-28 Thread alex goretoy
Tim, Thank you for your suggestions that you made. I will modify my class to what you said. I will also remove find_and_replace. seeing as I won't use it anywhere else. I think I put it there for some test and forgot to delete it. I was actually deleting the header outside of the class. This works

Re: Cheetah

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 15:01:14 -0200, sopherf...@gmail.com escribió: 1. In Cheetah 2.0.1, both from python 2.5.2 and 2.6, after I do a [...] 2. In reportlab 2.2, when I generate a PDF, no matter how many nbsps [...] Better to report those problems to each product authors. -- Gabriel

Re: /kolab/bin/python: double free or corruption (fasttop)

2008-12-28 Thread Gabriel Genellina
En Mon, 29 Dec 2008 04:12:02 -0200, Gabriel Genellina gagsl-...@yahoo.com.ar escribió: En Sun, 28 Dec 2008 12:10:06 -0200, aspineux aspin...@gmail.com escribió: I got this. This is a test script, to help me to understand why I have unexpected result in application. But I got a more

Re: ftp design question

2008-12-28 Thread nemo
On Dec 29, 12:31 pm, Steve Holden st...@holdenweb.com wrote: nemo wrote: Hi,all. I'm on a toy ftp project and I want it to be convinient for the user to cancel an undergoing downloading while continue others. The following code explains: for file in download_files:    

Re: why cannot assign to function call

2008-12-28 Thread Erik Max Francis
scsoce wrote: I have a function return a reference, and want to assign to the reference, simply like this: def f(a) return a b = 0 * f( b ) = 1* but the last line will be refused as can't assign to function call. In my thought , the assignment is very nature, but why the

Get a list of functions in a file

2008-12-28 Thread member Basu
I'm putting some utility functions in a file and then building a simple shell interface to them. Is their some way I can automatically get a list of all the functions in the file? I could wrap them in a class and then use attributes, but I'd rather leave them as simple functions. Thanks, Basu --

Re: How to kill orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
On 28 Dic, 18:47, Roy Smith r...@panix.com wrote: In article b133b978-fe63-4893-bb33-8c96bfb59...@v5g2000prm.googlegroups.com, Giampaolo Rodola' gne...@gmail.com wrote: Hi, I know that it's not possible to kill threads but I'm wondering if does exist some workaround for my problem. I

[issue4705] python3.0 -u: unbuffered stdout

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: pitrou's patch changes PyFile_FromFd() behaviour for a text file opened with buffering=0: /* As a convenience, when buffering == 0 on a text file, we open the underlying binary stream in unbuffered mode and wrap it with a text

[issue4759] bytearray.translate() should support None first argument

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Looks like there's a problem: bytearray().translate(None, None) Traceback (most recent call last): File stdin, line 1, in module TypeError: Type NoneType doesn't support the buffer API bytearray().translate(None, None) Erreur de segmentation

[issue4759] bytearray.translate() should support None first argument

2008-12-28 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: You're right (but the segfault isn't introduced by the patch). Fixed segfault in 3.0 and 2.6 in r67975 and r67977. Applied path in 3k and trunk in r67974 and r67976. -- assignee: pitrou - georg.brandl resolution: - accepted status: open

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2008-12-28 Thread Mart Sõmermaa
Mart Sõmermaa m...@mrts.pri.ee added the comment: A shameless copy of the Perl fix for the bug http://bugs.debian.org/286922 looks like the evident solution. Somebody has to examine the fix though, I'm afraid I'm not currently able to do it. ___ Python

[issue4731] suggest change to Failed to find the necessary bits to build these modules message

2008-12-28 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Done in r67978. -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4731 ___

[issue4705] python3.0 -u: unbuffered stdout

2008-12-28 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Why changing PyFile_FromFd() and not io.open() directly? I must admit I'm a bit lazy, and changing io.open() means changing a fundamental public API, as Guido said on python-dev, so more discussion and some parts of the

[issue4701] range objects becomes hashable after attribute access

2008-12-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: enumerate can be added to the list of builtin types which isn't initialised correctly, as can the callable+sentinel iterator return from the 2-argument version of iter() and the default sequence iterator returned by iter() when given a type with

[issue4701] range objects becomes hashable after attribute access

2008-12-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Copied from python-dev post: Perhaps the path of least resistance is to change PyObject_Hash to be yet another place where PyType_Ready will be called implicitly if it hasn't been called already? That approach would get us back to the Python

[issue4705] python3.0 -u: unbuffered stdout

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le dimanche 28 décembre 2008 à 12:19 +, STINNER Victor a écrit : STINNER Victor victor.stin...@haypocalc.com added the comment: Why changing PyFile_FromFd() and not io.open() directly? I must admit I'm a bit lazy, and changing

[issue4444] unittest - use contexts to assert exceptions

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I've committed an improved patch, with tests and doc, in r67979 and r67981. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The Perl patch is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=36;filename=etch_03_fix_file_path;att=1;bug=286922 It is a recursive implementation of rmtree. What it does is 1) get the inode of the path 2) unlink it altogether if not a

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Mmmh, the problem with Perl's approach is that it changes the current working directory (calls to chdir()), which is process-specific and not thread-specific. Currently, no function in shutil changes the current working directory, which is a nice

[issue4761] create Python wrappers for openat() and others

2008-12-28 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: Very recent POSIX versions have introduced a set of functions named openat(), unlinkat(), etc. (*) which allow to access files relatively to a directory pointed to by a file descriptor (rather than the process-wide current working directory).

[issue4705] python3.0 -u: unbuffered stdout

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It seems the name field of the TextIOWrapper object isn't set in create_stdio() (the char *name parameter isn't used). Otherwise, the patch looks good. ___ Python tracker rep...@bugs.python.org

[issue1034053] unittest.py patch: add skipped test functionality

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Pupeno's patch looks good to me. Additional candy would be a decorator to flag skipped tests (e.g. @skipped_test or @skipped_test(A message)), but we can do that later. -- stage: - patch review type: - feature request versions: +Python

[issue2153] unittest.py modernization

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Will take a look. -- versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2153 ___

[issue4034] traceback attribute error

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: One possibility would be to only allow deleting the tb_frame attribute (setting it to NULL), not setting it to an arbitrary object. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-12-28 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Applied the patch in r67982. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4060

[issue4728] Endianness and universal builds problems

2008-12-28 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I applied the patch for #4060 in r67982. I would still like to know what difference an Intel machine makes in the installers, though. -- resolution: - fixed status: open - closed ___ Python

[issue4750] tarfile keeps excessive dir structure in compressed files

2008-12-28 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: 7zip can decompress both, but it still creates dist/ directory when decompressing file that is made with Python. I've noticed this bug with extra path component is actual with tar + gzip under windows. If they are executed separately and

[issue2153] unittest.py modernization

2008-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in r67985, thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2153 ___

  1   2   >