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


Groups > comp.lang.python > #78181

Re: program to generate data helpful in finding duplicate large files

From random832@fastmail.us
References <CALDD_==AYbQNPu29jRoLFp8WPZaZ9mMs79334-m_z3dgdxZRJw@mail.gmail.com> <CALvWhxvvtyH0Us8+9eg+JBcooUvq1kiTVqmfU0rg1XTtcJGmVg@mail.gmail.com>
Subject Re: program to generate data helpful in finding duplicate large files
Date 2014-09-22 15:34 -0400
Newsgroups comp.lang.python
Message-ID <mailman.14233.1411414446.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 18, 2014, at 14:45, Chris Kaynor wrote:
> Additionally, you may want to specify binary mode by using
> open(file_path,
> 'rb') to ensure platform-independence ('r' uses Universal newlines, which
> means on Windows, Python will convert "\r\n" to "\n" while reading the
> file). Additionally, some platforms will treat binary files differently.

Does 'r' not use universal newlines on unix? If not, why not? The only
purpose seems to be to allow people to write bad programs and have them
work on unix. It makes even less sense in python 3 where opening a file
in text mode results in a TextIOWrapper with utf-8 encoding, and
therefore can't be used on arbitrary binary files.

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


Thread

Re: program to generate data helpful in finding duplicate large files random832@fastmail.us - 2014-09-22 15:34 -0400

csiph-web