Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can only concatenate str (not "bytes") to str #103

Closed
cristiangrojas opened this issue Mar 11, 2021 · 3 comments
Closed

TypeError: can only concatenate str (not "bytes") to str #103

cristiangrojas opened this issue Mar 11, 2021 · 3 comments
Assignees

Comments

@cristiangrojas
Copy link

I'm getting this error when trying to instantiate a user's feed.

I'm using Python 3.8

TypeError                                 Traceback (most recent call last)
<ipython-input-5-a43940bebafd> in <module>
     12 from stream_django.feed_manager import feed_manager
     13 
---> 14 feed_manager.get_user_feed(user.id)
     15 
     16 # Add an Activity; message is a custom field - tip: you can add unlimited custom fields!

~/.virtualenvs/rumba-api-30TwkXco/lib/python3.8/site-packages/stream_django/managers.py in get_user_feed(self, user_id, feed_type)
     25         if feed_type is None:
     26             feed_type = self.user_feed
---> 27         feed = stream_client.feed(feed_type, user_id)
     28         return feed
     29 

~/.virtualenvs/rumba-api-30TwkXco/lib/python3.8/site-packages/stream/client.py in feed(self, feed_slug, user_id)
    116         user_id = validate_user_id(user_id)
    117         token = self.create_jwt_token("feed", "*", feed_id="*")
--> 118         return Feed(self, feed_slug, user_id, token)
    119 
    120     def get_default_params(self):

~/.virtualenvs/rumba-api-30TwkXco/lib/python3.8/site-packages/stream/feed.py in __init__(self, client, feed_slug, user_id, token)
     27         self.feed_targets_url = "feed_targets/%s/" % self.id.replace(":", "/")
     28         self.feed_together = self.id.replace(":", "")
---> 29         self.signature = self.feed_together + " " + self.token.decode('utf-8')
     30 
     31     def create_scope_token(self, resource, action):

TypeError: can only concatenate str (not "bytes") to str```
@edbond
Copy link

edbond commented Apr 16, 2021

I am having this issue too. Are there any ETA to fix?
The error makes it not possible to use getstream from python.

Python 3.9.2
stream-django==1.6.2
stream-python==5.0.1

@ferhatelmas
Copy link
Contributor

It's related to pyjwt (2.x) changes, it's breaking. Django wrapper will be updated for 3.x and these underlying dependency changes early next week.

@ferhatelmas ferhatelmas self-assigned this Apr 16, 2021
@ferhatelmas
Copy link
Contributor

There is a new release, this should be fixed by it. Let me know otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants