Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > nntplib encoding problem

Reply
Thread Tools

nntplib encoding problem

 
 
Laurent Duchesne
Guest
Posts: n/a
 
      02-28-2011
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NNTPlib encoding issue mohit_ranka Python 1 02-13-2009 12:25 PM
NNTPlib::xover problem Helmut Jarausch Python 2 08-07-2006 12:46 PM
get "in reply to" with nntplib Hanman Python 0 04-24-2006 06:34 PM
How to post news articles with NNTPlib python@hope.cz Python 2 01-28-2005 08:14 PM
nntplib: abstraction of threads Rakesh Python 4 01-22-2005 02:42 AM



Advertisments