I've run into a situation where I wish to create a Butler that may have one or more input repositories. In other words, I'm calling (slightly simplified):
where the URIs repo1 and repo2 may represent the same location. When I first do this, the Butler detects whether the two repositories are the same, and if so removes the duplicate parent from outputRepo. So far, so good.
However, if I rerun the program with the same repositories, I get the following error:
Aside from relative vs. absolute paths, the only difference between the two lists is that the former has a duplicate entry while the latter does not. Adding an explicit os.path.samefile(repo1, repo2) test to the calling code causes the problem to go away, so I assume it's the not-yet-pruned duplicates that are the problem. However, I'd prefer to not have to assume that the repository URIs are filesystem paths.
Would it be possible to fix the test so that it's the "reduced" parent lists that get compared?