SyntaxWarning when importing tabulate using python3.8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-tabulate (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The python3-tabulate package raises a SyntaxWarning when imported using python3.8.
To work around this I use the following code for an internal CLI application:
import warnings
with warnings.
# Ignore the following warning when importing the tabulate package:
# /usr/lib/
# if isinstance(val, (_text_type, _binary_type)) and val.strip() is "":
from tabulate import tabulate
$ lsb_release -rd
Description: Ubuntu 18.04.5 LTS
Release: 18.04
$ sudo apt install python3-tabulate
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
python3-tabulate
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 28,9 kB of archives.
After this operation, 127 kB of additional disk space will be used.
Get:1 http://
Fetched 28,9 kB in 0s (90,5 kB/s)
Selecting previously unselected package python3-tabulate.
(Reading database ... 314447 files and directories currently installed.)
Preparing to unpack .../python3-
Unpacking python3-tabulate (0.7.7-1) ...
Setting up python3-tabulate (0.7.7-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
$python3.8
Python 3.8.7 (default, Dec 21 2020, 20:10:35)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tabulate
/usr/lib/
if isinstance(val, (_text_type, _binary_type)) and val.strip() is "":
>>>
$ which python3.8
/usr/bin/python3.8
$ dpkg --list|grep python3.8
ii libpython3.8:amd64 3.8.7-1+bionic1 amd64 Shared Python runtime library (version 3.8)
ii libpython3.
ii libpython3.
ii libpython3.
ii python3.8 3.8.7-1+bionic1 amd64 Interactive high-level object-oriented language (version 3.8)
ii python3.8-dev 3.8.7-1+bionic1 amd64 Header files and a static library for Python (v3.8)
ii python3.8-minimal 3.8.7-1+bionic1 amd64 Minimal subset of the Python language (version 3.8)
ii python3.8-venv 3.8.7-1+bionic1 amd64 Interactive high-level object-oriented language (pyvenv binary, version 3.8)
Status changed to 'Confirmed' because the bug affects multiple users.