wrap-and-sort crashed with TypeError in save(): must be str, not bytes

Bug #1099589 reported by Robert Bruce Park
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devscripts (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

wrap-and-sort crashed, leaving my debian/control file empty.

ProblemType: Crash
DistroRelease: Ubuntu 13.04
Package: devscripts 2.12.6ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-0.3-generic 3.8.0-rc3
Uname: Linux 3.8.0-0-generic x86_64
ApportVersion: 2.8-0ubuntu1
Architecture: amd64
Date: Mon Jan 14 13:54:44 2013
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/wrap-and-sort
InstallationDate: Installed on 2012-09-14 (121 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120905.2)
InterpreterPath: /usr/bin/python3.3
MarkForUpload: True
ProcCmdline: /usr/bin/python3 /usr/bin/wrap-and-sort
ProcEnviron:
 TERM=xterm
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_CA.utf8
 XDG_RUNTIME_DIR=<set>
PythonArgs: ['/usr/bin/wrap-and-sort']
SourcePackage: devscripts
Title: wrap-and-sort crashed with TypeError in save(): must be str, not bytes
UpgradeStatus: Upgraded to raring on 2012-11-14 (60 days ago)
UserGroups: adm cdrom debian-tor dip lpadmin plugdev sambashare sudo

Related branches

Revision history for this message
Robert Bruce Park (robru) wrote :
tags: removed: need-duplicate-check
Changed in devscripts (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
Revision history for this message
Robert Bruce Park (robru) wrote :

This bug is not a duplicate of that other one; I am still experiencing this even with devscripts 2.12.6ubuntu2 installed.

Steps to reproduce:

1. Go into any directory containing a debian/ subdirectory,

2. type 'wrap-and-sort'

3. Observe the following traceback:

$ wrap-and-sort
Traceback (most recent call last):
  File "/usr/bin/wrap-and-sort", line 227, in <module>
    main()
  File "/usr/bin/wrap-and-sort", line 224, in main
    wrap_and_sort(options)
  File "/usr/bin/wrap-and-sort", line 146, in wrap_and_sort
    control.save()
  File "/usr/lib/python3/dist-packages/devscripts/control.py", line 70, in save
    control_file.write(content.encode("utf-8"))
TypeError: must be str, not bytes

4. Notice that debian/control has become zero-length.

Revision history for this message
Benjamin Drung (bdrung) wrote :

This looks like a fallout of the Python 3 porting.

Changed in devscripts (Ubuntu):
status: New → Confirmed
importance: Medium → Critical
Changed in devscripts (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package devscripts - 2.12.6ubuntu3

---------------
devscripts (2.12.6ubuntu3) raring; urgency=low

  * Open control file as bytes and write out encoded utf-8. (LP: #1099589).
 -- Dmitrijs Ledkovs <email address hidden> Wed, 23 Jan 2013 13:04:20 +0000

Changed in devscripts (Ubuntu):
status: Fix Committed → Fix Released
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.