Patchwork D9401: pyoxidizer: make sure defaultrc directory exists before trying to write to it

login
register
mail settings
Submitter phabricator
Date Nov. 25, 2020, 4:08 p.m.
Message ID <differential-rev-PHID-DREV-ifdkgmjdxrvoh7yt2rz7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47680/
State Superseded
Headers show

Comments

phabricator - Nov. 25, 2020, 4:08 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When doing some work involving one-file binaries, this line is failing
  for me. It seems reasonable to just make sure the destination
  directory exists before splatting the file into it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9401

AFFECTED FILES
  contrib/packaging/hgpackaging/pyoxidizer.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/contrib/packaging/hgpackaging/pyoxidizer.py b/contrib/packaging/hgpackaging/pyoxidizer.py
--- a/contrib/packaging/hgpackaging/pyoxidizer.py
+++ b/contrib/packaging/hgpackaging/pyoxidizer.py
@@ -127,6 +127,7 @@ 
 
         # Write out a default editor.rc file to configure notepad as the
         # default editor.
+        os.makedirs(out_dir / "defaultrc")
         with (out_dir / "defaultrc" / "editor.rc").open(
             "w", encoding="utf-8"
         ) as fh: