Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #144 (closed enhancement: fixed)

Opened 3 years ago

Last modified 9 months ago

pytz timezone object creation fails with pyinstaller

Reported by: seahawk1986@… Owned by: matysek
Priority: normal Milestone: PyInstaller 2.1
Component: Hooks Version: 2.0
Severity: normal Keywords: Import-Hook
Cc:

Description

Hello, I have problems packing the following code in to one *.exe file: test.py

...
import pytz
mytz = pytz.timezone('Europe/Berlin')
...

Package ist created using

C:\Python25\pyinstaller-1.3\makespec.py -F --icon=icon.ico test.py

C:\Python25\pyinstaller-1.3\Build.py test.spec

pytz is Version 2009u

Warntest.txt shows:

W: delayed  __import__ hack detected at line 0 - pytz (C:\Users\myuser\Documents\Test\pytz\__init__.pyc)

Traceback when program test.exe is run:

Traceback (most recent call last):
  File "<string>", line 32, in <module>
  File "C:\Users\myuser\Documents\Test\buildtest\out1.pyz/pytz", line 157, in timezone
pytz.UnknownTimeZoneError: 'Europe/Berlin'

Any idea how to prevent this error?

Attachments

Change History

comment:1 Changed 22 months ago by htgoebel

  • Keywords Import-Hook added; pytz timezone removed
  • Type changed from defect to enhancement
  • Severity changed from major to normal

This is simply, because pytz needs to have the zoneinfo files bundled.

Thee options: 1) adapt the .spec to include the zonefiles a data files 2) Either use a egg (which should be included as a whole) 3) implement an import hook.

comment:2 Changed 15 months ago by htgoebel

  • Owner changed from giovannibajo to htgoebel
  • Status changed from new to assigned
  • Component changed from PyInstaller to Hooks

comment:3 Changed 9 months ago by matysek

  • Owner changed from htgoebel to matysek
  • Status changed from assigned to new
  • Version changed from 1.3 to 2.0
  • Milestone set to PyInstaller 2.1

comment:4 Changed 9 months ago by matysek

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in latest dev branch.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.