Comments (3)
I think it only prints the exception instead of raising it because it still returns the original text. Of course that could be changed if that's bad behavior.
I've pushed a potential fix for this to the "issue-6" branch, try it out let me know.
from instapaper.
Hmm. If I run my example program on Python 3, I get a different error now:
$ python demo.py
Traceback (most recent call last):
File "/Users/alexwlchan/repos/instapaper/instapaper.py", line 113, in dehtml
text = str(text, 'UTF-8')
TypeError: decoding str is not supported
I think the correct behaviour here is to pass through text
unmodified β i.e., the patch should be
if sys.version_info < (3, 0):
text = text.decode('utf-8')
In Python 2, text
is a bytestring, so we need to decode it to Unicode before passing it up the stack. But Python 3 is dealing with Unicode strings natively, so itβs already been decoded for us.
from instapaper.
I confirm that the fix from @alexwlchan works as expected. Please see PR #8 for an updated version.
from instapaper.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instapaper.