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

Deleting files does not work on Windows #56

Closed
winogradoff opened this issue Apr 8, 2015 · 9 comments
Closed

Deleting files does not work on Windows #56

winogradoff opened this issue Apr 8, 2015 · 9 comments

Comments

@winogradoff
Copy link

Deleting files does not work on Windows.
Because you're using linux command "rm'.
It is better to use os.remove:
https://docs.python.org/2/library/os.html#os.remove

@jrast
Copy link

jrast commented Apr 10, 2015

I've changed the file deletion in generate_pdf() to this:

    if clean:
        for ext in ['.aux', '.log', '.out', '.tex']:
            try:
                os.remove(filename + ext)
            except:
                pass

which works great on windows. The exception handling should be done better (Log? Or Print?), but for a quick fix this is enough.

@JelteF
Copy link
Owner

JelteF commented Apr 12, 2015

Looks good, I don't think the exception should be a bit more specific. I'm not sure what error is raised when the file is not there, possibly IOerror or something, that way an unexpected exception is still recognized. But the handling itself is good, when the file is not there it also doesn't have to be removed.
If you can make a pull request I will merge it.

One more question, does the compiling really work on linux. Since the code uses the pdflatex command, or do you supply a different command for windows?

@winogradoff
Copy link
Author

There is a whole latex for windows including pdflatex:
http://miktex.org/download

@JelteF
Copy link
Owner

JelteF commented Apr 12, 2015

It should be fixed by by af96fc00
Could one of you confirm that it now works on Windows?

@JelteF
Copy link
Owner

JelteF commented Apr 12, 2015

Oh, it seems I'm using a python 3 specific error. I will fix that, but for now could you guys check if it works with Python 3?

@winogradoff
Copy link
Author

af96fc00
I can confirm it works.
(Windows 8.1, Pyhton 3.4.1)

@JelteF
Copy link
Owner

JelteF commented Apr 13, 2015

Great, then I will close the issue. Btw I have made a workaround for the error, so Python 2 should work again as well.

@jrast
Copy link

jrast commented Apr 23, 2015

Can this issue be reopened? This bug exists again, see the comment I made for commit f6ffaa4

@JelteF JelteF reopened this Apr 24, 2015
@JelteF
Copy link
Owner

JelteF commented Apr 24, 2015

I missed those when merging. It should be fixed now.

@JelteF JelteF closed this as completed May 1, 2015
This issue was closed.
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

No branches or pull requests

3 participants