very odd, random window dumps

P

Peter Kleiweg

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.
 
P

Peter Kleiweg

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.
 
J

Jeffrey Froman

Peter said:
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.

This is probably the result of accidentally typing "import somemodule" on
the Linux command line before invoking the python interpreter. "import" is
an ImageMagick command that takes a window capture.

i.e.:

$ import myprog
<hangs>
....

Jeffrey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top