Comment 1 for bug 132639

Revision history for this message
John A Meinel (jameinel) wrote :

Well, the check is actually meant to catch cases where someone is trying to do:

tree.add('foo/../bar')

You certainly should be able to add a file named "foo..bar".

So a better check might be "assert /../ not in f"

At least, by that point the path should be properly sanitized such that there are only forward slashes, and not backslashes. Otherwise a lot of the rest of the code would break anyway.-

I believe smart_add() is safe about it, because of how it recurses through the tree and normalizes the user's input. WT.add() is not safe about this, because it expects that the caller has already done it.

If you *really* need to work around it, notice that these are plain 'assert' cases, so running in python -O mode will skip the check.