Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76305
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-08-14 07:01 -0700 |
| References | <4dd67a80-b466-4866-ab67-d9a94c0b7ddf@googlegroups.com> <mailman.12996.1408023268.18130.python-list@python.org> |
| Message-ID | <41563121-149d-401c-94ed-9c5c74e55ba3@googlegroups.com> (permalink) |
| Subject | Re: Unable to run print('Réussi') on windows and on linux |
| From | marc.vanhoomissen@gmail.com |
Le jeudi 14 août 2014 15:22:52 UTC+2, Vincent Vande Vyvre a écrit :
> Le 14/08/2014 14:35, marc.vanhoomissen@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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 05:35 -0700
Re: Unable to run print('Réussi') on windows and on linux YBM <ybmess@nooos.fr.invalid> - 2014-08-14 15:31 +0200
Re: Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 07:04 -0700
Re: Unable to run print('Réussi') on windows and on linux Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-14 15:38 +0100
Re: Unable to run print('Réussi') on windows and on linux YBM <ybmess@nooos.fr.invalid> - 2014-08-14 16:47 +0200
Re: Unable to run print('Réussi') on windows and on linux Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-15 01:21 +1000
Re: Unable to run print('Réussi') on windows and on linux Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-14 10:12 -0600
Re: Unable to run print('Réussi') on windows and on linux wxjmfauth@gmail.com - 2014-08-15 01:25 -0700
Re: Unable to run print('Réussi') on windows and on linux Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-08-14 16:46 +0200
Re: Unable to run print('Réussi') on windows and on linux Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-08-14 15:22 +0200
Re: Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 07:01 -0700
Re: Unable to run print('Réussi') on windows and on linux Peter Otten <__peter__@web.de> - 2014-08-14 18:00 +0200
Re: Unable to run print('Réussi') on windows and on linux Anssi Saari <as@sci.fi> - 2014-08-14 17:36 +0300
Re: Unable to run print('Réussi') on windows and on linux wxjmfauth@gmail.com - 2014-08-15 01:23 -0700
csiph-web