473,480 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

py2exe and CD-ROM ISO Level 1

Hi,
[still looking for a solution]

we have written a Python EXE program, which should run via AUTORUN.INF
from a CD/DVD (Windows of course).

For this CD/DVD we us a imaging tool from Microsoft, which seam to
generate a pure ISO 9660 level 1 image.

This means:
- Only upper case letters A-Z and numbers 0-9
- 8.3 file names

For Python 2.2 and py2exe 0.4.1 this worked fine. Today, it does not.

So:
- Is there an option to generate a py2exe program with PYTHONCASE set?
- Or do I need a wrapper? (My own C program, setting the environment
and then starting the Python EXE program.)
- Is there a tricky way to start up with code like
"import OS as os"?
- May I use my own case insensitive importer?
- Or do I need to recompile Python?
Thanks in advance
Werner
Jul 18 '05 #1
4 3576
Werner Merkl <werner_DOT_merkl_@_fujitsu_DASH_siemens.com> writes:
Hi,
[still looking for a solution]

we have written a Python EXE program, which should run via AUTORUN.INF
from a CD/DVD (Windows of course).

For this CD/DVD we us a imaging tool from Microsoft, which seam to
generate a pure ISO 9660 level 1 image.

This means:
- Only upper case letters A-Z and numbers 0-9
- 8.3 file names

For Python 2.2 and py2exe 0.4.1 this worked fine. Today, it does not.

So:
- Is there an option to generate a py2exe program with PYTHONCASE set?
- Or do I need a wrapper? (My own C program, setting the environment
and then starting the Python EXE program.)
- Is there a tricky way to start up with code like
"import OS as os"?
- May I use my own case insensitive importer?
- Or do I need to recompile Python?


What errors exactly do you get?

Although I have posted before that this wouldn't work, currently I
believe that it *should* work.
I tried the 'simple' sample in the py2exe distro, which contains a
trvivial command line program, plus a simple wxPython program, wrote
them to an ISO level 1 CD, and it worked.

1. The python modules are imported from the zip file, as long as this
has an 8.3 name, all should be fine.

2. Extension modules are loaded with imp.load_dynamic (custom loaders
are created for them, in py2exe\build_exe.py, the create_loader method).
As far as I can see, imp.load_dynamic(module_name, file_name) should
work independent of the case or spelling of 'file_name'. If the
extensions you need have filenames with more than 8 characters, you
could probably subclass the build_exe command.

Thomas
Jul 18 '05 #2
Thomas Heller wrote:
Werner Merkl <werner_DOT_merkl_@_fujitsu_DASH_siemens.com> writes:

Hi,
[still looking for a solution]

we have written a Python EXE program, which should run via AUTORUN.INF
from a CD/DVD (Windows of course).

For this CD/DVD we us a imaging tool from Microsoft, which seam to
generate a pure ISO 9660 level 1 image.

This means:
- Only upper case letters A-Z and numbers 0-9
- 8.3 file names

For Python 2.2 and py2exe 0.4.1 this worked fine. Today, it does not.

So:
- Is there an option to generate a py2exe program with PYTHONCASE set?
- Or do I need a wrapper? (My own C program, setting the environment
and then starting the Python EXE program.)
- Is there a tricky way to start up with code like
"import OS as os"?
- May I use my own case insensitive importer?
- Or do I need to recompile Python?

What errors exactly do you get?

Although I have posted before that this wouldn't work, currently I
believe that it *should* work.
I tried the 'simple' sample in the py2exe distro, which contains a
trvivial command line program, plus a simple wxPython program, wrote
them to an ISO level 1 CD, and it worked.

1. The python modules are imported from the zip file, as long as this
has an 8.3 name, all should be fine.

2. Extension modules are loaded with imp.load_dynamic (custom loaders
are created for them, in py2exe\build_exe.py, the create_loader method).
As far as I can see, imp.load_dynamic(module_name, file_name) should
work independent of the case or spelling of 'file_name'. If the
extensions you need have filenames with more than 8 characters, you
could probably subclass the build_exe command.

Thomas


Hi,

I recompiled my application as a console program and got following error
message:

-----------------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>e:\AUTORUN.EXE
Traceback (most recent call last):
File "D:\PROGS\Python23\lib\site-packages\py2exe\boot_common.py",
line 69, in ?
import linecache
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
File "AutoRun.py", line 54, in ?
zipimport.ZipImportError: can't decompress data; zlib not available
-----------------------------------------------------------------------

so I removed "compressed": 1, from setup.py and it WORKS!!!
This seems to be a bug in py2exe ????

Thanks a lot
Werner

