← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 701407] Re: no timezones in form

 

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

** Bug watch added: code.google.com/p/googletransitdatafeed/issues #121
   http://code.google.com/p/googletransitdatafeed/issues/detail?id=121

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/701407

Title:
  no timezones in form

Status in OpenObject Server:
  Confirmed

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





References