Re: python segfault

2012-03-27 Thread Michael Poeltl
hi, * Dave Angel [2012-03-28 04:38]: > On 03/27/2012 06:27 PM, Michael Poeltl wrote: > >hi, > > > >can anybody tell why this 'little stupid *thing* of code' let's > >python-3.2.2, 2.6.X or python 2.7.2 segfault? > > > >>>def get_steps2(pos=0, steps=0): > >... if steps == 0: > >... po

Re: python segfault

2012-03-27 Thread Dave Angel
On 03/27/2012 06:27 PM, Michael Poeltl wrote: hi, can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, 2.6.X or python 2.7.2 segfault? def get_steps2(pos=0, steps=0): ... if steps == 0: ... pos = random.randint(-1,1) ... if pos == 0: ... retur

Generating a pkg config file with distutils

2012-03-27 Thread Tycho Andersen
Hi all, I'm distributing a package which for various legacy reasons needs to generate a pkgconfig file from a template (adding version numbers, prefixes, etc.) and install the file in the right place ($PREFIX/lib/pkgconfig/foo.pc in most cases). Currently, I have a rather nasty hack to implement

Re: RE: Advise of programming one of my first programs

2012-03-27 Thread Devin Jeanpierre
On Tue, Mar 27, 2012 at 5:59 PM, Evan Driscoll wrote: >> The use of eval is dangerous if you are not *completely* sure what is >> being passed in. Try using pickle instead: >> http://docs.python.org/release/2.5.2/lib/pickle-example.html > > > Um, at least by my understanding, the use of Pickle is

Re: Advise of programming one of my first programs

2012-03-27 Thread Tim Chase
On 03/27/12 16:53, Anatoli Hristov wrote: On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase wrote: On 03/27/12 10:32, Prasad, Ramit wrote: fileread = open('myfile.txt','r') tbook = eval(fileread.read()) fileread.close() The use of eval is dangerous if you are not *completely* sure what is being pas

Re: python segfault

2012-03-27 Thread Christian Heimes
Am 28.03.2012 00:27, schrieb Michael Poeltl: > hi, > > can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, > 2.6.X or python 2.7.2 segfault? The code segfaults because you have increased the recursion limit. The amount of recursions is limited by the stack size. A C pro

Re: python segfault

2012-03-27 Thread Chris Kaynor
On Tue, Mar 27, 2012 at 3:27 PM, Michael Poeltl wrote: > hi, > > can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, > 2.6.X or python 2.7.2 segfault? > >>> def get_steps2(pos=0, steps=0): > ...     if steps == 0: > ...         pos = random.randint(-1,1) > ...     if pos

RE: Advise of programming one of my first programs

2012-03-27 Thread Prasad, Ramit
> def load_book(): > load_book = open('c:/Python27/Toli/myfile.txt', 'r') > load_book = eval(load_book.read()) > return load_book > def write_book(tbook): > write_book = open('c:/Python27/Toli/myfile.txt', 'w') > write_book.write(str(tbook)) > > def details(choice): > s

python segfault

2012-03-27 Thread Michael Poeltl
hi, can anybody tell why this 'little stupid *thing* of code' let's python-3.2.2, 2.6.X or python 2.7.2 segfault? >> def get_steps2(pos=0, steps=0): ... if steps == 0: ... pos = random.randint(-1,1) ... if pos == 0: ... return steps ... steps += 2 ... pos += rando

Re: RE: Advise of programming one of my first programs

2012-03-27 Thread Evan Driscoll
On 01/-10/-28163 01:59 PM, Prasad, Ramit wrote: ### CODE # fileread = open('myfile.txt','r') tbook = eval(fileread.read()) fileread.close() The use of eval is dangerous if you are not *completely* sure what is being passed in. Try using pickle instead: http://docs.python.org/release

Re: Advise of programming one of my first programs

2012-03-27 Thread Anatoli Hristov
Thanks, but I`m still far from for dose details I thing:) Regards Anatoli On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase wrote: > On 03/27/12 10:32, Prasad, Ramit wrote: > >> fileread = open('myfile.txt','r') >>> tbook = eval(fileread.read()) >>> fileread.close() >>> >> >> The use of eval is danger

Re: Advise of programming one of my first programs

2012-03-27 Thread Anatoli Hristov
> > This was difficult, now I feel more confused it works, but I`m sure its > not the way you wanted :) > The use of eval is dangerous if you are not *completely* sure what is >> being passed in. Try using pickle instead: >> http://docs.python.org/release/2.5.2/lib/pickle-example.html > > I`m s

Re: Slow termination of process

2012-03-27 Thread Chris Angelico
On Wed, Mar 28, 2012 at 1:52 AM, Roland Hedberg wrote: > So, I went for the low-hanging fruit and defined my own TCPServer class > > class MyTCPServer(SocketServer.TCPServer): >    def __init__(self, server_address, RequestHandlerClass): >        self.allow_reuse_address = True >        SocketServ

