python syntax errors in __init__.py,core.py,temporal_algebra.py

Bug #1875994 reported by Chris Hermansen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grass (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installing QGIS 3.12.2 using apt after an upgrade from 19.10 to 20.04 I receive the following messages re package grass-core:

Setting up grass-core (7.8.2-1build3) ...
/usr/lib/grass78/etc/python/grass/pygrass/gis/__init__.py:75: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if value is '':
/usr/lib/grass78/etc/python/grass/temporal/core.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if do_profiling is "True" or do_profiling is "1":
/usr/lib/grass78/etc/python/grass/temporal/core.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if do_profiling is "True" or do_profiling is "1":
/usr/lib/grass78/etc/python/grass/temporal/core.py:582: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if driver_string is not None and driver_string is not "":
/usr/lib/grass78/etc/python/grass/temporal/temporal_algebra.py:2295: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if map_i.get_type() is "raster" or map_i.get_type() is "raster3d":
/usr/lib/grass78/etc/python/grass/temporal/temporal_algebra.py:2295: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if map_i.get_type() is "raster" or map_i.get_type() is "raster3d":

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: grass-core 7.8.2-1build3
ProcVersionSignature: Ubuntu 5.4.0-28.32-generic 5.4.30
Uname: Linux 5.4.0-28-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 29 15:41:54 2020
InstallationDate: Installed on 2019-04-24 (371 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
SourcePackage: grass
UpgradeStatus: Upgraded to focal on 2020-04-28 (1 days ago)

Revision history for this message
Chris Hermansen (c-hermansen) wrote :
Revision history for this message
Markus Neteler (neteler) wrote :

I believe that this has been addressed in

https://github.com/OSGeo/grass/pull/540

(not yet backported from master to 7.8 release branch)

Revision history for this message
Chris Hermansen (c-hermansen) wrote :

I looked at description of fixes at

https://github.com/OSGeo/grass/pull/540

and I don't see anything referring to the warnings.

However, looking at the first warning .../__init__.py:75, on my computer, the offending line is

    if value is '':

whereas the version on GitHub is

    if value == '':

which I suppose would correct the warning, and surely must be the intended code.

So let's hope the backport arrives soon!

Revision history for this message
Markus Neteler (neteler) wrote :

As per https://github.com/OSGeo/grass/pull/540#issuecomment-622991997:

The issues are fixed in master and backported to 7.8: https://github.com/OSGeo/grass/pull/264

It will be part of GRASS GIS 7.8.3, to be released in the next days.

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.