D
D
Denis2015-03-16 12:04:46
linux
Denis, 2015-03-16 12:04:46

What causes a SyntaxError in a Django library?

Hello. When deploying a django project developed on Ubuntu on a server with Debian 7.8 (wheezy), I encountered a problem: one of the django libraries crashes with a SyntaxError error.
We are talking about django-autoslug. Both janga and the library itself were installed via pip. The only obvious differences on the servers are the python version. The development was on 3.4, on the server 3.2.
Specific error text:

python3 /usr/local/lib/python3.2/dist-packages/autoslug/utils.py
  File "/usr/local/lib/python3.2/dist-packages/autoslug/utils.py", line 172
    def _slugify(value, delim=u'-', encoding=''):
                                 ^
SyntaxError: invalid syntax

The utils.py files are identical on both systems (checked with diff).
It would be possible to just build python 3.4 from sources, but will this solve the problem, because there are no differences in syntax between 3.2 and 3.4?
The error is poorly googled, so I am writing the question without much hope.
Yours sincerely, UsCr.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
raiboon, 2015-03-16
@uscr

Yes, you should include a version compatibility check in your ide. There is no concept of unicode strings (u'') in 3.0-3.2, there are only simple strings, which is easy to google, and it is obvious from the error text. Returned only in 3.3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question