pycurl setopt not working with unicode input

Bug #542501 reported by Sun Ning
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gwibber
Invalid
Undecided
Unassigned

Bug Description

After I upgraded to Ubuntu 10.04, Gwibber doesn't work any more.
There is no special logs printed out even in debug mode

Strangely, there is some updates always shown in the search page.
See the attachment.

Revision history for this message
Sun Ning (classicning) wrote :
Revision history for this message
Sun Ning (classicning) wrote :
Revision history for this message
Sun Ning (classicning) wrote :
Download full text (7.3 KiB)

well, I got the stacktrace of gwibber-service:
DEBUG:Gwibber Dispatcher:<twitter:private> Performing operation
ERROR:Gwibber Dispatcher:<twitter:private> Operation failed
DEBUG:Gwibber Dispatcher:Traceback:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/dispatcher.py", line 54, in perform_operation
    message_data = PROTOCOLS[account["protocol"]].Client(account)(opname, **args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 146, in __call__
    return getattr(self, opname)(**args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 158, in private
    return self._get("direct_messages.json", "private", count=count, since_id=since)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 128, in _get
    self.account["username"], self.account["password"]).get_json()
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py", line 21, in __init__
    self.curl.setopt(pycurl.USERPWD, "%s:%s" % (username, password))
TypeError: invalid arguments to setopt

DEBUG:Gwibber Dispatcher:<identica:receive> Performing operation
ERROR:Gwibber Dispatcher:<identica:receive> Operation failed
DEBUG:Gwibber Dispatcher:Traceback:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/dispatcher.py", line 54, in perform_operation
    message_data = PROTOCOLS[account["protocol"]].Client(account)(opname, **args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 144, in __call__
    return getattr(self, opname)(**args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 147, in receive
    return self._get("statuses/friends_timeline.json", count=count, since_id=since)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 126, in _get
    self.account["username"], self.account["password"]).get_json()
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py", line 21, in __init__
    self.curl.setopt(pycurl.USERPWD, "%s:%s" % (username, password))
TypeError: invalid arguments to setopt

DEBUG:Gwibber Dispatcher:<identica:responses> Performing operation
ERROR:Gwibber Dispatcher:<identica:responses> Operation failed
DEBUG:Gwibber Dispatcher:Traceback:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/dispatcher.py", line 54, in perform_operation
    message_data = PROTOCOLS[account["protocol"]].Client(account)(opname, **args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 144, in __call__
    return getattr(self, opname)(**args)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 153, in responses
    return self._get("statuses/mentions.json", count=count, since_id=since)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/identica.py", line 126, in _get
    self.account["username"], self.account["password"]).get_json()
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py", line 21, in __init__
    self.curl.setopt(pycurl.USERPWD, "%s:%s" % (username, password))
TypeError: invalid argume...

Read more...

Revision history for this message
Sun Ning (classicning) wrote :

I got the problem
The text saving user's credential is encoded as unicode, however, if you passing unicode the pycurl.setopt, you will get a typeerror
So to solve this problem, use this instead of the original line:

self.curl.setopt(pycurl.USERPWD, ("%s:%s" % (username, password)).encode("ascii"))

Sun Ning (classicning)
summary: - display nothing on 2.29.92 and 2.31
+ pycurl setopt not working with unicode input
Revision history for this message
Vadim Rutkovsky (roignac) wrote :

Can't reproduce on 2.90.31 - I used twitter with unicode symbols in the password. Is the issue still reproducable? Are there any special preconditions?

Changed in gwibber:
status: New → Incomplete
Revision history for this message
Omer Akram (om26er) wrote :

closing this bug. please re-open if this is still an issue with gwibber 2.32.0.2

Changed in gwibber:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.