nntplib downloads content with extra linebreaks

rweth rweth at cisco.com
Sat Jan 6 14:03:33 EST 2007


I am using nntplib to download archived xml messages from our internal 
newsgroup. This is working fine except the download of files  to the 
connected server, has extra embedded
lines in them (all over the place), from the
   s.body(id,afile)  # body method

Is there any way to employ this library to strip out these extra
line breaks? I know this may seem trivial but they cause serious
issues when I try and employ the subsequent downloaded xml file
for a series of processes.

When I forward one of these files from Thunderbird (via the newsgroup)
to outlook and open it up, and then select  "ignore extra line breaks",
and cut and paste the content .. all is well. The file is "healed".

Apart from being just a plain annoyance (all this manual steps) it 
really bothers me something this trivial (the pretty-fication of 
content) would  throw me out of whack so badly .. also that outlook has 
some simple method that magically does what I need and I cannot hack it 
for myself. (not to mention how brittle
the xml processing we must have in place is .. )

First I thought it was a  call to RFC 977(or below)  which I cannot work 
out, but which does the deed! But then I though that the content of the 
forwarded msg has something in it which outlook can filter ..
because the forwarded msg is encapsulated, and likely cut off from the 
news server.
(what do I know these are guesses)



More information about the Python-list mailing list