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

doctest under windows will fail... #780

Closed
jedie opened this issue Aug 3, 2015 · 1 comment
Closed

doctest under windows will fail... #780

jedie opened this issue Aug 3, 2015 · 1 comment

Comments

@jedie
Copy link

jedie commented Aug 3, 2015

def make_relative_path(source, dest, dest_is_directory=True):
    """
    Make a filename relative, where the filename is dest, and it is
    being referred to from the filename source.

        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/usr/share/another-place/src/Directory')
        '../another-place/src/Directory'
        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/home/user/src/Directory')
        '../../../home/user/src/Directory'
        >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
        './'
    """

this will fail under windows:

Failed example:
    make_relative_path('/usr/share/something/a-file.pth',
                       '/usr/share/another-place/src/Directory')
Expected:
    '../another-place/src/Directory'
Got:
    '..\\another-place\\src\\Directory'

Using os.path.join() oder os.path.normpath() will help here. But then the doctest isn't really nice to read :(

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@stale stale bot closed this as completed Jan 22, 2019
@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant