Failed to send request: 'str' object has no attribute 'decode' on Ubuntu 16.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3-defaults (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
The code attached below generates an error on Ubuntu 16.04 LTS with python3 default package installed (python3 --version returns 3.5.2).
The error message is:
«Failed to send request: 'str' object has no attribute 'decode'»
The code works fine on Ubuntu 17.04 and Fedora 25 (both python3 --version returning 3.5.3). The code also runs on Ubuntu 16.04 LTS with self-compiled from source python 3.6.1.
Also, the code has been running ok for over a year on Ubuntu 16.04 LTS - it only fails since mid June 2017.
Not sure where the issue is, probably in Ubuntu package for python or in python version 3.5.2.
from datetime import datetime,
import tweepy as twitter
def sendToTwitter():
#connect to the twitter api
message = "tweet test"
try:
api = twitter.API(auth)
except Exception as e:
return
sendToTwitter()
Changed in python3-defaults (Ubuntu): | |
status: | New → Incomplete |
It would be helpful if you provide a traceback. Just remove try/except or insert raise before print.