Public bug reported:

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.catch_warnings():
        # Ignore the following warning when importing the tabulate package:
        #     /usr/lib/python3/dist-packages/tabulate.py:196: SyntaxWarning: 
"is" with a literal. Did you mean "=="?
        #     if isinstance(val, (_text_type, _binary_type)) and val.strip() is 
"":
        warnings.simplefilter("ignore")
        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://se.archive.ubuntu.com/ubuntu bionic/universe amd64 
python3-tabulate all 0.7.7-1 [28,9 kB]
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-tabulate_0.7.7-1_all.deb ...
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/python3/dist-packages/tabulate.py:196: SyntaxWarning: "is" with a 
literal. Did you mean "=="?
  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.8-dev:amd64                                3.8.7-1+bionic1       
                           amd64        Header files and a static library for 
Python (v3.8)
ii  libpython3.8-minimal:amd64                            3.8.7-1+bionic1       
                           amd64        Minimal subset of the Python language 
(version 3.8)
ii  libpython3.8-stdlib:amd64                             3.8.7-1+bionic1       
                           amd64        Interactive high-level object-oriented 
language (standard library, version 3.8)
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)

** Affects: python-tabulate (Ubuntu)
     Importance: Undecided
         Status: New

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

Title:
  SyntaxWarning when importing tabulate using python3.8

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-tabulate/+bug/1911002/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to