Merge pull request #17360 from openshift-cherrypick-robot/cherry-pick-17331-to-v4.4

[v4.4] make hack/markdown-preprocess parallel-safe
This commit is contained in:
OpenShift Merge Robot 2023-02-06 10:48:40 +01:00 committed by GitHub
commit 56856b0163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,7 @@ class Preprocessor():
cross-referencing all the man pages in which they're used.
"""
for optionfile in self.used_by:
tmpfile = optionfile + '.tmp'
tmpfile = optionfile + '.tmp.' + str(os.getpid())
with open(optionfile, 'r', encoding='utf-8') as fh_in, open(tmpfile, 'w', encoding='utf-8', newline='\n') as fh_out:
fh_out.write("####> This option file is used in:\n")
used_by = ', '.join(x for x in self.used_by[optionfile])