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 ensuredir() in case of pre-existing file #5548

Merged
merged 1 commit into from Oct 28, 2018

Conversation

jdemeyer
Copy link
Contributor

Subject: sphinx.util.osutil.ensuredir() should give an error when an ordinary file (not directory) exists with the given name.

Feature or Bugfix

  • Bugfix

Purpose

I'm currently in the process of debugging an issue with SageMath when upgrading from Sphinx 1.7 to Sphinx 1.8. I get a warning [Errno 20] Not a directory while copying static files due to #5541 which causes the static "directory" to be an ordinary file. This should be detected earlier by ensuredir().

The current pull request also changes the philosophy of the test: we don't care about the process (why did it fail?) but we care about the result (we want a directory with the given name). By not using errno, it is very likely also more portable, which is an additional advantage.

@codecov
Copy link

codecov bot commented Oct 17, 2018

Codecov Report

Merging #5548 into 1.8 will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##              1.8    #5548   +/-   ##
=======================================
  Coverage   82.06%   82.06%           
=======================================
  Files         306      306           
  Lines       40366    40366           
  Branches     6238     6238           
=======================================
  Hits        33127    33127           
  Misses       5856     5856           
  Partials     1383     1383
Impacted Files Coverage Δ
sphinx/util/osutil.py 70.49% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c584b71...a7d950a. Read the comment docs.

@tk0miya tk0miya merged commit 270c484 into sphinx-doc:1.8 Oct 28, 2018
@tk0miya
Copy link
Member

tk0miya commented Oct 28, 2018

Merged. Thank you for your contribution!

tk0miya added a commit that referenced this pull request Oct 28, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants