473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3571
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.