Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Chris Angelico
On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > It doesn't even > You intrigue me, sir. Does it odd? What is the remainder of this aborted sentence? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

TestFixtures 2.0.0 Released!

2011-09-23 Thread Chris Withers
Hi All, I'm happy to announce a new release major release of TestFixtures. This release is 99% backwards compatible, but a lot has changed under the hood and there's some major new functionality, so thought it was time for a bump. The big changes are: - compare now uses a registry of compare

Re: Python 2.5 zlib trouble

2011-09-23 Thread Steven D'Aprano
Jesramz wrote: > Hello, > > I am trying to deploy an app on google app engine using bottle, a > micro-framework, similar to flask. [...] > ImportError: No module named zlib What happens if you explicitly launch Python2.5 and then try to import zlib? -- Steven -- http://mail.python.org/mai

extending class

2011-09-23 Thread Andrea Crotti
I wanted to add a couple of parameters to a class from a given library (paste-script), but without changing the original code. So I thought, I create a wrapper class which adds what I need, and then dispatch all the calls to the super class. My following attempt gives, however, a recursion erro

Re: Python Mixins

2011-09-23 Thread Duncan Booth
Matt wrote: > I'm curious about what people's opinions are about using mixins in > Python. I really like, for example, the way that class based views > were implemented in Django 1.3 using mixins. It makes everything > extremely customizable and reusable. I think this is a very good > practice to

Re: extending class

2011-09-23 Thread Peter Otten
Andrea Crotti wrote: > I wanted to add a couple of parameters to a class from a given library > (paste-script), but without changing the original code. > So I thought, I create a wrapper class which adds what I need, and then > dispatch all the calls to the super class. > > My following attempt g

Re: extending class

2011-09-23 Thread Andrea Crotti
On 09/23/2011 10:31 AM, Peter Otten wrote: Inside __getattribute__() you ask for self.first_var which triggers another __getattribute__() call that once again trys to determine the first_var attribute before it returns... Try using __getattr__() instead which is only triggered for non-existent

Re: PyEval_EvalCodeEx return value

2011-09-23 Thread Mateusz Loskot
On 23/09/11 00:47, Mark Hammond wrote: On 20/09/2011 8:34 PM, Mateusz Loskot wrote: I'm trying to dig out details about what exactly is the return value the of PyEval_EvalCodeEx function in Python 3.x The documentation is sparse, unfortunately. Perhaps I'm looking at wrong function. My aim is

cProfile and name spaces.

2011-09-23 Thread Gelonida N
Hi I have following piece of code in file f1.py # f1.py starts here ### def f(): pass def main(): import profile profile.run('f()') if __name__ == '__main__': main() # -- end of f1.py executing f1.py works as expected. Now I have a file f2.py # f2.py star

Develop inter-dependent eggs

2011-09-23 Thread Andrea Crotti
Develop inter-dependent eggs: On a Linux machine I have many eggs to develop, for example - egg1 - egg2 ... Now the eggs depend from each other, so running "python setup.py develop" in order, doesn't work, because if the dependency required is not already installed then easy_install tries to

Need help with file encoding-decoding

2011-09-23 Thread Yaşar Arabacı
Hi, I'am trying to write a mass html downloader, and it processes files after it downloaded them. I have problems with encodings, and decodings. Sometimes I get UnicodeDecodeErrors, or I get half-pages in after processing part. Or more generally, some things don't feel right. Can you check my appr

Re: [TIP] TestFixtures 2.0.0 Released!

2011-09-23 Thread Chris Withers
On 23/09/2011 08:46, Chris Withers wrote: I'm happy to announce a new release major release of TestFixtures. This release is 99% backwards compatible, but a lot has changed under the hood and there's some major new functionality, so thought it was time for a bump. Of course, a 2.0.0 release wou

Re: python install on locked down windows box?

2011-09-23 Thread python
Hi Matt, Enjoyed your list options :) I'm a consultant and have to do what your subject line asks at most clients I work at. Here's the technique I recommend: Install Python for the ***current user*** on another workstation with the appropriate priviledges. Then xcopy this Python folder to a US

Re: Need help with file encoding-decoding

2011-09-23 Thread Philip Semanchuk
On Sep 23, 2011, at 7:44 AM, Yaşar Arabacı wrote: > Hi, > > I'am trying to write a mass html downloader, and it processes files after it > downloaded them. I have problems with encodings, and decodings. Sometimes I > get UnicodeDecodeErrors, or > I get half-pages in after processing part. Or mor

Re: extending class

2011-09-23 Thread Jean-Michel Pichavant
Andrea Crotti wrote: On 09/23/2011 10:31 AM, Peter Otten wrote: Inside __getattribute__() you ask for self.first_var which triggers another __getattribute__() call that once again trys to determine the first_var attribute before it returns... Try using __getattr__() instead which is only tri

Re: Odd behavior with imp.reload and logging

