very odd, random window dumps

Peter Kleiweg in.aqua.scribis at nl.invalid
Wed Sep 8 19:54:57 EDT 2004


Peter Kleiweg schreef:

>
> This is weird...
>
> Running small Python scripts, now and again a window dump is
> created, and saved as the module name without the extension.
> This happens on Linux. The dumped file is a PostScript file with
> the image of one Window that was active at the moment
> (completely unrelated to the Python application), and has a
> header comment that says it was created by ImageMagick. Magic,
> indeed. The file has the somewhat unusual access bits
> -rwxr--r--, but normal user and group.

I think I solved it. A script that starts with this:

import somemodule

Call it with sh instead of python, and the shell calls the
program 'import', which happens to be an existing program, part
of ImageMagick, and that program writes a screen dump to its
argument, in this case to file 'somemodule'.

My scripts start with this line:

#!/usr/bin/env python

So they should be run with python. However, I discovered that if
I make a small typo, and use this:

!/usr/bin/env python

Then the shell doesn't understand the first line, prints an error, and
continues processing the rest of the file as if it were a common shell
script.

That must be what happened.

-- 
Peter Kleiweg  L:NL,af,da,de,en,ia,nds,no,sv,(fr,it)  S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html




More information about the Python-list mailing list