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

python 3.4 support #13

Closed
pajooh opened this issue May 30, 2015 · 6 comments
Closed

python 3.4 support #13

pajooh opened this issue May 30, 2015 · 6 comments

Comments

@pajooh
Copy link

pajooh commented May 30, 2015

trying to pip install https://github.com/slashmili/django-jalali/archive/master.zip, i get:

...
Installing collected packages: django-jalali
  Running setup.py install for django-jalali

      File "/home/user/.venvs/py3/lib/python3.4/site-packages/django_jalali/db/models.py", line 80
        except ValueError, e:
                         ^
    SyntaxError: invalid syntax

      File "/home/user/.venvs/py3/lib/python3.4/site-packages/django_jalali/tests/__init__.py", line 64
        jdt_model.date_time = datetime.datetime(1390,01,02)
                                                      ^
    SyntaxError: invalid token

Successfully installed django-jalali
Cleaning up...
slashmili pushed a commit that referenced this issue May 30, 2015
It should fixed the issue #13
slashmili pushed a commit that referenced this issue May 30, 2015
It should fixed the issue #13
@pajooh pajooh changed the title tests fails on python 3.4 python 3.4 support May 30, 2015
@slashmili
Copy link
Owner

It should be fixed. try again

@pajooh
Copy link
Author

pajooh commented May 30, 2015

Nope, the error is here yet
anyway, thank you for your fast consideration!!!

@slashmili
Copy link
Owner

@slashmili slashmili reopened this May 30, 2015
@pajooh
Copy link
Author

pajooh commented May 30, 2015

i used pip install -e git://github.com/slashmili/django-jalali.git@master#egg=django_jalali to get the latest master push, the installation completed, but trying to activate it in my ``INSTALLED_APP`, i get:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/user/.venvs/py3/lib/python3.4/site-packages/django/utils/module_loading.py", line 74, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/home/user/.venvs/py3/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/.venvs/py3/src/django-jalali/django_jalali/admin/__init__.py", line 1, in <module>
    from django_jalali.db.models import jDateField, jDateTimeField
  File "/home/user/.venvs/py3/src/django-jalali/django_jalali/db/models.py", line 80
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

as you can see, the except ValueError, e syntax is not valid in python 3 at all
how about simply running 2to3 tool to change all this kind of incompatible code?

@slashmili
Copy link
Owner

Please install it from python-3.4-support branch and let me know if it works, then I'll merge it to master

pip install https://github.com/slashmili/django-jalali/archive/python-3.4-support.zip

@slashmili
Copy link
Owner

It's done, you can get the new version (2.0) and it would work in python 3.4.

We also have test for this project which runs on multiple python/django versions

https://travis-ci.org/slashmili/django-jalali

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants