A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-November/137321.html below:

[Python-Dev] Unicode decode exception

[Python-Dev] Unicode decode exceptionbalaji marisetti balajimarisetti at gmail.com
Sun Nov 30 09:07:52 CET 2014
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)

---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-39-24a3ae32a691> in <module>()
      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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4