Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

function _Encode(self,s) error at examples/twitter-to-xhtml.py #327

Description

@bydeath

when I run the script twitter-to-xhtml.py in examples fold, I found a TypeError showed in quote below, the error function is _Encode in the code section below. I think whether the code should be return str(s).encode(self._input_encoding) instead of return str(s, self._input_encoding).encode('utf-8') ?

    def _Encode(self, s):
        if self._input_encoding:
            print(self._input_encoding)
            return str(s, self._input_encoding).encode('utf-8')
        else:
            return str(s).encode('utf-8')

File "twitter-to-xhtml.py", line 54, in FetchTwitter
statuses = api.GetUserTimeline(user_id=user, count=1)
File "build/bdist.linux-x86_64/egg/twitter/api.py", line 719, in GetUserTimeline
File "build/bdist.linux-x86_64/egg/twitter/api.py", line 4514, in _RequestUrl
File "build/bdist.linux-x86_64/egg/twitter/api.py", line 4339, in _BuildUrl
File "build/bdist.linux-x86_64/egg/twitter/api.py", line 4393, in _EncodeParameters
File "build/bdist.linux-x86_64/egg/twitter/api.py", line 4373, in _Encode
TypeError: str() takes at most 1 argument (2 given)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions