Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
I still don't get it. shm_unlink() works the same way unlink() does. The resource itself doesn't cease to exist until all open file handles are closed. From the shm_unlink() man page on Linux: The operation of shm_unlink() is analogous to unlink(2): it removes a shared memory o

Re: Is Python a commercial proposition ?

2012-08-01 Thread David
On 01/08/2012, Stefan Behnel wrote: > > Would you mind taking this slightly off-topic discussion off the list? I always strive to stay on-topic. In fact immediately this thread went off topic, 4 messages back, I did try to go off list, but got this result from the OP: Delivery to the following r

Re: [Pythonmac-SIG] Py2app error

2012-08-01 Thread Mark Livingstone
Hi Guys, OK, taking Chris' advice, I installed on a Snow Leopard machine: cheyenne:dist marklivingstone$ ls ~/Downloads/ About Downloads.lpdf numpy-1.6.2-py2.7-python.org-macosx10.3.dmg wxMac-2.8.12.tar matplotlib-1.1.0-py2.7-python.org-macosx10.3.d

Re: Pass data to a subprocess

2012-08-01 Thread Grant Edwards
On 2012-08-01, Laszlo Nagy wrote: > things get more tricky, because I can't use queues and pipes to communicate with a running process that it's noit my child, correct? >>> Yes, I think that is correct. >> I don't understand why detaching a child process on Linux/Unix would >> make

Re: Pass data to a subprocess

2012-08-01 Thread Roy Smith
On Aug 1, 2012, at 9:25 AM, andrea crotti wrote: > [beanstalk] does look nice and I would like to have something like that.. > But since I have to convince my boss of another external dependency I > think it might be worth > to try out zeromq instead, which can also do similar things and looks > m

Re: why the different output in Eclipse and Python Shell?

2012-08-01 Thread Dave Angel
On 08/01/2012 11:26 AM, Prasad, Ramit wrote: >>> my code in Eclipse: >>> >>> dict.fromkeys(['China','America']) >>> print "dict is",dict >>> >>> output: dict is >>> >>> my code in Python Shell: >>> >>> dict.fromkeys(['China','America']) >>> >>> output:{'America': None, 'China': None} >>> >>> Outpu

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
Make sure that file objects are not shared between threads. If that is possible. It will probably solve the problem (if that is related to threads). Well I just have to create a lock I guess right? That is also a solution. You need to call file.read() inside an acquired lock. with lock:

Re: CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : > >> Thanks a lot, that makes a lot of sense.. I haven't given this detail >> before because I didn't write this code, and I forgot that there were >> threads involved completely, I'm just trying to help to fix this bug. >> >> Your explanation makes a lot of sense, but it's

Re: EXTERNAL: Re: missing python-config and building python on Windows

2012-08-01 Thread Terry Reedy
On 8/1/2012 7:47 AM, Damon Register wrote: On 7/31/2012 11:49 PM, Mark Hammond wrote: On 1/08/2012 10:48 AM, Damon Register wrote: 1. though I have looked in a few readme files, I don't see instructions for installing what I have just built using MSVC. Where can I find the instructions

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
Thanks a lot, that makes a lot of sense.. I haven't given this detail before because I didn't write this code, and I forgot that there were threads involved completely, I'm just trying to help to fix this bug. Your explanation makes a lot of sense, but it's still surprising that even just read

Re: NameError vs AttributeError

2012-08-01 Thread Terry Reedy
On 8/1/2012 11:53 AM, Ethan Furman wrote: Terry Reedy wrote: On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: one wants to catch both errors, one can easily enough. To continue the example above, popping an empty list and empty set produce IndexEr

Re: [pyxl] xlrd 0.8.0 released!

2012-08-01 Thread Matthew Smith
Thank you guys so much! I am so excited to finally have xlsx so my users don't have extra steps! On Wed, Aug 1, 2012 at 11:01 AM, Chris Withers wrote: > Hi All, > > I'm pleased to announce the release of xlrd 0.8.0: > > http://pypi.python.org/pypi/**xlrd/0.8.0

Re: CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
2012/8/1 Steven D'Aprano : > On Wed, 01 Aug 2012 14:01:45 +0100, andrea crotti wrote: > >> Full traceback: >> >> Exception in thread Thread-8: > > "DANGER DANGER DANGER WILL ROBINSON!!!" > > Why didn't you say that there were threads involved? That puts a > completely different perspective on the p

Re: NameError vs AttributeError

2012-08-01 Thread Ethan Furman
Terry Reedy wrote: On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: Another example: KeyError and IndexError are both subscript errors, but there is no SubscriptError superclass, even though both work thru the same mechanism -- __getitem__. The reas

Re: CRC-checksum failed in gzip

2012-08-01 Thread Steven D'Aprano
On Wed, 01 Aug 2012 14:01:45 +0100, andrea crotti wrote: > Full traceback: > > Exception in thread Thread-8: "DANGER DANGER DANGER WILL ROBINSON!!!" Why didn't you say that there were threads involved? That puts a completely different perspective on the problem. I *was* going to write back an

