Re: Unable to run print('Réussi') on windows and on linux
marc.vanhoomissen at gmail.com
marc.vanhoomissen at gmail.com
Thu Aug 14 10:01:41 EDT 2014
Le jeudi 14 août 2014 15:22:52 UTC+2, Vincent Vande Vyvre a écrit :
> Le 14/08/2014 14:35, marc.vanhoomissen at gmail.com a �crit :
>
> > Hello,
>
> >
>
> > This very simple program runs well on windows 7
>
> >
>
> > # -*- utf8 -*-
>
> > print('R�ussi')
>
> >
>
> > But, when I start the vrey same file on Linux (ubuntu 14), I got:
>
> >
>
> > Traceback (most recent call last):
>
> > File "/partages/bureau/PB/Dev/Python3/test.py", line 2, in <module>
>
> > print('R\xe9ussi')
>
> > UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128)
>
> >
>
> > What should i do to let the same program run on both OS, without changes?
>
> >
>
> > Thank you for your answer
>
> >
>
> > Marc Vanhoomissen
>
> No problem on Ubuntu
>
>
>
> Python 3.2.3 (default, Feb 27 2014, 21:33:50)
>
> [GCC 4.6.3] on linux2
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> print("R�ussi")
>
> R�ussi
>
>
>
> Are you really using Python 3 ?
>
>
>
> $ python3 test.py
Actually, when I try using a terminal, it works:
$ python3 test.py
Réussi
But when I issue the same command using webmin (v. 1.700 - shell command), I got:
> python3 test.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
print('R\xe9ussi')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128)
So, I guess it is merely a problem of webmin.
More information about the Python-list
mailing list