Skip to content Skip to sidebar Skip to footer

How Can We Figure Out Why Certain Uuencoded Files Are Not Decoding Properly Using Python?

We are trying to decode some uuencoded PDF files that are embedded in a txt file. The problem we have is that most of the PDF files decoded just fine using Python's uuencode librar

Solution 1:

>>>uu.decode(open('0000000000-11-005978.txt'))
Warning: Trailing garbage

The source data itself is damaged. This is further evidenced by the .. at the beginning of a line near the end.

Solution 2:

$ python -c "import urllib2; print len(urllib2.urlopen('http://www.sec.gov/Archives/edgar/data/914257/000000000011005978/0000000000-11-005978.txt').read().decode('uu'))"
43124

works just fine.

Post a Comment for "How Can We Figure Out Why Certain Uuencoded Files Are Not Decoding Properly Using Python?"