Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Python 3 is killing Python Date: Wed, 16 Jul 2014 19:20:14 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: <871ttl46o1.fsf@elektro.pacujo.net> References: <53C4A454.9010600@gmail.com> <87zjga4j4v.fsf@elektro.pacujo.net> <53c57bae$0$9505$c3e8da3$5496439d@news.astraweb.com> <87iomy4ciy.fsf@elektro.pacujo.net> <53c5f6dc$0$9505$c3e8da3$5496439d@news.astraweb.com> <87egxl4zq8.fsf@elektro.pacujo.net> <53c62e7f$0$29897$c3e8da3$5496439d@news.astraweb.com> <871ttlfune.fsf@elektro.pacujo.net> <53c66ba8$0$9505$c3e8da3$5496439d@news.astraweb.com> <87sim1e9dt.fsf@elektro.pacujo.net> <87oawpe5be.fsf@elektro.pacujo.net> <8761ix4859.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="26746"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18n3FZFqq3Wb9DUplp2wdhU" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:3EalFnn+owJIHS2RRbA1JET+nWo= sha1:t1lkF/3RTRfI42k/pqoG/VUTna0= Xref: csiph.com comp.lang.python:74567 Chris Angelico : > The only thing that might be an issue is that you can't use open(fn) > to read your files, but you have to explicitly state the encoding. > That would be an understandable problem, especially for someone who > develops on a single platform and forgets that the default differs. As > long as you always explicitly say encoding="utf-8", and document that > you do so, any problems are someone else's. Yes. I don't like open() guessing the enconding: The default encoding is platform dependent (whatever locale.getpreferredencoding() returns) Also, I don't like sys.std* guessing the encoding: Under other platforms, the locale encoding is used (see locale.getpreferredencoding()). In each case, it would have been better to default to bytes just like subprocess does. Marko