[GRASS-dev] [GRASS GIS] #4011: Python 3.8 SyntaxWarnings

#4011: Python 3.8 SyntaxWarnings
--------------------+-------------------------
Reporter: hcho | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: All |
--------------------+-------------------------
I'm on Python 3.8 on Windows. Looks like this syntax warning is new for
3.8: {{{"is" with a literal. Did you mean "=="?}}}. Also, there seems to
be no {{{time.clock}}} anymore.

{{{
Starting GRASS GIS...
D:\opt\grass\gui\wxpython\gui_core\gselect.py:1868: SyntaxWarning: "is"
with a l
iteral. Did you mean "=="?
   self.changingSizer.Show(self.dbPanel, show=(sourceType is 'db'))
WARNING: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...

           __________ ___ __________ _______________
          / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/
         / / __/ /_/ / /| | \__ \\_ \ / / __ / / \__ \
        / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /
        \____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS GIS 7.9.dev (a97655792)
GRASS GIS homepage: https://grass.osgeo.org
This version running through: Command Prompt
(C:\Windows\system32\cmd
.exe)
Help is available with the command: g.manual -i
See the licence terms with: g.version -c
See citation options with: g.version -x
If required, restart the GUI with: g.gui wxpython
When ready to quit enter: exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
Clink v0.4.9 [git:2fd2c2] Copyright (c) 2012-2016 Martin Ridgers
http://mridgers.github.io/clink

D:\grassdata>D:\opt\grass\gui\wxpython\core\gconsole.py:600:
SyntaxWarning: "is"
  with a literal. Did you mean "=="?
   if line[0] is '#' and line[1] is '%':
D:\opt\grass\gui\wxpython\core\gconsole.py:600: SyntaxWarning: "is" with a
liter
al. Did you mean "=="?
   if line[0] is '#' and line[1] is '%':
Traceback (most recent call last):
   File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
     self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
   File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
     self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
   File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
     self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
   File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
     self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'

D:\grassdata>
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011&gt;
GRASS GIS <https://grass.osgeo.org>

#4011: Python 3.8 SyntaxWarnings
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by neteler):

AFAIK this is addressed in https://github.com/OSGeo/grass/pull/244

Could you pls test it and leave feedback in the PR?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#4011: Python 3.8 SyntaxWarnings
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by hcho):

Yes, the {{{time.clock}}} error is gone, but not {{{is with a literal}}}.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#4011: Python 3.8 SyntaxWarnings
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by hcho):

Just created a new PR for this: https://github.com/OSGeo/grass/pull/264

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#4011: Python 3.8 SyntaxWarnings
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by neteler):

Seems to be all fixed and backported to relbranch78?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#4011: Python 3.8 SyntaxWarnings
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by hcho):

* status: new => closed
* resolution: => fixed

Comment:

Yes, closing the ticket.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/4011#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>