Skip to content

Commit b6d30b1

Browse files
committed
dont encode cp932
1 parent 78c976e commit b6d30b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

regist_pin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ def twitter():
2222
print
2323
print "If you did your registration correctly, you can see some numbers"
2424
print "(If not, maybe you had not chosen client type during Twitter OAuth registration)"
25-
print
25+
print
2626
tw = OAuthApi(CONSUMER_KEY, CONSUMER_SECRET, request_token)
2727
oauth_verifier = raw_input("What is the number(PIN)? ")
2828
access_token = tw.getAccessTokenWithPin(oauth_verifier)
2929
print "Finished setting OAuth configuration."
3030
print "Now, you can use OAuth. Enjoy!"
31-
31+
3232
pickle.dump(access_token, file(KEY_FILE_API, "w"))
3333
return OAuthApi(CONSUMER_KEY, CONSUMER_SECRET, access_token)
3434

3535
def main(args):
3636
tw = twitter()
3737
if len(args) < 2:
3838
for status in tw.GetFriendsTimeline(count=20):
39-
print status.GetUser().GetScreenName() + ":", status.GetText().encode("cp932", "replace")
39+
print status.GetUser().GetScreenName() + ":", status.GetText()
4040
else:
4141
post = " ".join(args[1:])
42-
tw.PostUpdate(post.decode("cp932").encode("utf-8"))
42+
tw.PostUpdate(post)
4343

4444
if __name__ == "__main__": main(sys.argv)

0 commit comments

Comments
 (0)