Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.05; 'encoding': 0.05; '-*-': 0.07; 'correct.': 0.07; 'suggestions,': 0.07; 'utf-8': 0.07; 'coding:': 0.09; 'default.': 0.09; 'encoding:': 0.09; 'python': 0.11; 'declaration': 0.16; 'file;': 0.16; 'subject:run': 0.16; 'subject:windows': 0.16; 'utf8': 0.16; 'fix': 0.17; 'wrote:': 0.18; '(not': 0.18; 'thu,': 0.19; 'later': 0.20; '>>>': 0.22; 'aug': 0.22; 'rules': 0.22; 'source': 0.25; 'script': 0.25; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'regular': 0.32; 'text': 0.33; 'are:': 0.33; '(2)': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; '14,': 0.36; 'thanks': 0.36; 'should': 0.36; '(3)': 0.38; 'configured': 0.38; 'to:addr:python- list': 0.38; 'that,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'expression': 0.60; 'first': 0.61; 'email addr:gmail.com': 0.63; 'improvement.': 0.68; 'default': 0.69; 'subjectcharset:utf-8': 0.72; 'apart': 0.72; 'further,': 0.74; 'caracter': 0.84; 'fail.': 0.84; 'many,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=5Kz5RLFq98ZKe2d0CKSs12wN9eyeSYWDD8c6sprjd48=; b=X8Z45y8j5CL035CkAR0HH47nOOdmzQ+q3MFVA7TwFfffu/P2g/XxO2jBAO/37PEeVF Ngqc3CVr0EdTJL42qsZIF6eTPGewybo7IWPNmDdAVL5Hqha3Ak+MJlsPDdUwOqsUuUyj 62kbxz/HoMYfWFUSYH7O9mWWw9ukjPRRqmlJN1gpgbCPtuzbQnnc+nLT3UNBkfS9anQr aJmFsNJlu56jyq5jEEBAqjz8qNCVW1FQZNoUwIpoN+VfWQluvbdiWmk3TkQPTJQlsmiw Nhs2/xNCNFeaYvZOUHJN92kQn7iO81lvZen+PIUDv3WwQzBVJKWMVfBpgsIGbrYa6clV 0fjg== X-Received: by 10.70.140.36 with SMTP id rd4mr11355718pdb.61.1408032782603; Thu, 14 Aug 2014 09:13:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <53ecd406$0$29971$c3e8da3$5496439d@news.astraweb.com> References: <4dd67a80-b466-4866-ab67-d9a94c0b7ddf@googlegroups.com> <53ecba3e$0$1989$426a74cc@news.free.fr> <53eccc08$0$2932$426a34cc@news.free.fr> <53ecd406$0$29971$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 14 Aug 2014 10:12:22 -0600 Subject: =?UTF-8?Q?Re=3A_Unable_to_run_print=28=27R=C3=A9ussi=27=29_on_windows_and_on?= =?UTF-8?Q?_linux?= To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408032785 news.xs4all.nl 2912 [2001:888:2000:d::a6]:47017 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76319 On Thu, Aug 14, 2014 at 9:21 AM, Steven D'Aprano wrote: > YBM wrote: > >> Le 14/08/2014 16:04, marc.vanhoomissen@gmail.com a =C3=A9crit : >>> Hello YBM, >>> I tried your suggestions, without improvement. >>> Further, see my answer to Vincent Vande Vyre >>> Thanks anyway. >> >> This is indeed very surprising. Are you sure that you >> have *exactly* this line at the first or second (not >> later !) line of your script : >> >> # -*- encoding: utf-8 -*- >> >> if a single caracter differs, it would fail. > > That's not correct. The encoding declaration is very flexible. Any of the= se > will be accepted: > > # This file uses the encoding: utf_8 > # coding=3DUTF-8 > # -*- coding: utf8 -*- > # vim: set fileencoding=3Dutf-8 : > # Uses encoding:utf8 > # I want my encoding=3DUtF_8 okay! > #### textencoding=3D UTf-8 blah blah blah > > and many, many other varieties. The rules are: > > (1) It must be a comment; > > (2) It must be in the first or second line of the file; > > (3) It must match the regular expression r"coding[:=3D]\s*([-\w.]+)" > > > However, just because you declare the file to be UTF-8, doesn't mean it > *actually is* UTF-8. If your text editor is configured to use (say) > Latin-1, a UTF-8 encoding declaration will just give you garbage. > > * Fix your system to use UTF-8 by default. > > * Fix your editor to use UTF-8. > > * Add a UTF-8 encoding declaration. > > And then things should work. And apart from all of that, if the OP is really using Python 3 then UTF-8 is the default source encoding anyway.