lp-project-upload TypeError in edit_file

Bug #1923326 reported by James Falcon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lptools
New
Undecided
Unassigned

Bug Description

Running lp-project-upload without a changelog or releasenotes gives:

Traceback (most recent call last):
  File "/usr/bin/lp-project-upload", line 175, in <module>
    main()
  File "/usr/bin/lp-project-upload", line 150, in main
    changelog = edit_file('changelog', 'changelog')
  File "/usr/bin/lp-project-upload", line 73, in edit_file
    os.write(fd, '\n\n#------\n# Please enter the %s here. '
TypeError: a bytes-like object is required, not 'str'

Fixed it with:
72,77c72,77
< (fd, f) = tempfile.mkstemp(prefix=prefix+'.')
< os.write(fd, '\n\n#------\n# Please enter the %s here. '
< 'Lines which start with "#" are ignored.\n' % description)
< os.close(fd)
< subprocess.call(['sensible-editor', f])
< return cat_file(f)
---
> (fd, path) = tempfile.mkstemp(prefix=prefix+'.')
> with os.fdopen(fd, 'w') as f:
> f.write('\n\n#------\n# Please enter the %s here. '
> 'Lines which start with "#" are ignored.\n' % description)
> subprocess.call(['sensible-editor', path])
> return cat_file(path)

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This should be fixed in lp:~jelmer/lptools/breezy-python3/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.