#1 Amf -file parsing fails

open-fixed
nobody
None
5
2002-01-17
2001-12-20
No

There seems to be a problem with amf file parsing. If some field in the amf header does not have
a
corresponding value to it, the parsing fails like
<pre>
File "C:\Python\reportlab\pdfbase\pdfmetrics.py", line 110, in parseAFMFile
left, right = string.split(line, ' ', 1)
ValueError: unpack list of wrong size
</pre>

This is due to the fact that parser assumes each header row containing exactly 2 fields. If the
second field is missing, this occurs. The parser should at least rise some exception like "incomplete
header information". Or, the parser might just silently ignore this incompleteness by inserting a
'None' -value to the missing component.

Cheers;
-Lode

Discussion

  • Robin Becker

    Robin Becker - 2002-01-17
    • status: open --> open-fixed
     
  • Robin Becker

    Robin Becker - 2002-01-17

    Logged In: YES
    user_id=6946

    I have fixed by putting out a more approriate error message.
    I doubt it would be wise to ignore or attempt to fix this
    kind of format error.

     
  • Robin Becker

    Robin Becker - 2002-01-17
    • milestone: 100694 -->
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks