V
V
Vyacheslav Grachunov2016-05-12 13:19:47
Python
Vyacheslav Grachunov, 2016-05-12 13:19:47

Python 3, UnicodeEncodeError, how to fix?

Debian Wheezy
Python 3.2
Traceback (most recent call last): File "betfair.py", line 10, in print('\u041f\u0410\u0420\u0421\u0418\u0422\u0421\u042f ' + baseurl + parturl) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128)
The line is:
print('PARS ' + baseurl + parturl)
Why is that and how to fix it? Works on ubuntu 14.04

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
abcd0x00, 2016-05-13
@abcd0x00

Most likely, there is a second python. Run the script with python3.

V
Vyacheslav Grachunov, 2016-05-14
@Qwentor

I run through Python 3, I installed it myself

V
Vyacheslav, 2016-05-14
@Firik67

# -*- coding: utf-8 -*-
At the beginning of the file?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question