libturpial on windows

2 views
Skip to first unread message

Eduard Lucena

unread,
Oct 20, 2014, 10:45:35 PM10/20/14
to turpi...@googlegroups.com
Hi people,

I know all people here are linux guys, same as me, but in my job i "have to" use windows so i give it a try to python on windows and finally i'd achieved the installation of libturpial.

I use it to twit from the console, the python console in windows is encoded in "only-god-know-the-encoding", so to make it work i have to use the encode and decode methods of the string:

"testing".encode('utf-8')
status.text.decode('utf-8')

I'm ginving you a document[1] with the steps. Is a really awful step-by-step, but it will help. Maybe in a future this can be a reference to make a windows version of the final turpial.


Best Regards,
Eduard Lucena

Eduard Lucena

unread,
Oct 20, 2014, 11:36:44 PM10/20/14
to turpi...@googlegroups.com
Erratum:

"testing".decode('utf-8')
status.text.encode('utf-8')

Br,
Eduard Lucena
--
=======================
             Eduard Lucena
          Cel:=0424-5216478
     GNU/Linux User #403161
          Ubuntu User #8749
=======================

Eduard Lucena

unread,
Oct 29, 2014, 1:42:19 AM10/29/14
to turpi...@googlegroups.com
Hi all,

I'm having encoding problems in windows with libturpial:

>>>twitear("Feliz cumpleaños a mi esposa, mi amiga y mi movia eterna. Te amo @ojedalis",None,"C:\blog198img05.jpg")

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    twitear("Feliz cumpleaños a mi esposa, mi amiga y mi movia eterna. Te amo @ojedalis",None,"C:\blog198img05.jpg")
  File "C:\Documents and Settings\Administrador.DESKTOP\Mis documentos\test.py", line 8, in twitear
    return c.update_status(acc_id, text.decode('utf-8'),reply_id,media)
  File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf1 in position 13: invalid continuation byte

Where twitear is:

def twitear(text,reply_id=None,media=None):
    return c.update_status(acc_id, text.decode('utf-8'),reply_id,media)

I'm testing libturpial en MS windows XP with Python 2.7.8. I need to tell that for now, everything is working, including the media and the reply by id.

I'm using encoding because when i don't encode the twitt look like this one:

https://twitter.com/X3M/status/522981006576345088


Hope you can give me a light.

Br,
Eduard Lucena
Reply all
Reply to author
Forward
0 new messages