osc-staging,issue-diff: open temporary file in write without binary mode.
Otherwise, all write calls complain about passing a string instead of binary data. Given the yaml dump and subsequent comments are all strings it makes more sense to change file mode.
This commit is contained in:
parent
40a88ace51
commit
5b91d6bc84
@ -117,7 +117,7 @@ def prompt_continue(change_count):
|
||||
return prompt_continue(change_count)
|
||||
|
||||
def prompt_interactive(changes, project, package):
|
||||
with tempfile.NamedTemporaryFile(suffix='.yml') as temp:
|
||||
with tempfile.NamedTemporaryFile(mode='w', suffix='.yml') as temp:
|
||||
temp.write(yaml.safe_dump(changes, default_flow_style=False, default_style="'") + '\n')
|
||||
temp.write('# {}/{}\n'.format(project, package))
|
||||
temp.write('# comment or remove lines to whitelist issues')
|
||||
|
@ -593,7 +593,7 @@ def do_staging(self, subcmd, opts, *args):
|
||||
return
|
||||
|
||||
if opts.interactive:
|
||||
with tempfile.NamedTemporaryFile(suffix='.yml') as temp:
|
||||
with tempfile.NamedTemporaryFile(mode='w', suffix='.yml') as temp:
|
||||
temp.write(yaml.safe_dump(splitter.proposal, default_flow_style=False) + '\n\n')
|
||||
|
||||
if len(splitter.requests):
|
||||
|
Loading…
x
Reference in New Issue
Block a user