-----------------------------------------------------------------------
---------------------- part of setup.py ------------------------------
[...]
setup(
options = {"py2exe": {# create a compressed zip archive
"compressed": 1,
"optimize": 2,
"packages": ["encodings"],
"excludes": excludes}},
# The lib directory contains everything except the executables and
# the python dll.
# Can include a subdirectory name.
zipfile = "lib/shared.zip",
data_files = [('bin',glob.glob("bin/*")),
('.',['AUTORUN.INF','ReadMe.txt'])],

## windows = [AutoRun],
console = [AutoRun],
)
Jul 18 '05 #3
Werner Merkl <werner_DOT_merkl_@_fujitsu_DASH_siemens.com> writes:
Hi,

I recompiled my application as a console program and got following
error message:

-----------------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>e:\AUTORUN.EXE
Traceback (most recent call last):
File "D:\PROGS\Python23\lib\site-packages\py2exe\boot_common.py",
line 69, in ?
import linecache
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
File "AutoRun.py", line 54, in ?
zipimport.ZipImportError: can't decompress data; zlib not available
-----------------------------------------------------------------------

so I removed "compressed": 1, from setup.py and it WORKS!!!
Great!
This seems to be a bug in py2exe ????


The zlib module is the only one that is imported with the standard
mechanism, since it is imported when a zipfile is added to sys.path.
So, when it's filename has the wrong case the import will fail, and the
only solution would be to set PYTHONCASEOK=1 before. Unfortunately,
this cannot be done somewhere in your Pythoncode, because it's too late
then. So, if you insist on 'compressed': 1 (but why would you?) the
only solution that I see is to add
_putenv("PYTHONCASEOK=1");
to the source file start.c, somewhere in the init_with_instance
function, near line 135, and rebuild py2exe.

Thomas
Jul 18 '05 #4
Thomas Heller wrote:
Werner Merkl <werner_DOT_merkl_@_fujitsu_DASH_siemens.com> writes:

Hi,

I recompiled my application as a console program and got following
error message:

-----------------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>e:\AUTORUN.EXE
Traceback (most recent call last):
File "D:\PROGS\Python23\lib\site-packages\py2exe\boot_common.py",
line 69, in ?
import linecache
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
File "AutoRun.py", line 54, in ?
zipimport.ZipImportError: can't decompress data; zlib not available
-----------------------------------------------------------------------

so I removed "compressed": 1, from setup.py and it WORKS!!!

Great!

This seems to be a bug in py2exe ????

The zlib module is the only one that is imported with the standard
mechanism, since it is imported when a zipfile is added to sys.path.
So, when it's filename has the wrong case the import will fail, and the
only solution would be to set PYTHONCASEOK=1 before. Unfortunately,
this cannot be done somewhere in your Pythoncode, because it's too late
then. So, if you insist on 'compressed': 1 (but why would you?) the
only solution that I see is to add
_putenv("PYTHONCASEOK=1");
to the source file start.c, somewhere in the init_with_instance
function, near line 135, and rebuild py2exe.

Thomas

Thank you very much for you explanation. I think, I will not use
compressed in future (normally there is enough space on a DVD or
even on a CD ;-).
regards
Werner
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2965
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
2
3333
by: Stefan Behrens | last post by:
Hi, does anybody know how I can get py2exe to work with wxPython's wxCalendarCtrl? Currently, I have just a "standard" setup.py, and py2exe gives me a syntax error. Do I need to include any...
0
1693
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
8
4716
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No...
0
1975
by: Steven Bell | last post by:
I am trying to build an executable from a python script. Using python 2.3, SOAPpy 0.10.3, Py2exe 0.4.2. Build command: python setup.py py2exe -w --includes xml.sax.drivers2.drv_py I get the...
6
3931
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
0
2018
by: ex laguna | last post by:
Hi, I have ran into a problem with py2exe 0.5.0 and shelve in python 2.3.3. The script works fine standalone, but not with py2exe. Does anyone have a solution of workaround for this? Thanks...
5
1645
by: Tim Axtelle | last post by:
I am new to Python and am trying to create a standalone exe from a python script using py2exe 0.5.0 and Python 2.3 without success. I am able to generate the appropriate .exe file but it is not...
8
3038
by: PipedreamerGrey | last post by:
I've been banging my head against this problem for a week. It's time to ask for help, because I'm obviously not going to solve this by trial and error. I'm trying to create a standalone version...
7
4244
luke14free
by: luke14free | last post by:
Hello, I'm working on a project and I need to compile it to run it on win as an exe. I choose pyinstaller to build my exe but after several tries my result is always the same, from my console...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.