Opened 7 years ago

Closed 7 years ago

#8805 closed defect (fixed)

compling with python 2.4 fails: at: class NumberFormat():

Reported by: ruedi.silvestri@… Owned by: ben_12
Priority: high Component: ExportImportXlsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12


trying to compile your code by "python bdist_egg" fails with below messages:

running bdist_egg
running egg_info
creating ImportExportXLS.egg-info
writing ImportExportXLS.egg-info\PKG-INFO
writing top-level names to ImportExportXLS.egg-info\top_level.txt
writing dependency_links to ImportExportXLS.egg-info\dependency_links.txt
writing entry points to ImportExportXLS.egg-info\entry_points.txt
writing manifest file 'ImportExportXLS.egg-info\SOURCES.txt'
reading manifest file 'ImportExportXLS.egg-info\SOURCES.txt'
writing manifest file 'ImportExportXLS.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\importexportxls
copying importexportxls\ -> build\lib\importexportxls
copying importexportxls\ -> build\lib\importexportxls
copying importexportxls\ -> build\lib\importexportxls
creating build\lib\importexportxls\templates
copying importexportxls\templates\importexport_done.html -> build\lib\importexportxls\templates
copying importexportxls\templates\importexport_preview.html -> build\lib\importexportxls\templates
copying importexportxls\templates\importexport_webadminui.html -> build\lib\importexportxls\templates
creating build\bdist.win32
creating build\bdist.win32\egg
creating build\bdist.win32\egg\importexportxls
copying build\lib\importexportxls\ -> build\bdist.win32\egg\importexportxls
copying build\lib\importexportxls\ -> build\bdist.win32\egg\importexportxls
creating build\bdist.win32\egg\importexportxls\templates
copying build\lib\importexportxls\templates\importexport_done.html -> build\bdist.win32\egg\importexportxls\templates
copying build\lib\importexportxls\templates\importexport_preview.html -> build\bdist.win32\egg\importexportxls\templates
copying build\lib\importexportxls\templates\importexport_webadminui.html -> build\bdist.win32\egg\importexportxls\templates
copying build\lib\importexportxls\ -> build\bdist.win32\egg\importexportxls
byte-compiling build\bdist.win32\egg\importexportxls\ to admin_ui.pyc
byte-compiling build\bdist.win32\egg\importexportxls\ to formats.pyc
  File "build\bdist.win32\egg\importexportxls\", line 52
    class NumberFormat():
SyntaxError: invalid syntax
byte-compiling build\bdist.win32\egg\importexportxls\ to __init__.pyc
creating build\bdist.win32\egg\EGG-INFO
copying ImportExportXLS.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying ImportExportXLS.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying ImportExportXLS.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying ImportExportXLS.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
copying ImportExportXLS.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\ImportExportXLS-0.1-py2.4.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)

Attachments (0)

Change History (7)

comment:1 Changed 7 years ago by ben_12

Status: newassigned

I don't have time now for test it, but I think that python 2.4 does not accept class déclaration with "()" empty.

I have committed this correction, I'll test it later or you could test it for me?

comment:2 Changed 7 years ago by ruedi.silvestri@…

sure, I tested it and compilation issue is solved. Loading the module results now in the following exception:

Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\", line 68, in _load_eggs
  File "c:\python24\lib\site-packages\setuptools-0.6c11-py2.4.egg\", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build\bdist.win32\egg\importexportxls\", line 1, in ?
  File "build\bdist.win32\egg\importexportxls\", line 33, in ?
ImportError: No module named io

xlwt 0.7.2 and xlrd 0.7.1 are installed properly as well.

comment:3 Changed 7 years ago by ben_12

I use io.ByteIO, but the module IO is available only from python 2.6 .

I'll test later with StringIO or cStringIO which must work too but available in python 2.4.

comment:4 Changed 7 years ago by ben_12

(In [10210]) refs #8805 : compiling with python 2.4 fails

Change io.ByteIO unavailable for python 2.4 or 2.5, by cStrinIO.StringIO.

comment:5 Changed 7 years ago by ruedi.silvestri@…

loading of plugin now works nicely and admin page shows. Now I face that the pulldowns for the custom fieldnames show 4 lines but novalues.

Further when I try to export my data I get the below exception:

    Datei "build/bdist.win32/egg/trac/web/", Zeile 517, in _dispatch_request
    Datei "build/bdist.win32/egg/trac/web/", Zeile 238, in dispatch
    Datei "build/bdist.win32/egg/trac/admin/", Zeile 116, in process_request
    Datei "build/bdist.win32/egg/importexportxls/", Zeile 119, in render_admin_panel
    Datei "build/bdist.win32/egg/importexportxls/", Zeile 241, in _send_export
    Datei "build/bdist.win32/egg/importexportxls/", Zeile 267, in _process_export
    Datei "C:/Python24/Lib/site-packages/xlwt/", Zeile 319, in add_sheet

comment:6 Changed 7 years ago by ben_12

I have add gestion for invalid XLS sheet name. By default it contains the project name, but it may be incompatible with sheet name constraints. [10217]

comment:7 Changed 7 years ago by ruedi.silvestri@…

Resolution: fixed
Status: assignedclosed

This works for me now. Thanks very much. :-)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain ben_12.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.