Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66147

Re: Wait... WHAT?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'encoding': 0.05; 'explicitly': 0.05; 'defaults': 0.07; 'linux,': 0.07; 'utf-8': 0.07; 'variables': 0.07; 'parameter': 0.09; 'cc:addr:python-list': 0.11; 'windows': 0.15; 'at,': 0.16; 'conveyed': 0.16; 'encoding.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'non-ascii': 0.16; 'notably': 0.16; 'omitting': 0.16; 'varies': 0.16; '(you': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'written': 0.21; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'specify': 0.24; 'environment': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'idea': 0.28; 'point': 0.28; 'rest': 0.29; 'chris': 0.29; 'tim': 0.29; 'message- id:@mail.gmail.com': 0.30; '13,': 0.31; 'chase': 0.31; 'file': 0.32; 'probably': 0.32; 'linux': 0.33; '(most': 0.33; "i'd": 0.34; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'doing': 0.36; 'shows': 0.36; 'subject:?': 0.36; 'should': 0.36; 'pm,': 0.38; 'read': 0.60; 'break': 0.61; "you're": 0.61; 'back': 0.62; "you'll": 0.62; 'such': 0.63; 'default': 0.69; 'whereas': 0.91; 'to:none': 0.92; 'yourself,': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=d6Lk8W7EX8fvTN4el9P1YeHqLiYgjOr3GOVdZQXOFOI=; b=r7m3yqjPnoZuAneYZEJcfpBuVlAAQJWTewmWOtr0rC293eMYkVUraoTXModlbiSA70 VfMGml4WcyTFzZuyrRFGFT19/9h1vZDaLSyFxO8SlQsNwK+1deYdzNWcpyAZd3Ml7LjI +ii+aGYhqMfGT1Mu/2hTgJLUfe4JPyludlEiGhHck8RZRRUKPJUgzT9coMcvH2E5DSth Is+0BXus2XNNxC+Yc8d1CThkCC14V4i/J4Hnf5oouBF7oWPRCVQPQG+fQ4lI2jSdVW03 2XJ7hIJAqQgpok30W2KfJCS/8wFLeKxBHmEqsRJENaUWfJWAcAZgCoXVVic4W8YWC8NH 7juw==
MIME-Version 1.0
X-Received by 10.68.201.10 with SMTP id jw10mr55686626pbc.25.1392263227268; Wed, 12 Feb 2014 19:47:07 -0800 (PST)
In-Reply-To <20140212212953.458b810a@bigbox.christie.dr>
References <6c76ef4e-8c7c-4199-b30d-c4d55c1061c8@googlegroups.com> <f45edd72-f8c2-4a20-a1f8-47a1814dfaba@googlegroups.com> <CALwzidnFDxRPmJRXjL2idtqYoccGKaqpACbWGTAyFQDz6juWsQ@mail.gmail.com> <20140212161427.0a9843d5@bigbox.christie.dr> <ldh0hj$nlj$1@ger.gmane.org> <20140212184432.1df9b491@bigbox.christie.dr> <ldh5cr$bdk$1@ger.gmane.org> <20140212212953.458b810a@bigbox.christie.dr>
Date Thu, 13 Feb 2014 14:47:07 +1100
Subject Re: Wait... WHAT?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6821.1392263231.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392263231 news.xs4all.nl 2840 [2001:888:2000:d::a6]:36944
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66147

Show key headers only | View raw


On Thu, Feb 13, 2014 at 2:29 PM, Tim Chase
<python.list@tim.thechases.com> wrote:
> My original point (though
> perhaps not conveyed as well as I'd intended) was that only bytes get
> written to the disk, and that some encoding must take place.  It can
> be done implicitly using some defaults which may break (as demoed),
> whereas one would be better off doing it explicitly such as Chris
> shows

And since the default encoding varies based on matters outside your
script (most notably platform - I tried this on Windows and Linux, and
got a default of UTF-8 on Linux and CP-1252 on Windows; but
environment variables and such can interfere too), I would say that
omitting the encoding= parameter should be done ONLY when you actually
have no idea what the encoding is, only that it's "probably something
from the rest of the system". And, well, if that's what you're looking
at, you definitely can't trust to reading or writing non-ASCII (you
can probably trust ASCII). When you create a file that you'll read
back yourself, specify an encoding.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Wait... WHAT? eneskristo@gmail.com - 2014-02-12 11:43 -0800
  Re: Wait... WHAT? Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-12 13:13 -0700
  Re: Wait... WHAT? eneskristo@gmail.com - 2014-02-12 12:21 -0800
    Re: Wait... WHAT? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 20:38 +0000
    Re: Wait... WHAT? Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-12 14:35 -0700
    Re: Wait... WHAT? Michael Torrie <torriem@gmail.com> - 2014-02-12 14:39 -0700
    Re: Wait... WHAT? Tim Chase <python.list@tim.thechases.com> - 2014-02-12 16:14 -0600
    Re: Wait... WHAT? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 23:36 +0000
    Re: Wait... WHAT? Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-12 17:01 -0700
    Re: Wait... WHAT? Tim Chase <python.list@tim.thechases.com> - 2014-02-12 18:44 -0600
    Re: Wait... WHAT? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-13 00:59 +0000
    Re: Wait... WHAT? Chris Angelico <rosuav@gmail.com> - 2014-02-13 12:10 +1100
    Re: Wait... WHAT? Tim Chase <python.list@tim.thechases.com> - 2014-02-12 21:29 -0600
    Re: Wait... WHAT? Chris Angelico <rosuav@gmail.com> - 2014-02-13 14:47 +1100
      Re: Wait... WHAT? eneskristo@gmail.com - 2014-02-13 09:46 -0800
        Re: Wait... WHAT? MRAB <python@mrabarnett.plus.com> - 2014-02-13 18:25 +0000
        Re: Wait... WHAT? Michael Torrie <torriem@gmail.com> - 2014-02-13 15:22 -0700
  Re: Wait... WHAT? eneskristo@gmail.com - 2014-02-12 12:43 -0800
    Re: Wait... WHAT? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 20:56 +0000
      Re: Wait... WHAT? eneskristo@gmail.com - 2014-02-12 12:59 -0800
        Re: Wait... WHAT? Chris Angelico <rosuav@gmail.com> - 2014-02-13 08:17 +1100
        Re: Wait... WHAT? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 21:23 +0000
    Re: Wait... WHAT? Grant Edwards <invalid@invalid.invalid> - 2014-02-12 23:09 +0000

csiph-web