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

Fix get_full_context() finding filename path #54

Merged
merged 1 commit into from Mar 30, 2021

Conversation

kr1zo
Copy link
Contributor

@kr1zo kr1zo commented Feb 18, 2021

Issue #55

@okken
Copy link
Owner

okken commented Mar 30, 2021

Tried it. But I just don't like the long paths. Relative is way handier for me.
A workaround for the problem is to create a venv in the test directory, then everything will be on D.
At least, I think that will work.

@rloutrel
Copy link

rloutrel commented Aug 15, 2022

@okken : Can we consider, it is not expected that os.path return an absolute path when calling relpath and the current behvior is not really a bug, but that the function caller should handle the exception?

May I work on a fix for this where the exception is caught and fallback in abspath, like:

try:    
    filename = os.path.relpath(filename)
except ValueError as error:
    filename = os.path.abspath(filename)

it would produce the long path ONLY when the relative path is not possible to be built (like on wind**s system with multiple drives)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants