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

ef command cannot open relative file path (version 0.6.36) #46

Closed
nmantani opened this issue Apr 28, 2024 · 9 comments
Closed

ef command cannot open relative file path (version 0.6.36) #46

nmantani opened this issue Apr 28, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@nmantani
Copy link
Contributor

Description

ef command of version 0.6.36 cannot open relative file path. Version 0.6.35 does not have this issue.

To Reproduce

$ cd /tmp
$ echo sample > sample.txt
$ ef sample.txt
(00:21:05) failure in ef: exception of type ValueError; 'sample.txt' is not in the subpath of '/tmp' OR one path is relative and the other is absolute.
$ ef ./sample.txt
(00:22:10) failure in ef: exception of type ValueError; 'sample.txt' is not in the subpath of '/tmp' OR one path is relative and the other is absolute.
$ ef ../tmp/sample.txt
(00:24:53) failure in ef: exception of type ValueError; '../tmp/sample.txt' is not in the subpath of '/tmp' OR one path is relative and the other is absolute.
$ ef /tmp/sample.txt
sample
$

Environment

  • Operating System: Ubuntu 22.04.4 LTS (WSL2)
  • Python Version: 3.10.12
  • Refinery Version 0.6.36

  • Operating System: Ubuntu 24.04 LTS (WSL2)
  • Python Version: Python 3.12.3
  • Refinery Version 0.6.36
@nmantani nmantani added the bug Something isn't working label Apr 28, 2024
@nmantani
Copy link
Contributor Author

ef command of version 0.6.36 can open relative file path with the -w option.

$ cd /tmp
$ echo sample > sample.txt
$ ef -w sample.txt
sample
$ ef -w ./sample.txt
sample
$ ef -w ../tmp/sample.txt
sample
$ ef -w /tmp/sample.txt
sample
$

@huettenhain
Copy link
Member

Yes I did toy around with that function quite a bit. I have little time next week so I can't promise a quick fix, but I'll try to get on it ASAP.

@nmantani
Copy link
Contributor Author

Thank you! I can use version 0.6.35 until you will fix it.

huettenhain added a commit that referenced this issue Apr 28, 2024
@huettenhain
Copy link
Member

Luckily, it was a rather straightforward mistake. I added a regression test and fix, will push out a new release as soon as the tests show green.

@Donaldduck8
Copy link

Please wait! I think this fix doesn't address the use case where I'm encountering this same issue:

C:\Users\Donald\repositories\refinery>ef C:\Users\Donald\Desktop\install.log
(10:15:25) failure in ef: exception of type ValueError; 
'\\\\?\\C:\\Users\\Donald\\Desktop\\install.log' is not in the subpath of '\\\\?\\C:\\Users\\Donald\\repositories\\refinery' OR one path is relative and the other is absolute.

In this case, I'm trying to ef a file that's not in a subfolder relative to my CWD.

Windows 11
Python 3.11.9
Up-to-date including bugfix

huettenhain added a commit that referenced this issue Apr 28, 2024
@huettenhain
Copy link
Member

Sorry @Donaldduck8, I move too fast. No worries, I can look into that and push out another release 😅.

@huettenhain
Copy link
Member

I will close this one out as 0.6.37 / 58b3590 resolves the original issue. @Donaldduck8 I will track your issue in #47.

@nmantani
Copy link
Contributor Author

@huettenhain Thank you so much for the quick fix!

@huettenhain
Copy link
Member

Sure thing @nmantani but stay tuned for 0.6.38 once I fixed #47 xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants