Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Ensure relpath is executed between paths in the same drive #7335

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

adferrand
Copy link
Collaborator

@adferrand adferrand commented Aug 16, 2019

On Windows you can have several drives (C:, D:, ...), that is the roughly (really roughly) equivalent of mount points, since each drive is usually associated to a specific physical partition.

So you can have paths like C:\one\path, D:\another\path.

In parallel, os.path.relpath(path, start='.') calculates the relative path between the given path and a start path (current directory if not provided). In recent versions of Python, os.path.relpath will fail if path and start are not on the same drive, because a relative path between two paths like C:\one\path, D:\another\path is not possible.

In saw unit tests failing because of this in two locations. This occurs when the certbot codebase that is tested is on a given drive (like D:) while the default temporary directory used by tempfile is on another drive (most of the time located in C: drive).

This PR fixes that.

Copy link
Member

@bmw bmw left a comment

Choose a reason for hiding this comment

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

LGTM!

@bmw bmw merged commit 0324d17 into certbot:master Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants