Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'value,': 0.04; 'output': 0.05; 'subject:Python': 0.06; '*not*': 0.07; 'binary': 0.07; 'subject:file': 0.07; 'bytes,': 0.09; 'bytes.': 0.09; 'strings.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '(both': 0.16; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imo.': 0.16; 'implies': 0.16; 'it;': 0.16; 'iteration': 0.16; 'newlines': 0.16; 'separated': 0.16; 'subject: \n ': 0.16; 'subject:log': 0.16; 'terminator': 0.16; 'weird.': 0.16; 'weird': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'file,': 0.19; '(the': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'interpret': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; "d'aprano": 0.31; 'default,': 0.31; 'end,': 0.31; 'names.': 0.31; 'steven': 0.31; 'file': 0.32; 'another': 0.32; 'quite': 0.32; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'consist': 0.36; 'version,': 0.38; 'rather': 0.38; 'either': 0.39; 'read': 0.60; 'most': 0.60; 'matter': 0.61; 'reach': 0.63; 'series': 0.66; 'mar': 0.68; 'line,': 0.68; 'records.': 0.68; 'wish': 0.70; 'records': 0.73; 'obvious': 0.74; '(is': 0.84; '512': 0.84; 'to:none': 0.92; 'imagine': 0.93 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=zySjAHhfyP+zJPfb+t14D5NUnN+bPGLg7U53PUk5coU=; b=Due3fgkRJadH4aUtzT7/s1/qbQClwDj7RnpeUWwHDFbw0KSY9l/D4h/7NodKV3Cs03 Ib+fxd18Yia6vunL1TDMVU8H6yf4kie5XVz02ka9m2JCSGJsIa4y0ndNlhCMtLgL1Xrx cZ7rXmdTNXy3sGB0JKTWABWvdmbfICwJcxuDIf4JaPW+TBpTH9WQEf3yR5A3jEWoHxPd bUxqpM+iGGM4rP4Bq1gGbYYvU+8pOQQog0B2KyeMSyI9m+FCHhnfTGu7N3h1DKKHjRNb c2qrvrt3vgbIfxrRMTBnYP88XLd8fodfMd5Wu+BgAM0G43DNvHqmVywyrLeNi6ngGsiC 1P8g== MIME-Version: 1.0 X-Received: by 10.66.11.66 with SMTP id o2mr37645167pab.142.1395500960390; Sat, 22 Mar 2014 08:09:20 -0700 (PDT) In-Reply-To: <532da347$0$29994$c3e8da3$5496439d@news.astraweb.com> References: <827c7585-6c2a-4329-861f-0fdaa629b050@googlegroups.com> <532da347$0$29994$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 23 Mar 2014 02:09:20 +1100 Subject: Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395500969 news.xs4all.nl 2871 [2001:888:2000:d::a6]:58365 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68780 On Sun, Mar 23, 2014 at 1:50 AM, Steven D'Aprano wrote: > Line endings are terminators: they end the line. Whether you consider the > terminator part of the line or not is a matter of opinion (is the cover > of a book part of the book?) but consider this: > > If you say that the end of lines are *not* part of the line, then > that implies that some parts of the file are not inside any line > at all. And that would be just weird. Not so weird IMO. A file is not a concatenation of lines; it is a stream of bytes. Now, if you ask Python to read you 512 bytes from a binary file, and then ask for another 512 bytes, and so on until you reach the end, then it would indeed be VERY weird if there were parts of the file that weren't in the returned (byte) strings. But if you ask for a line, and then another line, and another line, then it's quite reasonable to interpret U+000A as "line separation" rather than "line termination", and not return it. (Both interpretations make sense. I just wish the most obvious form of iteration gave the cleaner/tidier version, or at very least that there be some really obvious way to ask for lines-without-endings.) Imagine the output of GNU find as a series of records. You can ask for those to be separated by newlines (the default, or -print), or by NULs (with the -print0 command). In either case, the records do not *contain* that value, they're separated by it; the records consist of file names. ChrisA