Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

test_utility.TestGetMatchingFiles: Fix for paths containing dots. #58

Merged
merged 1 commit into from
Sep 18, 2016
Merged

test_utility.TestGetMatchingFiles: Fix for paths containing dots. #58

merged 1 commit into from
Sep 18, 2016

Conversation

mbakke
Copy link
Contributor

@mbakke mbakke commented Sep 17, 2016

Hi, I'm packaging PyXB for GNU Guix which sets TMPDIR as /tmp/guix-build-python-pyxb-1.2.4-0. This caused https://github.com/pabigot/pyxb/blob/master/tests/utils/test-utility.py#L694 to fail because __NoExt_re matches the directory that precedes the temporary files.

You can reproduce it by e.g. mkdir /tmp/path.with.dots; TMPDIR=/tmp/path.with.dots python setup.py test.

The following commit should fix it. Escaping %s is not strictly necessary on Unix, but does not seem to hurt, and I think it's required on platforms with more awkward directory separators. Changing * to + is optional :)

Thanks!

When the leading path contains a '.', the file extension test in
TestGetMatchingFiles would fail. Fix it by matching either start-of-line
or a directory separator before looking for dot and end-of-line.
Copy link
Owner

@pabigot pabigot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge for next release. Thanks.

@pabigot pabigot merged commit 29cf6f0 into pabigot:next Sep 18, 2016
pabigot added a commit that referenced this pull request Sep 18, 2016
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
@mbakke mbakke deleted the fix-dot-path branch September 18, 2016 14:34
@pabigot pabigot added this to the PyXB 1.2.5 milestone Sep 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants