xrandr-tool depends on py3, not py2

Bug #1206060 reported by Christian González
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
xdiagnose (Ubuntu)
Fix Released
High
Canonical Desktop Team

Bug Description

Using Ubuntu 13.04, type "xrandr-tool outputs" and watch it crash with the following message:

 Traceback (most recent call last):
   File "./xrandr-tool", line 82, in <module>
     for line in str(xrandr_stdout, encoding='utf8').split("\n"):
 TypeError: str() takes at most 1 argument (2 given)

in /usr/bin/xrandr-tool, line 82, the str() builtin does not accept a second argument. So, this is wrong.
Side question: why not port it to Python3 ASAP?

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: xdiagnose 3.5.1
ProcVersionSignature: Ubuntu 3.8.0-26.38-generic 3.8.13.2
Uname: Linux 3.8.0-26-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: amd64
Date: Mon Jul 29 11:20:04 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-06-30 (28 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: xdiagnose
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Christian González (droetker) wrote :
Revision history for this message
Christian González (droetker) wrote :

Just for testing purposes: removing the ", encoding='utf-8'" part makes it work.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xdiagnose (Ubuntu):
status: New → Confirmed
Revision history for this message
Chad Miller (cmiller) wrote :

It is written for python3, but asks to run python2. The str() interface changed from 2 to 3.

$ python3 `which xrandr-tool` outputs
DVI-I-1
DVI-D-1
DVI-D-2

$ python `which xrandr-tool` outputs
Traceback (most recent call last):
  File "/usr/bin/xrandr-tool", line 82, in <module>
    for line in str(xrandr_stdout, encoding='utf8').split("\n"):
TypeError: str() takes at most 1 argument (2 given)

$ head -1 `which xrandr-tool`
#! /usr/bin/python

$ dpkg -s xdiagnose
...
Depends: sysv-rc (>= 2.88dsf-24) | file-rc (>= 0.8.16), python3:any (>= 3.3.2-2~), python, python3-gi (>= 3.2.0-3), gir1.2-gtk-3.0, python3-apport, librsvg2-2, librsvg2-common, policykit-1

summary: - xrandr-tool crashes when providing one argument
+ xrandr-tool crashes in decoding xrandr output
summary: - xrandr-tool crashes in decoding xrandr output
+ xrandr-tool depends on py3, not py2
Changed in xdiagnose (Ubuntu):
importance: Undecided → High
tags: added: trusty
Changed in xdiagnose (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Revision history for this message
Bryan Quigley (bryanquigley) wrote :

This was fixed at least in 16.04.

Changed in xdiagnose (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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