2011-09-23 Thread Andrew Berg
On 2011.09.22 03:12 AM, Chris Angelico wrote: > In theory, this should mean that you load it fresh every time - I > think. If not, manually deleting entries from sys.modules might help, > either with or without the list of modules. I've played around with sys.modules, and it seems there are issues

Re: extending class

2011-09-23 Thread Andrea Crotti
Jean-Michel Pichavant writes: > Did you consider subclassing your Var class ? This is how you extend a > class behavior in OOP. > > class PSIVar(var): >def __init__(self, name, desc, other=None, fun=None): >var.__init__(self, name, desc) >if other is not None: >sel

Could anybody tell me how to make a version of Nokia Symbian os

2011-09-23 Thread gmszone
I like the Python in my mobile phone.But a don't have the enough money to buy a new phone.And my mobile type is Nokia N72 which is a part of S60v2.And I could program in some boring classes.But the version of my mobile's python is to old.So I hope I coule learn how to compile it for my N72.My note

Re: extending class

2011-09-23 Thread Steven D'Aprano
Andrea Crotti wrote: > I wanted to add a couple of parameters to a class from a given library > (paste-script), but without changing the original code. > So I thought, I create a wrapper class which adds what I need, and then > dispatch all the calls to the super class. You don't need to use a wr

pyWin build 216

2011-09-23 Thread python
I have used pyWin for several years now with out issue. I recently installed build 216 for python 2.7 on windows XP pro. The program crashes every time I exit a wxPython program and has crashed a few other times. I does not seem that pyWin has been updated since February of this year. Is the

Re: pyWin build 216

2011-09-23 Thread Brian Curtin
On Fri, Sep 23, 2011 at 09:25, python wrote: > I have used pyWin for several years now with out issue.   I recently > installed build 216 for python 2.7 on windows XP pro.   The program > crashes every time I exit a wxPython program and has crashed a few > other times.  I does not seem that pyWin

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 12:08 am, Chris Angelico wrote: > On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > > It doesn't even > > You intrigue me, sir. Does it odd? > > What is the remainder of this aborted sentence? > > ChrisA That is odd, I also find it odd that it deadlocks the entire python system, even t

Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz
Python 2.5.6 (r256:88840, Sep 22 2011, 13:45:58) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import zlib Traceback (most recent call last): File "", line 1, in ImportError: No module named zlib >>> But if I run Python2.7 I get: Python 2.7.1+

Re: python install on locked down windows box?

2011-09-23 Thread Chris Withers
Hi Steve On 22/09/2011 13:58, Steven D'Aprano wrote: (7) If all else fails, as an absolute last resort, simply run the Windows installer as a regular, unprivileged user, after selecting the option for a Non-Admin Install under Advanced Options first. Thanks for this, will send on to my friend

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 7:58 am, Atherun wrote: > On Sep 23, 12:08 am, Chris Angelico wrote: > > > On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > > > It doesn't even > > > You intrigue me, sir. Does it odd? > > > What is the remainder of this aborted sentence? > > > ChrisA > > That is odd, I also find it o

Re: ANN: Urwid 1.0.0 - Console UI Library

2011-09-23 Thread Michael P. Soulier
On 22/09/11 Ian Ward said: > Announcing Urwid 1.0.0 > -- Congrats. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Nobody
On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: >> kernel32.dll!WaitForSingleObject+0x12 >> python26.dll!_Py_svnversion+0xcf8 > > I haven't a clue how this happens. _Py_svnversion just returns a string: In retrospect, I think that's a red herring. 0xcf8 seems like too large an offset for such

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 10:47 am, Nobody wrote: > On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: > >> kernel32.dll!WaitForSingleObject+0x12 > >> python26.dll!_Py_svnversion+0xcf8 > > > I haven't a clue how this happens. _Py_svnversion just returns a string: > > In retrospect, I think that's a red herring. 0

Re: comments on runpy module

2011-09-23 Thread Alexey Luchko
Example script.py: """ def f(arg): return g(arg) def g(arg): return arg """ Reading the Lib/runpy.py I've found, that the temporary module created inside the run_path() calls, is destroyed right after the script.py code executed in the resulting namespace. I've got an idea. It would

comments on runpy module

2011-09-23 Thread Alexey Luchko
Hi! I've just had fun with the runpy module in Python 2.7. I'm writing to share it :) What I've tried is to "load" a python script using runpy.run_path(), take a function from the resulting namespace and call it with arbitrary arguments. All the functions in the namespace seem to be ok. r

strange behavior from recursive generator

2011-09-23 Thread Dr. Phillip M. Feldman
A few weeks ago, I wrote a class that creates an iterator for solving the general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert converted my code to a generator, which made the code cleaner, and I subsequently simplified it somewhat further. My problem is the following: All of

Re: strange behavior from recursive generator

2011-09-23 Thread Arnaud Delobelle
On 23 September 2011 21:09, Dr. Phillip M. Feldman wrote: > > A few weeks ago, I wrote a class that creates an iterator for solving the > general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert > converted my code to a generator, which made the code cleaner, and I > subsequently s

