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 exception when using tempfiles #6

Merged
merged 1 commit into from
Feb 26, 2021
Merged

Fix exception when using tempfiles #6

merged 1 commit into from
Feb 26, 2021

Conversation

lhh
Copy link
Contributor

@lhh lhh commented Feb 25, 2021

import editor
ret = editor('fdsa')
Traceback (most recent call last):
File "/home/lhh/venv-38/lib/python3.8/site-packages/editor.py", line 107, in editor
filename.remove()
AttributeError: 'str' object has no attribute 'remove'

Signed-off-by: Lon Hohberger lon@metamorphism.com

Signed-off-by: Lon Hohberger <lon@metamorphism.com>
@rec
Copy link
Owner

rec commented Feb 26, 2021

Thanks for doing this, and thanks for using this library.

And what a nice clean change that is obviously correct.

Embarrassing, too, for me. :-D I can see where I added this. And people do use this - I guess they either ignored the error, or aren't using tempfiles.

Question: why did you use os.unlink instead of os.remove? I don't care one way or the other.

Question for me: why isn't there a unit test for this code path? :-D (Well... the issue is that this library doesn't have my usual near-100% coverage because of the editor coming up. But I should have an integration test which I do by hand.)

Thanks again!

@rec rec merged commit 0c672d9 into rec:master Feb 26, 2021
@rec
Copy link
Owner

rec commented Feb 26, 2021

Well, I pulled it and I'm going to make a new release immediately, no need to wait!

@rec
Copy link
Owner

rec commented Feb 26, 2021

Released as v1.2.1

@lhh
Copy link
Contributor Author

lhh commented Feb 28, 2021

Thanks! Cheers!

rec added a commit that referenced this pull request Jan 6, 2024
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

2 participants