Re: [Python-Dev] Unicode decode exception
Did you try opening it as a binary file? open(filename, 'rb'): — Tagada tsouin tsouin On Sun, Nov 30, 2014 at 5:06 PM, balaji marisetti wrote: > Hi, > When I try to iterate through the lines of a > file("openssl-1.0.1j/crypto/bn/asm/x86_64-gcc.c"), I get a > UnicodeDecodeError (in python 3.4.0 on Ubuntu 14.04). But there is no > such error with python 2.7.6. What could be the problem? > In [39]: with open("openssl-1.0.1j/crypto/bn/asm/x86_64-gcc.c") as f: > for line in f: > print (line) > --- > UnicodeDecodeErrorTraceback (most recent call last) > in () > 1 with open("../openssl-1.0.1j/crypto/bn/asm/x86_64-gcc.c") as f: > > 2 for line in f: > 3 print (line) > 4 > /usr/lib/python3.4/codecs.py in decode(self, input, final) > 311 # decode input (taking the buffer into account) > 312 data = self.buffer + input > --> 313 (result, consumed) = self._buffer_decode(data, > self.errors, final) > 314 # keep undecoded input until the next call > 315 self.buffer = data[consumed:] > -- > :-)balaji > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/brunocauet%40gmail.com___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Python 2.x and 3.x use survey, 2014 edition
Hi all, Last year a survey was conducted on python 2 and 3 usage. Here is the 2014 edition, slightly updated (from 9 to 11 questions). It should not take you more than 1 minute to fill. I would be pleased if you took that time. Here's the url: http://goo.gl/forms/tDTcm8UzB3 I'll publish the results around the end of the year. Last year results: https://wiki.python.org/moin/2.x-vs-3.x-survey Thank you Bruno ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition
Remarks heard & form updated. Nathaniel, I'm not sure about that: even if the code is 2- and 3-compatible you'll pick one runtime. 2 others questions now mention writing polyglot code. By the way I published the survey on HN, /r/programming & /r/python: https://news.ycombinator.com/item?id=8730156 http://redd.it/2ovlwm http://redd.it/2ovls4 Feel free to publish it anywhere else, to get as many answers as possible. Bruno 2014-12-10 18:24 GMT+01:00 Nathaniel Smith : > On 10 Dec 2014 17:16, "Ian Cordasco" wrote: > > > > On Wed, Dec 10, 2014 at 11:10 AM, Donald Stufft > wrote: > > > > > > On Dec 10, 2014, at 11:59 AM, Bruno Cauet > wrote: > > > > > > Hi all, > > > Last year a survey was conducted on python 2 and 3 usage. > > > Here is the 2014 edition, slightly updated (from 9 to 11 questions). > > > It should not take you more than 1 minute to fill. I would be pleased > if you > > > took that time. > > > > > > Here's the url: http://goo.gl/forms/tDTcm8UzB3 > > > I'll publish the results around the end of the year. > > > > > > Last year results: https://wiki.python.org/moin/2.x-vs-3.x-survey > > > > > > > > > Just going to say http://d.stufft.io/image/0z1841112o0C is a hard > question > > > to answer, since most code I write is both. > > > > > > > The same holds for me. > > That question appears to have just grown a "compatible with both" option. > > It might make sense to add a similar option to the following question > about what you use for personal projects. > > -n > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/brunocauet%40gmail.com > > ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Results of the python 2.x and 3.x use survey, 2014 edition
Hi! Finally, here are the results: http://blog.frite-camembert.net/python-survey-2014.html Here is the auto-generated Google Forms recap: https://docs.google.com/forms/d/1DqxkNi4GvyTCu54usSdE1DjW29zw1tc52iMeH3z4heg/viewanalytics (more elegant than my matplotlib graphs - I'd have no future as a designer). Overall people started writing more python 3: +15 points in "I ever wrote python 3 code", +10 points in "I write more python 3 than 2". Transition is still ongoing and I hope a tipping point will be soon be attained. Users definitely seem to want to switch to python 3, but dependencies keep them with 2.7 (I weep for the few ones still on 2.5). I also posted the results on HN (https://news.ycombinator.com/item?id=8967645) and reddit (http://www.reddit.com/r/Python/comments/2u3oh0/results_of_the_python_2x_and_3x_use_survey_2014/). Have a nice day, and a year full of python 3! Bruno Cauet ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com