Giter Club home page Giter Club logo

Comments (8)

x89 avatar x89 commented on June 1, 2024

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.

 avatar commented on June 1, 2024

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.

x89 avatar x89 commented on June 1, 2024

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.

 avatar commented on June 1, 2024

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.

x89 avatar x89 commented on June 1, 2024

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.

 avatar commented on June 1, 2024

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.

 avatar commented on June 1, 2024

Running python3 with virtualenv and it ran successfully (yay!). So this problem is specific to 2.7. Thanks for your help!

from shreddit.

x89 avatar x89 commented on June 1, 2024

I'm glad it's working πŸ‘

from shreddit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.