Re: OAuth 2.0 implementation

2012-03-27 Thread Demian Brecht
On Tuesday, 27 March 2012 07:18:26 UTC-7, Roy Smith wrote: > In article > <7909491.0.1332826232743.JavaMail.geo-discussion-forums@pbim5>, > Demian Brecht wrote: > > > OAuth 2.0 is still in draft status (draft 25 is the current one I believe) > > and yes, unfortunately every single server avai

Re: Advise of programming one of my first programs

2012-03-27 Thread Tim Chase
On 03/27/12 10:32, Prasad, Ramit wrote: fileread = open('myfile.txt','r') tbook = eval(fileread.read()) fileread.close() The use of eval is dangerous if you are not *completely* sure what is being passed in. Try using pickle instead: http://docs.python.org/release/2.5.2/lib/pickle-example.html

RE: Advise of programming one of my first programs

2012-03-27 Thread Prasad, Ramit
It is considered polite to post your reply either after the quoted text or interspersed as I have done below. > By the way I dont know why your mail was in my junk I just saw it. Probably because I only reply back to the list and let the list forward to you. > And here is my last code I did for

Re: Advise of programming one of my first programs

2012-03-27 Thread Anatoli Hristov
Thank you Ramit for your advice`s. I`m reading a book ( Learning Python, Second Edition ) by Mark Lutz and David Ascher and now I just finished the Basic Function lesson :) I will keep in mind what you have advised me, but will implement it later when I have more experience with the book, because I

Re: Slow termination of process

2012-03-27 Thread Roland Hedberg
So, I went for the low-hanging fruit and defined my own TCPServer class class MyTCPServer(SocketServer.TCPServer): def __init__(self, server_address, RequestHandlerClass): self.allow_reuse_address = True SocketServer.TCPServer.__init__(self, server_address,

Re: OAuth 2.0 implementation

2012-03-27 Thread Roy Smith
In article <7909491.0.1332826232743.JavaMail.geo-discussion-forums@pbim5>, Demian Brecht wrote: > OAuth 2.0 is still in draft status (draft 25 is the current one I believe) > and yes, unfortunately every single server available at this point have > varying degrees of separation from the actua

Re: Slow termination of process

2012-03-27 Thread Chris Angelico
On Wed, Mar 28, 2012 at 12:03 AM, Roland Hedberg wrote: > When the main script is done it closes down the HTTP server by doing: > >    op.terminate() > > The problem I have is that if the main script is run again almost immediate > then the old HTTP server > process doesn't seem to have released

Slow termination of process

2012-03-27 Thread Roland Hedberg
Hi! I have an application/a script that is run from another application. The script is mostly working as a HTTP client but in some cases it also has to act as a HTTP server. Basically just for serving a few files. The files are dynamically created by the script when needed. To accomplish this I

Re: OAuth 2.0 implementation

2012-03-27 Thread Roland Hedberg
And then to complicate the picture you have OpenID Connect which is an attempt at bringing OpenID and OAuth2.0 together. By the way I have an implementation of OpenID Connect here: https://github.com/rohe/pyoidc -- Roland 27 mar 2012 kl. 11:59 skrev Stuart Bishop: > On Tue, Mar 27, 2012 at 10

Re: Tools for refactoring/obfuscation

2012-03-27 Thread Stefan Behnel
Javier, 07.03.2012 04:29: > I am looking for an automated tool for refactoring/obfuscation. Sadly, there really is one thing that these two have in common: they modify code while retaining its exact functionality. Apart from that, they are diametric opposites. Refactoring aims at making the code "

Re: Your Regex Brain

2012-03-27 Thread Peter J. Holzer
["Followup-To:" header set to comp.lang.perl.misc.] On 2012-03-27 00:02, s...@netherlands.com wrote: > This is more like a regex brain. > > ' > (?=\s) > (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) width \s*= > (?: (?> \s* ([\'"]) \s* (?.*?) \s* \g{-2} ) > | (?> (?!\s*[\'"]) \s*

Socket Error : Address still in use (Conveting from python 1.5.2 to 2.7.1)

2012-03-27 Thread Wong Wah Meng-R32813
Hello there, I am in the midst of converting my application from python 1.5.2 to python 2.7.1 on HP-UX 11 Itanium box. My application server will set a listening port, accepting request from multiple clients. The code just works fine in the old python environment. E.g. when I do a lsof | grep

Re: OAuth 2.0 implementation

2012-03-27 Thread Stuart Bishop
On Tue, Mar 27, 2012 at 10:11 AM, Ben Finney wrote: > Demian Brecht writes: > >> I'm getting close to an alpha release of an OAuth 2.0 implementation >> (https://github.com/demianbrecht/py-sanction). > > Thank you for doing this work. > > As someone who uses OpenID, what can I read about why OAut