[Pythonmac-SIG] Python Metadata Importer
Nicholas Riley
njriley at uiuc.edu
Thu May 26 17:05:04 CEST 2005
On Thu, May 26, 2005 at 10:54:59AM -0400, Jonathan Wight wrote:
> After adding Gideon's suggestion for CRLF ending file. My importer is
> failing on only 8 files out of 3084 files.
>
> All the failures are with Python files that try to generate the
> __version__ attribute with code instead, e.g.:
>
> __version__ = string.split('$Revision: 1.8 $')[1]
> __version__ = '$Revision: 1.6 $'[11:-2]
>
> And so on.
>
> My options are:
>
> #1 Continue to fail and not process the script any further (easiest
> solution ;-)
> #2 Just ignore the attribute in question.
> #3 Convert the attribute into a string even though it might not make
> much sense.
> #4 Execute the line and get the computed value of the attribute.
>
> I don't really want to execute the line - who the heck knows what it
> could do. Unless anyone has any better ideas I'm just going to try
> and gracefully ignore the attribute.
How about just recognizing versions that have the form "$Revision:
foo$" and stripping the tag info, just as the code above does?
--
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
More information about the Pythonmac-SIG
mailing list