Merge lp:~smoser/simplestreams/trunk.python3-make-test-data into lp:simplestreams

Proposed by Scott Moser
Status: Merged
Merged at revision: 459
Proposed branch: lp:~smoser/simplestreams/trunk.python3-make-test-data
Merge into: lp:simplestreams
Diff against target: 36 lines (+5/-5)
1 file modified
tools/make-test-data (+5/-5)
To merge this branch: bzr merge lp:~smoser/simplestreams/trunk.python3-make-test-data
Reviewer Review Type Date Requested Status
Dan Watkins (community) Approve
Server Team CI bot continuous-integration Approve
simplestreams-dev Pending
Review via email: mp+337893@code.launchpad.net

Commit message

Fix make-test-data for python3.

make-test-data had some bytes-versus-strings issues preventing it
from running with python3.

The fixes are here, and now both of these work:
  export SS_SKIP_UNSUPPORTED=1 SS_DEBUG_MIN_SERIAL=20180101 REAL_DATA=1
  ./tools/tenv python ./tools/make-test-data exdata-query/ exdata/data
  ./tools/tenv python3 ./tools/make-test-data exdata-query/ exdata/data3

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Watkins (oddbloke) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/make-test-data'
2--- tools/make-test-data 2018-01-16 17:59:19 +0000
3+++ tools/make-test-data 2018-02-16 19:27:17 +0000
4@@ -108,7 +108,7 @@
5 def save_cache():
6 if FILE_DATA:
7 hashcache = FILE_DATA['filename']
8- with open(hashcache, "w") as hfp:
9+ with open(hashcache, "wb") as hfp:
10 hfp.write(util.dump_data(FILE_DATA))
11
12
13@@ -597,9 +597,9 @@
14
15 outfile = os.path.join(out_d, stream, streamdir, cid + ".json")
16 util.mkdir_p(os.path.dirname(outfile))
17- with open(outfile, "w") as fp:
18+ with open(outfile, "wb") as fp:
19 sys.stderr.write("writing %s\n" % outfile)
20- fp.write(util.dump_data(tree[stream]) + "\n")
21+ fp.write(util.dump_data(tree[stream]) + b"\n")
22
23 # save hashes data
24 save_cache()
25@@ -689,9 +689,9 @@
26
27 outfile = os.path.join(args.out_d, streamname, streamdir, 'index.json')
28 util.mkdir_p(os.path.dirname(outfile))
29- with open(outfile, "w") as fp:
30+ with open(outfile, "wb") as fp:
31 sys.stderr.write("writing %s\n" % outfile)
32- fp.write(util.dump_data(index) + "\n")
33+ fp.write(util.dump_data(index) + b"\n")
34
35 if args.sign:
36 def printstatus(name):

Subscribers

People subscribed via source and target branches

to all changes: