TarballImportContext crashes when comparing the last char of empty strings

Bug #1479268 reported by Tobias Herp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Undecided
Unassigned

Bug Description

Products.GenericSetup, v1.7.6:

In Products/GenericSetup/context.py, there are two comparisons of path[-1] to ‘/’, which must fail for empty strings (which are apparently a known special case). IMO, here the endswith method must be used.

The empty string seems to be a known special case for tarballs.

I attached a patch.

Revision history for this message
Tobias Herp (tobias-herp) wrote :
Revision history for this message
Tobias Herp (tobias-herp) wrote :

There is a pull request on https://github.com/zopefoundation/Products.GenericSetup/pull/13 now which includes the attached patch.

Revision history for this message
Maurits van Rees (maurits-vanrees) wrote :

I have merged the pull request.

Changed in zope2:
status: New → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Fix Committed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.