[Bug 1740026] Re: ubiquity crashed with UnicodeDecodeError in decode(): 'utf-8' codec can't decode byte 0x91 in position 269: invalid start byte

Michal J 1740026 at bugs.launchpad.net
Thu Nov 7 18:17:10 UTC 2019


Digging a little deeper, specifically in /usr/lib/ubiquity/plugins/ubi-
prepare.py, in the method setup_sufficient_space() there is a call to a
subprocess, that subprocess being parted_devices. Running parted_devices
on your own in terminal with this device will report the above "HBG4a"
and unicode character, but since this is not UTF8 I think the python
script will fail since the default stance on errors is to fail with an
error code, UnicodeDecodeError(). To bypass this, I modified that call
to be as such:

proc = subprocess.Popen(['parted_devices'], stdout=subprocss.PIPE,
encoding='iso-8859-1', universal_newlines=True)

This allows it to at least get passed this reported error. But
subsequently, it will fail on ubi-partman.py with error code 141
(unknown what it means), and will not enter the partition manager in
ubiquity (skips it entirely).

The problem seems that this unicode naming keeps coming back to haunt
the python scripts as it attempts to run the partition manager. Ideally,
it would be great to remove this unicode in the name entirely since I
don't think it will affect the partitioning in any way (I even looked
into where the hardware reports this from and if it can be manually
changed, but so far no dice). Otherwise, I'm stuck with hunting through
all the scripts that do these calls and reads from the name and patch
them to work with the iso-8859-1 encoding.

Onward.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubiquity in Ubuntu.
https://bugs.launchpad.net/bugs/1740026

Title:
  ubiquity crashed with UnicodeDecodeError in decode(): 'utf-8' codec
  can't decode byte 0x91 in position 269: invalid start byte

Status in ubiquity package in Ubuntu:
  Expired

Bug description:
  Trying to install

  ProblemType: Crash
  DistroRelease: Ubuntu 17.10
  Package: ubiquity 17.10.10
  ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  ApportVersion: 2.20.7-0ubuntu3
  Architecture: amd64
  CasperVersion: 1.387
  Date: Mon Dec 25 13:19:57 2017
  ExecutablePath: /usr/lib/ubiquity/bin/ubiquity
  InterpreterPath: /usr/bin/python3.6
  LiveMediaBuild: Lubuntu 17.10 "Artful Aardvark" - Release amd64 (20171017.1)
  ProcCmdline: /usr/bin/python3 /usr/lib/ubiquity/bin/ubiquity gtk_ui
  ProcEnviron:
   TERM=unknown
   PATH=(custom, no user)
   LANG=C.UTF-8
   SHELL=/bin/bash
  Python3Details: /usr/bin/python3.6, Python 3.6.3, python3-minimal, 3.6.3-0ubuntu2
  PythonArgs: ['/usr/lib/ubiquity/bin/ubiquity', 'gtk_ui']
  PythonDetails: /root/Error: command ['which', 'python'] failed with exit code 1:, Error: [Errno 2] No such file or directory: "/root/Error: command ['which', 'python'] failed with exit code 1:": "/root/Error: command ['which', 'python'] failed with exit code 1:", unpackaged
  SourcePackage: ubiquity
  Title: ubiquity crashed with UnicodeDecodeError in decode(): 'utf-8' codec can't decode byte 0x91 in position 269: invalid start byte
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups:

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1740026/+subscriptions



More information about the foundations-bugs mailing list