Comments (4)
Replicated again with the following:
rtv -l http://www.reddit.com/r/linuxmasterrace/comments/316in4/even_rpcmasterrace_knows_you_should_be_running/
Trace
File "build/bdist.linux-x86_64/egg/rtv/page.py", line 293, in _draw_content
File "build/bdist.linux-x86_64/egg/rtv/submission.py", line 125, in draw_item
File "build/bdist.linux-x86_64/egg/rtv/submission.py", line 148, in draw_comment
UnicodeEncodeError: 'ascii' codec can't encode character u'\u15e7' in position 15: ordinal not in range(128)
In this example, it is crashing becuase the flair contains a unicode character Antergos [sudo α§ -Syu]
I'm not sure exactly why this is happening. In helpers.py we set the error handling to 'replace'
which should replace the unicode characters with ascii placeholders
encoding = 'utf-8' if config.unicode else 'ascii'
string = string.encode(encoding, 'replace')
from rtv.
I think the issue might be formatting the string before calling the clean method
Changing line 148 of submission.py
text = clean('{flair} '.format(**data))
To this
text = '{0} '.format(clean(data['flair']))
Resolves the problem.
from rtv.
Yup you're right, I just figured this out as well.
Calling '{flair}'.format(**data)
in python2 tries to convert the unicode data to a native string before formatting it. You need to explicitly mark the type as unicode.
clean(u'{flair} '.format(**data))
09c4865. Thanks for the detailed bug report.
from rtv.
Looks good. I'm glad I could help π
from rtv.
Related Issues (20)
- add Twitch mime parser HOT 5
- Crash when hitting G on empty thread HOT 1
- RTV development is shutting down HOT 30
- Offering to help with the project HOT 1
- ConnectionError upon first launch
- no confirmation on exit HOT 1
- Program exited with status 127 HOT 1
- When you set $RTV_BROWSER variable to a program with options like "mybrowser -u" it basicly doesn't work HOT 1
- [1.2.7] Where is the configuration option to toggle whether to open web browser links in a new tab or a new window?
- Not being able to view remote image url via iTerm2's imgcat HOT 6
- How do I change it that rtv uses leafpad instead of nano as its default text editor?
- Save option for posts.
- Option to edit a posted comment.
- Where does rtv store the credentials or session/cookie file so I could just take a rtv install to another OS/new install and donβt have to reopen Firefox for allowing the app access?
- Version 1.27.0_1 (from brew) crashed when opening url HOT 5
- Fix incase mpv is not opening anymore
- When pressing < o > key on a reddit post rtv crashes, "Can't pickle local object" HOT 1
- Crash while trying to sign in HOT 1
- Crash while trying to open a submission link HOT 2
- Archiving Github Repository
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 rtv.