Edgewall Software
Modify

Opened 10 years ago

Last modified 10 years ago

#841 new defect

Broken entry_points.txt

Reported by: Martin Schulze <spam.martin.schulze@…> Owned by:
Priority: blocker Milestone: 0.7
Component: General Version: dev
Keywords: Cc:
Operating System: Linux

Description

After installing a python update my Trac installation stopped working and gave the following error message:

Error

TracError: ValueError: ("EntryPoint must be in 'name=module:attrs [extras]' format", 'http://bitten.cmlenz.net/tools/c#autoreconf = bitten.build.ctools:autoreconf')

After some searching I found that the entry_points.txt of Bitten contained lines like the one in the error message:

http://bitten.cmlenz.net/tools/c#autoreconf = bitten.build.ctools:autoreconf

I presume that the newly installed python version changed the parser code. Digging into pkg_resources's Entry Point? class I found that they use a regex:

        pattern = re.compile(
        r'\s*'
        r'(?P<name>[+\w. -]+?)\s*'
        r'=\s*'
        r'(?P<module>[\w.]+)\s*'
        r'(:\s*(?P<attr>[\w.]+))?\s*'
        r'(?P<extras>\[.*\])?\s*$'
    )

As you can see the allowed characters for the left hand side of the = are +, -, " ", . and alphanumeric (including _). So the entry_points.txt contains (from the Regex's point of view) the following illegal characters: :/#

I did not find any authorative answer on the allowed format of the left hand side so it might well be the parser is too narrow minded. (Everything seemed to work, when I added :/# to the Regex. I have found the braking change in the parser: https://bitbucket.org/pypa/setuptools/diff/pkg_resources/__init__.py?diff2=7c0e84396b52&at=default)

Btw: Reinstalling Bitten is not possible as the installation procedure yields the same error message.

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Martin Schulze <spam.martin.schulze@…>

I opened an issue on setuptools and they fixed the problem: https://bitbucket.org/pypa/setuptools/issue/327/entrypointparse-is-too-narrow-minded

This ticket can be closed as it was an error on their side.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.