redshift-gtk crashed with SyntaxError in find_cookie(): invalid or missing encoding declaration for '/usr/bin/sys'

Bug #1517754 reported by Anders Kaseorg
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python
Won't Fix
Unknown
pygobject
Fix Released
Medium
redshift (Ubuntu)
New
Medium
Unassigned

Bug Description

‘redshift-gtk’ crashes on startup if the ‘openafs-client’ package (which contains /usr/bin/sys) is also installed.

$ redshift-gtk
Traceback (most recent call last):
  File "/usr/lib/python3.5/tokenize.py", line 392, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 40: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/redshift-gtk", line 26, in <module>
    from redshift_gtk.statusicon import run
  File "/usr/lib/python3/dist-packages/redshift_gtk/statusicon.py", line 32, in <module>
    from gi.repository import Gtk, GLib, GObject
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 115, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 78, in _check_require_version
    PyGIWarning, stacklevel=stacklevel)
  File "/usr/lib/python3.5/warnings.py", line 18, in showwarning
    file.write(formatwarning(message, category, filename, lineno, line))
  File "/usr/lib/python3.5/warnings.py", line 26, in formatwarning
    line = linecache.getline(filename, lineno) if line is None else line
  File "/usr/lib/python3.5/linecache.py", line 16, in getline
    lines = getlines(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 47, in getlines
    return updatecache(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 136, in updatecache
    with tokenize.open(fullname) as fp:
  File "/usr/lib/python3.5/tokenize.py", line 456, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "/usr/lib/python3.5/tokenize.py", line 433, in detect_encoding
    encoding = find_cookie(first)
  File "/usr/lib/python3.5/tokenize.py", line 397, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for '/usr/bin/sys'

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: redshift-gtk 1.10-5ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-19.23-generic 4.2.6
Uname: Linux 4.2.0-19-generic x86_64
NonfreeKernelModules: openafs
ApportVersion: 2.19.2-0ubuntu6
Architecture: amd64
CurrentDesktop: GNOME
Date: Thu Nov 19 02:07:22 2015
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/redshift-gtk
InstallationDate: Installed on 2015-06-02 (169 days ago)
InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Release amd64 (20150422)
InterpreterPath: /usr/bin/python3.5
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/redshift-gtk
PythonArgs: ['/usr/bin/redshift-gtk']
SourcePackage: redshift
Title: redshift-gtk crashed with SyntaxError in find_cookie(): invalid or missing encoding declaration for '/usr/bin/sys'
UpgradeStatus: Upgraded to xenial on 2015-10-28 (21 days ago)
UserGroups: adm bumblebee cdrom dip libvirtd lpadmin plugdev sambashare sbuild sudo wireshark

Revision history for this message
Anders Kaseorg (andersk) wrote :
Revision history for this message
Anders Kaseorg (andersk) wrote :

Redshift upstream bug that Launchpad won’t let me link (because Redshift upstream used to track bugs in Launchpad):

https://github.com/jonls/redshift/issues/271

information type: Private → Public
description: updated
Revision history for this message
Anders Kaseorg (andersk) wrote :
Changed in pygobject:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in python:
status: Unknown → Won't Fix
tags: removed: need-duplicate-check
Changed in redshift (Ubuntu):
importance: Undecided → Medium
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.