Merge ~cjwatson/launchpad:fix-apidoc-index-generation into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 385cbc07a3221da857263532422071208550496b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-apidoc-index-generation
Merge into: launchpad:master
Diff against target: 15 lines (+2/-2)
1 file modified
utilities/create-lp-wadl-and-apidoc.py (+2/-2)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+429699@code.launchpad.net

Commit message

Fix unclosed file while writing the apidoc index

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/utilities/create-lp-wadl-and-apidoc.py b/utilities/create-lp-wadl-and-apidoc.py
2index 9bd13d8..216db32 100755
3--- a/utilities/create-lp-wadl-and-apidoc.py
4+++ b/utilities/create-lp-wadl-and-apidoc.py
5@@ -133,8 +133,8 @@ def main(directory, force=False):
6 template = PageTemplateFile(template_file)
7 index_filename = os.path.join(directory, "index.html")
8 print("Writing index:", index_filename)
9- f = open(index_filename, "w")
10- f.write(template(config=config))
11+ with open(index_filename, "w") as f:
12+ f.write(template(config=config))
13
14 # Get the time of the last commit. We will use this as the mtime for the
15 # generated files so that we can safely use it as part of Apache's etag

Subscribers

People subscribed via source and target branches

to status/vote changes: