[6.0] missing pytz zone_info in windows packaging

Bug #701407 reported by David DRAPEAU
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D

Bug Description

No timezone listed on form view 'user'.
I saw in the file with eclipse-pydev and when I stay the cursor on function name (file addons/base/res/res_ser.py, ligne 93), a tooltip display the message:
def _tz_get found at: module not in the pythonpath

Related branches

Revision history for this message
David DRAPEAU (ddrapeau) wrote :

Sorry, I didn't precised config:
Win 7, OpenERP6.0.0RC2 All In One

Revision history for this message
David DRAPEAU (ddrapeau) wrote :

works on Linux with openerp installed by the sources (with Debian6:Squeeze)

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello David,

Would you please provide the proper steps for reproduce the bug.
And also provide the precise form view in which you face this problem.

Thanks.

Changed in openobject-client:
status: New → Incomplete
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

The bug is confirmed it's in user preferences field 'context_tz'. on win_xp and may be other windows paltform.
It's due to the pytz library that is packaged in the installer.

assigning to framework team. as the timezone values are sent from framework.

Thanks,

affects: openobject-client → openobject-server
Changed in openobject-server:
status: Incomplete → Confirmed
Amit Parik (amit-parik)
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
Revision history for this message
GEM (nimp3) wrote :

Hi,
the problem occurs since the code to add manually directory pytz\zoneinfo\* in library.zip in setup.py has been removed in rc2 (see the setup.py of the v5), this is the case not only for the server but also for client gtk (this code has been added in v5 because there already was this problem in v5)

for the server this code has been removed in setup.py :

if has_py2exe:
    # Sometime between pytz-2008a and pytz-2008i common_timezones started to
    # include only names of zones with a corresponding data file in zoneinfo.
    # pytz installs the zoneinfo directory tree in the same directory
    # as the pytz/__init__.py file. These data files are loaded using
    # pkg_resources.resource_stream. py2exe does not copy this to library.zip so
    # resource_stream can't find the files and common_timezones is empty when
    # read in the py2exe executable.
    # This manually copies zoneinfo into the zip. See also
    # http://code.google.com/p/googletransitdatafeed/issues/detail?id=121
    import pytz
    import zipfile
    # Make sure the layout of pytz hasn't changed
    assert (pytz.__file__.endswith('__init__.pyc') or
            pytz.__file__.endswith('__init__.py')), pytz.__file__
    zoneinfo_dir = os.path.join(os.path.dirname(pytz.__file__), 'zoneinfo')
    # '..\\Lib\\pytz\\__init__.py' -> '..\\Lib'
    disk_basedir = os.path.dirname(os.path.dirname(pytz.__file__))
    zipfile_path = os.path.join(complementary_arguments['options']['py2exe']['dist_dir'], 'library.zip')
    z = zipfile.ZipFile(zipfile_path, 'a')

    for absdir, directories, filenames in os.walk(zoneinfo_dir):
        assert absdir.startswith(disk_basedir), (absdir, disk_basedir)
        zip_dir = absdir[len(disk_basedir):]
        for f in filenames:
            z.write(os.path.join(absdir, f), os.path.join(zip_dir, f))

    z.close()

bye

summary: - no timezones in form
+ [6.0] missing pytz zone_info in windows packaging
Changed in openobject-server:
importance: Undecided → Medium
milestone: none → 6.0.2
Changed in openobject-server:
status: Confirmed → Fix Released
Revision history for this message
GEM (nimp3) wrote :

Hi Sumeet,
where is the bug fix in the list ?
Does the correction has been done for server and client gtk ?
Thanks.
Bye

Amit Parik (amit-parik)
Changed in openobject-server:
status: Fix Released → In Progress
status: In Progress → Confirmed
Revision history for this message
Vo Minh Thu (thu) wrote :

The problem is solved in the trunk at revision 701407. It will also be done in the 6.0 branche later. A Windows installer with the change will be done soon too.

GEM, thanks for pointing out the existing solution in 5.0.

Revision history for this message
Vo Minh Thu (thu) wrote :

The fix is available in trunk since revision 3378 (and not 701407 as written in the previous comment), in 6.0 since revision 3384, and in the Windows installer of the 6.0.2 release.

Changed in openobject-server:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.