Comments (8)
Is the error reproducible? As in it happens every time you try to run it?
I know Shreddit works with Python 2.7 but is there any chance you could perhaps make a Python 3 virtualenv and test from there?
from shreddit.
Yeah, reproducible. I run: source ./bin/activate and get the (Shreddit) prompt then ./run and get the same thing. That was on centos 7. I'll see if I can install the SCL for python 3 and try again.
I tried from a fedora machine (also 2.7) and got this:
Traceback (most recent call last):
File "./shreddit.py", line 71, in
r = praw.Reddit(user_agent="shreddit/4.0")
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py", line 1207, in init
super(AuthenticatedReddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py", line 642, in init
super(OAuth2Reddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py", line 763, in init
super(UnauthenticatedReddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py", line 343, in init
self.http.headers['User-Agent'] = self.config.ua_string(user_agent)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py", line 208, in ua_string
info = platform.platform(True).encode('ascii', 'ignore')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 56: ordinal not in range(128)
from shreddit.
What happens when you open up python
and enter:
import platform platform.platform(True)
Whatever that returns is throwing a fit within praw's init.py.
Any luck with Python 3? It has less issues with Unicode (usually).
On Sun, Oct 11, 2015 at 3:40 PM, lunchables [email protected]
wrote:
Yeah, reproducible. I run: source ./bin/activate and get the (Shreddit)
prompt then ./run and get the same thing. That was on centos 7. I'll see if
I can install the SCL for python 3 and try again.I tried from a fedora machine (also 2.7) and got this:
Traceback (most recent call last):
File "./shreddit.py", line 71, in
r = praw.Reddit(user_agent="shreddit/4.0")
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py",
line 1207, in init
super(AuthenticatedReddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py",
line 642, in init
super(OAuth2Reddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py",
line 763, in init
super(UnauthenticatedReddit, self).init(_args, *_kwargs)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py",
line 343, in init
self.http.headers['User-Agent'] = self.config.ua_string(user_agent)
File "/home/jon/Shreddit/lib/python2.7/site-packages/praw/init.py",
line 208, in ua_string
info = platform.platform(True).encode('ascii', 'ignore')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 56:
ordinal not in range(128)β
Reply to this email directly or view it on GitHub
#43 (comment).
from shreddit.
import platform
platform.platform(True)
'Linux-3.10.0-229.11.1.el7.x86_64-x86_64-with-centos-7.1.1503-Core'
And, I think we found the problem:
import platform
platform.platform(True)
'Linux-3.14.27-100.fc19.x86_64-x86_64-with-fedora-19-Schr\xc3\xb6dinger\xe2\x80\x99s_Cat'
Yikes.
So I manually set the platform in init.py and at least I've got matching errors on both platforms now.
TypeError: cannot make memory view because object does not have the buffer interface
These are both python 2.7 though so not terribly surprising. Still messing around trying to get python3 setup from SCL.
from shreddit.
You could try editing shreddit.py:71 and changing the user_agent to
something else, "donkey" or something⦠It's down that trace that things are
going wrong there.
I doubt that'll work but it could be worth a shot.
I don't see anything in that platform.platform that couldn't be handled by
.encode('ascii', 'ignore').
On Sun, Oct 11, 2015 at 4:09 PM, lunchables [email protected]
wrote:
import platform
platform.platform(True)
'Linux-3.10.0-229.11.1.el7.x86_64-x86_64-with-centos-7.1.1503-Core'Still messing around trying to get python3 setup from SCL.
β
Reply to this email directly or view it on GitHub
#43 (comment).
from shreddit.
Apologies - I updated my last reply. I'm confusing this by running it in two places. I'm now getting the same buffer error on both platforms. The fedora machine was returning a very bizarre platform.
from shreddit.
Running python3 with virtualenv and it ran successfully (yay!). So this problem is specific to 2.7. Thanks for your help!
from shreddit.
I'm glad it's working π
from shreddit.
Related Issues (20)
- Can't run, AttributeError HOT 6
- Updated to ubuntu 20 - get error HOT 3
- Issue with requirements file HOT 1
- Error when trying to clear a vote that cannot be cleared. HOT 1
- Read-Only File system? HOT 1
- Delete private messages? HOT 1
- [NOTE] My fork of this repo with updates still works fine HOT 3
- Can a Whitelist ID Example be added to the ReadMe or in the Shreddit.yml file? HOT 2
- Problem with Arrow library HOT 2
- Can't quite figure it out HOT 7
- This script removed my most recent comment even though I set a minimum age of 3 years HOT 1
- Suddenly failing HOT 11
- ValueError: Unknown attribute: 'hours'.? HOT 9
- zsh: command not found when trying to setup cron
- TypeError
- whitelist seems to be ignored HOT 1
- mistakenly created
- Use my repo. This one has been broken for years. HOT 10
- I rewrote it in Rust HOT 1
- Could you do this for Twitter? HOT 1
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 shreddit.