Re: Python 2.5 zlib trouble

2011-09-23 Thread Christian Heimes
Am 23.09.2011 17:41, schrieb Jesramz: > Python 2.5.6 (r256:88840, Sep 22 2011, 13:45:58) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import zlib > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named zli

Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz
Thank You Christian Im running on Ubuntu Natty and I am not running a self-compiled install, its a regular release. In order to do this: $ make distclean $ export LDFLAGS="-L/usr/lib/$(dpkg-architecture - qDEB_HOST_MULTIARCH)" $ ./configure $ make $ make install $ unset LDFLAGS

Re: strange behavior from recursive generator

2011-09-23 Thread Phillip Feldman
I don't know how many times I stared at that code without seeing the error. Thanks so much! Phillip On Fri, Sep 23, 2011 at 1:26 PM, Arnaud Delobelle wrote: > On 23 September 2011 21:09, Dr. Phillip M. Feldman > wrote: > > > > A few weeks ago, I wrote a class that creates an iterator for solv

Re: Context manager with class methods

2011-09-23 Thread Gregory Ewing
Terry Reedy wrote: it is normal to look for special methods on the class (and superclasses) > of an object rather than starting with the object itself. I suspect there was a deliberate change to correct an anomaly, though this might have been done as part of some other change. It's a necess

Re: Python 2.5 zlib trouble

2011-09-23 Thread Alec Taylor
No idea, as I said before, if you ask for it they might put in the alpha. On Sat, Sep 24, 2011 at 8:30 AM, Jesse Ramirez wrote: > > Thanks Alec, might you know when the 2.7 support might come? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 zlib trouble

2011-09-23 Thread Jesramz
Thank You Christian Im running on Ubuntu Natty and I am not running a self-compiled install, its a regular release. In order to do this: $ make distclean $ export LDFLAGS="-L/usr/lib/$(dpkg-architecture - qDEB_HOST_MULTIARCH)" $ ./configure $ make $ make install $ unset LDFLAGS I

can't load an script from html...

2011-09-23 Thread Ricardo
Hi everyone I'm trying to use the cgi library to create a python script and loading it from a web page. I have already done the necessary imports, and the default commands to receive data from "html" are written too. The final version is something like this: #!/usr/bin/python import subprocess

Re: can't load an script from html...

2011-09-23 Thread MRAB
On 24/09/2011 02:42, Ricardo wrote: Hi everyone I'm trying to use the cgi library to create a python script and loading it from a web page. I have already done the necessary imports, and the default commands to receive data from "html" are written too. The final version is something like this:

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Matt Joiner
how do you get the call stacks like this? On Sat, Sep 24, 2011 at 3:59 AM, Atherun wrote: > On Sep 23, 10:47 am, Nobody wrote: >> On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: >> >> kernel32.dll!WaitForSingleObject+0x12 >> >> python26.dll!_Py_svnversion+0xcf8 >> >> > I haven't a clue how thi

Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
The topic says it all: Why is shutil named shutil? What does it stand for? This is just a mild curiosity of mine. The shutil module for reference: http://docs.python.org/library/shutil.html#module-shutil -- http://mail.python.org/mailman/listinfo/python-list

Re: pyWin build 216

2011-09-23 Thread Mark Hammond
On 24/09/2011 12:25 AM, python wrote: I have used pyWin for several years now with out issue. I recently installed build 216 for python 2.7 on windows XP pro. The program crashes every time I exit a wxPython program and has crashed a few other times. There are a number of issues using Pytho

Re: Why is the shutil module called shutil?

2011-09-23 Thread Chris Rebert
On Fri, Sep 23, 2011 at 8:36 PM, Fletcher Johnson wrote: > The topic says it all: > Why is shutil named shutil? What does it stand for? This is just a > mild curiosity of mine. "sh" is short for "shell", in line with Unix convention, where the default shell is located at /bin/sh. http://en.wikipe

Re: Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
On Sep 23, 11:58 pm, Chris Rebert wrote: > On Fri, Sep 23, 2011 at 8:36 PM, Fletcher Johnson > wrote: > > The topic says it all: > > Why is shutil named shutil? What does it stand for? This is just a > > mild curiosity of mine. > > "sh" is short for "shell", in line with Unix convention, where t

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 7:03 pm, Matt Joiner wrote: > how do you get the call stacks like this? > > > > > > > > On Sat, Sep 24, 2011 at 3:59 AM, Atherun wrote: > > On Sep 23, 10:47 am, Nobody wrote: > >> On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: > >> >> kernel32.dll!WaitForSingleObject+0x12 > >> >> p

Re: can't load an script from html...

2011-09-23 Thread Peter Otten
Ricardo wrote: > Hi everyone > I'm trying to use the cgi library to create a python script and loading it > from a web page. I have already done the necessary imports, and the > default commands to receive data from "html" are written too. The final > version is something like this: > > #!/usr/bi