RE: EXTERNAL: Re: missing python-config and building python on Windows

2012-08-01 Thread Prasad, Ramit
> On 7/31/2012 11:49 PM, Mark Hammond wrote: > > On 1/08/2012 10:48 AM, Damon Register wrote: > >> 1. though I have looked in a few readme files, I don't see instructions for > >> installing what I have just built using MSVC. Where can I find the > >> instructions for installing after buil

RE: why the different output in Eclipse and Python Shell?

2012-08-01 Thread Prasad, Ramit
> > my code in Eclipse: > > > > dict.fromkeys(['China','America']) > > print "dict is",dict > > > > output: dict is > > > > my code in Python Shell: > > > > dict.fromkeys(['China','America']) > > > > output:{'America': None, 'China': None} > > > > Output in Python Shell is what i wanna,but why not

Re: Pass data to a subprocess

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : > > So detaching the child process will not make IPC stop working. But exiting > from the original parent process will. (And why else would you detach the > child?) > > -- > http://mail.python.org/mailman/listinfo/python-list Well it makes perfect sense if it stops working

xlrd 0.8.0 released!

2012-08-01 Thread Chris Withers
Hi All, I'm pleased to announce the release of xlrd 0.8.0: http://pypi.python.org/pypi/xlrd/0.8.0 This release finally lands the support for both .xls and .xlsx files. Many thanks to John Machin for all his work on making this happen. Opening of .xlsx files is seamless, just use xlrd as you did

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
Yes, I think that is correct. I don't understand why detaching a child process on Linux/Unix would make IPC stop working. Can somebody explain? It is implemented with shared memory. I think (although I'm not 100% sure) that shared memory is created *and freed up* (shm_unlink() system call)

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
things get more tricky, because I can't use queues and pipes to communicate with a running process that it's noit my child, correct? Yes, I think that is correct. I don't understand why detaching a child process on Linux/Unix would make IPC stop working. Can somebody explain? It is implemen

Re: Pass data to a subprocess

2012-08-01 Thread Grant Edwards
On 2012-08-01, Laszlo Nagy wrote: >> >> As I wrote "I found many nice things (Pipe, Manager and so on), but >> actually even >> this seems to work:" yes I did read the documentation. > Sorry, I did not want be offensive. >> >> I was just surprised that it worked better than I expected even >> with

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
Thanks a lotl, someone that writes on the file while reading might be an explanation, the problem is that everyone claims that they are only reading the file. If that is true, then make that file system read only. Soon it will turn out who is writing them. ;-) Apparently this file is generat

Re: CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : >>there seems to be no clear pattern and just randmoly fails. The file >> is also just open for read from this program, >>so in theory no way that it can be corrupted. > > Yes, there is. Gzip stores CRC for compressed *blocks*. So if the file is > not flushed to the d

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
- The file is written with the linux gzip program. - no I can't reproduce the error with the same exact file that did failed, that's what is really puzzling, How do you make sure that no process is reading the file before it is fully flushed to disk? Possible way of testing for this kind of e

Re: Pass data to a subprocess

2012-08-01 Thread andrea crotti
2012/8/1 Roy Smith : > In article , > Laszlo Nagy wrote: > >> Yes, I think that is correct. Instead of detaching a child process, you >> can create independent processes and use other frameworks for IPC. For >> example, Pyro. It is not as effective as multiprocessing.Queue, but in >> return, you

Re: CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
Full traceback: Exception in thread Thread-8: Traceback (most recent call last): File "/user/sim/python/lib/python2.7/threading.py", line 530, in __bootstrap_inner self.run() File "/user/sim/tests/llif/AutoTester/src/AutoTester2.py", line 67, in run self.processJobData(jobData, logger)

Re: EXTERNAL: Re: missing python-config and building python on Windows

2012-08-01 Thread Damon Register
On 7/31/2012 11:49 PM, Mark Hammond wrote: On 1/08/2012 10:48 AM, Damon Register wrote: 1. though I have looked in a few readme files, I don't see instructions for installing what I have just built using MSVC. Where can I find the instructions for installing after building with MSVC?

Re: Is Python a commercial proposition ?

2012-08-01 Thread Stefan Behnel
David, 01.08.2012 13:59: > On 01/08/2012, lipska the kat wrote: >> On 01/08/12 09:06, Mark Lawrence wrote: >>> >>> You complete ignoramus, if it gets poured in advance that's no good to >>> anybody as it'll go flat. Has to stay in the pump until you're ready to >>> drink it from the glass. Don't yo

Re: Is Python a commercial proposition ?

