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

Temporary pickle files not deleted after failed build (was "Fails to build html") #958

Closed
shimizukawa opened this issue Jan 3, 2015 · 6 comments

Comments

@shimizukawa
Copy link
Member

looking for now-outdated files... none found
pickling environment...
Exception occurred:
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\util\osutil.
py", line 104, in movefile
    os.rename(source, dest)
WindowsError: [Error 183] Eine Datei kann nicht erstellt werden, wenn sie bereit
s vorhanden ist
The full traceback has been saved in c:\users\gi23qic\appdata\local\temp\sphinx-
err-9roegf.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message c
an be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-d
ev/>,
or report them in the tracker at <https://bitbucket.org/birkenfeld/sphinx/issues/
>. Thanks!

Z:\web-jw>


# Sphinx version: 1.1.3
# Python version: 2.7.1
# Docutils version: 0.9 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\cmdline.py", line 189, in main
    app.build(force_all, filenames)
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\application.py", line 204, in build
    self.builder.build_update()
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\builders\__init__.py", line 196, in build_update
    'out of date' &#37; len(to_build))
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\builders\__init__.py", line 238, in build
    self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME))
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\environment.py", line 306, in topickle
    movefile(filename + '.tmp', filename)
  File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\util\osutil.py", line 104, in movefile
    os.rename(source, dest)
WindowsError: [Error 183] Eine Datei kann nicht erstellt werden, wenn sie bereits vorhanden ist

@shimizukawa
Copy link
Member Author

From Jon Waltman on 2012-12-05 19:17:32+00:00

ERROR_ALREADY_EXISTS
    183 (0xB7)
    Cannot create a file when that file already exists.

Temporary pickle files are not removed in environment.topickle if there is an error while pickling the environment or a doctree.

The paths of the temporary files are the same between builds.

@shimizukawa
Copy link
Member Author

From Georg Brandl on 2012-12-31 08:44:28+00:00

I'm not sure why this happens: osutil.movefile() explicitly tries to remove the file if it exists.

Maybe the pickle file is still open somewhere and therefore can't be removed?

@shimizukawa
Copy link
Member Author

From Jon Waltman on 2013-01-03 04:29:42+00:00

Maybe the pickle file is still open somewhere and therefore can't be removed?

Yes, I think this is whats going on here. osutil.movefile()
fails to delete the destination file and then calls os.rename()
on an existing file.

While we're looking at this, I have a question about the practice
of dumping the environment to a temporary pickle file in order
to preserve the original environment pickle file in case of an
error.

Wouldn't it be better to just overwrite the original? An error
while dumping the environment would seem to suggest the
environment is not in a stable state and a fresh build would be
preferable instead of using the old environment.

@shimizukawa
Copy link
Member Author

From Jon Waltman on 2013-01-03 06:33:57+00:00

While we're talking about pickling, what do you think about about forcing a fresh build any time after sphinx crashes? This could help gloss over problems that seem to disappear after running make clean.

@shimizukawa
Copy link
Member Author

From Georg Brandl on 2013-01-03 07:44:25+00:00

An error while dumping the environment would seem to suggest the environment is not in a stable state and a fresh build would be preferable instead of using the old environment.

That is a valid argument.

Forcing a fresh build after a crash also sounds like a good idea.

@shimizukawa
Copy link
Member Author

From Jon Waltman on 2013-01-03 22:16:10+00:00

Closes #958: Do not preserve environment.pickle after a failed build.

→ <>

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant