/usr/share/weechat/python/queue.py shadows stdlib module, cannot be imported

Bug #1903354 reported by Marius Gedminas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
weechat-scripts (Ubuntu)
New
Undecided
Unassigned

Bug Description

There was a bug in a weechat script in my ~/.weechat/python/autoload, which triggered apport's exception hook. The apport hook failed with

Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
    import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
  File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/lib/python3/dist-packages/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 28, in <module>
    from six.moves import queue
  File "<frozen importlib._bootstrap>", line 1039, in _handle_fromlist
  File "/usr/lib/python3/dist-packages/six.py", line 92, in __get__
    result = self._resolve()
  File "/usr/lib/python3/dist-packages/six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "/usr/lib/python3/dist-packages/six.py", line 82, in _import_module
    __import__(name)
  File "/usr/share/weechat/python/queue.py", line 277
    if args == "":
                 ^
TabError: inconsistent use of tabs and spaces in indentation

which highligts two problems:

- the 'queue' weechat script is in sys.path and shadows a standard library module
- it is using mixed tabs and spaces for indentation, which is forbidden in Python 3

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: weechat-scripts (not installed)
ProcVersionSignature: Ubuntu 5.8.0-26.27-generic 5.8.14
Uname: Linux 5.8.0-26-generic x86_64
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Fri Nov 6 22:18:39 2020
EcryptfsInUse: Yes
InstallationDate: Installed on 2019-06-12 (512 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
SourcePackage: weechat-scripts
UpgradeStatus: Upgraded to groovy on 2020-10-23 (14 days ago)

Revision history for this message
Marius Gedminas (mgedmin) wrote :
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.