Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel throws a type error on imports python 3.3/3.4 on windows 7 #207

Closed
colost8rams opened this issue Sep 7, 2015 · 3 comments
Closed

Comments

@colost8rams
Copy link

I have just tried installing babel and I keep getting a type error when I try the first example on the homepage. I've tried under fresh installs of both python 3.3 and 3.4. here's the full traceback:

Python 3.3.5 (v3.3.5:62cf4e77f785, Mar  9 2014, 10:37:12) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from babel.dates import format_datetime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python33\lib\site-packages\babel\dates.py", line 28, in <module>
    from babel.util import UTC, LOCALTZ
  File "C:\Python33\lib\site-packages\babel\util.py", line 278, in <module>
    from babel import localtime
  File "C:\Python33\lib\site-packages\babel\localtime\__init__.py", line 21, in <module>
    from babel.localtime._win32 import _get_localzone
  File "C:\Python33\lib\site-packages\babel\localtime\_win32.py", line 18, in <module>
    tz_names = get_global('windows_zone_mapping')
  File "C:\Python33\lib\site-packages\babel\core.py", line 58, in get_global
    _global_data = pickle.load(fileobj)
TypeError: an integer is required (got type str)

the issue seems to be caused when babel tries unpicling the global data.

is this a known bug?

@sils
Copy link
Member

sils commented Sep 7, 2015

Hi @colost8rams, thanks for your report. We'll try to look at it as soon as possible, we still have problems keeping up with this repository though so it might take some time - sorry :/ Any help is appreciated.

@sils sils added the bug label Sep 7, 2015
@colost8rams
Copy link
Author

This seems to be a duplicate of issue #174

a quick workaround is to install the github branch of babel 2.0. so, I pip uninstall babel and then pip install git+https://github.com/mitsuhiko/babel.git@2.0 and ... so far so good. seems the global_data on the pypi distribution was pickled in python 2 whereas the one on the github branch was pickled with python 3?

@sils sils added duplicate and removed bug labels Sep 7, 2015
@sils
Copy link
Member

sils commented Sep 7, 2015

@colost8rams yes, thanks this seems to be a duplicate.

@sils sils closed this as completed Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants