nntplib encoding problem

Discussion in 'Python' started by Laurent Duchesne, Feb 28, 2011.

  1. Hi,

    I'm using python 3.2 and got the following error:

    >>> nntpClient = nntplib.NNTP_SSL(...)
    >>> nntpClient.group("alt.binaries.cd.lossless")
    >>> nntpClient.over((534157,534157))

    ... 'subject': 'Myl\udce8ne Farmer - Anamorphosee (Japan Edition) 1995
    [02/41] "Back.jpg" yEnc (1/3)' ...
    >>> overview = nntpClient.over((534157,534157))
    >>> print(overview[1][0][1]['subject'])

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    UnicodeEncodeError: 'utf-8' codec can't encode character '\udce8' in
    position 3: surrogates not allowed

    I'm not sure if I should report this as a bug in nntplib or if I'm
    doing something wrong.

    Note that I get the same error if I try to write this data to a file:

    >>> h = open("output.txt", "a")
    >>> h.write(overview[1][0][1]['subject'])

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    UnicodeEncodeError: 'utf-8' codec can't encode character '\udce8' in
    position 3: surrogates not allowed

    Thanks,
    Laurent
     
    Laurent Duchesne, Feb 28, 2011
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rakesh

    nntplib: abstraction of threads

    Rakesh, Jan 16, 2005, in forum: Python
    Replies:
    4
    Views:
    360
  2. Replies:
    2
    Views:
    359
  3. Hanman

    get "in reply to" with nntplib

    Hanman, Apr 24, 2006, in forum: Python
    Replies:
    0
    Views:
    319
    Hanman
    Apr 24, 2006
  4. Helmut Jarausch

    NNTPlib::xover problem

    Helmut Jarausch, Aug 7, 2006, in forum: Python
    Replies:
    2
    Views:
    405
    Helmut Jarausch
    Aug 7, 2006
  5. mohit_ranka

    NNTPlib encoding issue

    mohit_ranka, Feb 13, 2009, in forum: Python
    Replies:
    1
    Views:
    299
Loading...

Share This Page