2012-08-01 Thread David
On 01/08/2012, lipska the kat wrote: > On 01/08/12 09:06, Mark Lawrence wrote: >> >> You complete ignoramus, if it gets poured in advance that's no good to >> anybody as it'll go flat. Has to stay in the pump until you're ready to >> drink it from the glass. Don't you know anything about the impor

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
On 2012-08-01 12:59, Roy Smith wrote: In article , Laszlo Nagy wrote: Yes, I think that is correct. Instead of detaching a child process, you can create independent processes and use other frameworks for IPC. For example, Pyro. It is not as effective as multiprocessing.Queue, but in return,

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
very simple right? But sometimes we get a checksum error. Do you have a traceback showing the actual error? - CRC is at the end of the file and is computed against the whole file (last 8 bytes) - after the CRC there is the \ marker for the EOF - readline() doesn't trigger the check

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
The most effective IPC is usually through shared memory. But there is no OS independent standard Python module that can communicate over shared memory. It's true that shared memory is faster than serializing objects over a TCP connection. On the other hand, it's hard to imagine anything writte

Re: Pass data to a subprocess

2012-08-01 Thread Roy Smith
In article , Laszlo Nagy wrote: > Yes, I think that is correct. Instead of detaching a child process, you > can create independent processes and use other frameworks for IPC. For > example, Pyro. It is not as effective as multiprocessing.Queue, but in > return, you will have the option to ru

Re: CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : > On 2012-08-01 12:39, andrea crotti wrote: >> >> We're having some really obscure problems with gzip. >> There is a program running with python2.7 on a 2.6.18-128.el5xen (red >> hat I think) kernel. >> >> Now this program does the following: >> if filename == 'out2.txt': >>

Re: CRC-checksum failed in gzip

2012-08-01 Thread Laszlo Nagy
On 2012-08-01 12:39, andrea crotti wrote: We're having some really obscure problems with gzip. There is a program running with python2.7 on a 2.6.18-128.el5xen (red hat I think) kernel. Now this program does the following: if filename == 'out2.txt': out2 = open('out2.txt') elif filename ==

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
Yes I know we don't care about Windows for this particular project.. I think mixing multiprocessing and fork should not harm, but probably is unnecessary since I'm already in another process after the fork so I can just make it run what I want. Otherwise is there a way to do same thing only us

CRC-checksum failed in gzip

2012-08-01 Thread andrea crotti
We're having some really obscure problems with gzip. There is a program running with python2.7 on a 2.6.18-128.el5xen (red hat I think) kernel. Now this program does the following: if filename == 'out2.txt': out2 = open('out2.txt') elif filename == 'out2.txt.gz' out2 = open('out2.txt.gz'

Re: Pass data to a subprocess

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : > On thing is sure: os.fork() doesn't work under Microsoft Windows. Under > Unix, I'm not sure if os.fork() can be mixed with > multiprocessing.Process.start(). I could not find official documentation on > that. This must be tested on your actual platform. And don't forget t

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
Thanks, there is another thing which is able to interact with running processes in theory: https://github.com/lmacken/pyrasite I don't know though if it's a good idea to use a similar approach for production code, as far as I understood it uses gdb.. In theory though I could be able to set up

Re: why the different output in Eclipse and Python Shell?

2012-08-01 Thread Dave Angel
On 08/01/2012 12:45 AM, levi nie wrote: > my code in Eclipse: > > dict.fromkeys(['China','America']) > print "dict is",dict > > output: dict is > > my code in Python Shell: > > dict.fromkeys(['China','America']) > > output:{'America': None, 'China': None} > > Output in Python Shell is what i wanna

Re: Pass data to a subprocess

2012-08-01 Thread andrea crotti
2012/8/1 Laszlo Nagy : >> I was just surprised that it worked better than I expected even >> without Pipes and Queues, but now I understand why.. >> >> Anyway now I would like to be able to detach subprocesses to avoid the >> nasty code reloading that I was talking about in another thread, but >> t

Re: my email

2012-08-01 Thread BJ Swope
I would also recommend changing your birthday as well ;) -- "The end of democracy and the defeat of the American Revolution will occur when government falls into the hands of lending institutions and moneyed incorporations." -- Thomas Jefferson The whole world is a comedy to those that think, a

Re: Is Python a commercial proposition ?

2012-08-01 Thread lipska the kat
On 01/08/12 09:06, Mark Lawrence wrote: On 01/08/2012 00:31, David wrote: On 01/08/2012, lipska the kat wrote: On 31/07/12 14:52, David wrote: [1] as in beer [2] for research purposes There's one (as in 1 above) in the pump for you. Great, more beer => better research => \o/\o/\o/ But, "

Re: Pass data to a subprocess

2012-08-01 Thread Laszlo Nagy
As I wrote "I found many nice things (Pipe, Manager and so on), but actually even this seems to work:" yes I did read the documentation. Sorry, I did not want be offensive. I was just surprised that it worked better than I expected even without Pipes and Queues, but now I understand why.. Any

Re: Is Python a commercial proposition ?

2012-08-01 Thread Mark Lawrence
On 01/08/2012 00:31, David wrote: On 01/08/2012, lipska the kat wrote: On 31/07/12 14:52, David wrote: [1] as in beer [2] for research purposes There's one (as in 1 above) in the pump for you. Great, more beer => better research => \o/\o/\o/ But, "pump" sounds a bit extreme .. I usually s