[GRASS-dev] [GRASS GIS] #2785: pygrass util set_path bug

#2785: pygrass util set_path bug
----------------------+-------------------------
Reporter: krejcmat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: PyGRASS | Version: svn-trunk
Keywords: path | CPU: x86-64
Platform: Linux |
----------------------+-------------------------
Hi,
The current code doesn't count with parameters of the function
"from grass.pygrass.utils import set_path". Diff[1] is below.

thanks
Matej

[1]
Index: lib/python/pygrass/utils.py

--- lib/python/pygrass/utils.py (revision 66629)
+++ lib/python/pygrass/utils.py (working copy)
@@ -313,7 +313,7 @@
      pathlib = os.path.join(path, dirname)
      if os.path.exists(pathlib):
          # we are running the script from the script directory
- sys.path.append(os.path.abspath(path))
+ sys.path.append(os.path.abspath(pathlib))
      else:
          # running from GRASS GIS session
          path = get_lib_path(modulename, dirname)

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------
Changes (by martinl):

* milestone: => 7.0.1

Old description:

Hi,
The current code doesn't count with parameters of the function
"from grass.pygrass.utils import set_path". Diff[1] is below.

thanks
Matej

[1]
Index: lib/python/pygrass/utils.py

--- lib/python/pygrass/utils.py (revision 66629)
+++ lib/python/pygrass/utils.py (working copy)
@@ -313,7 +313,7 @@
     pathlib = os.path.join(path, dirname)
     if os.path.exists(pathlib):
         # we are running the script from the script directory
- sys.path.append(os.path.abspath(path))
+ sys.path.append(os.path.abspath(pathlib))
     else:
         # running from GRASS GIS session
         path = get_lib_path(modulename, dirname)

New description:

Hi,
The current code doesn't count with parameters of the function
"from grass.pygrass.utils import set_path". Diff[1] is below.

thanks
Matej

{{{
[1]
Index: lib/python/pygrass/utils.py

--- lib/python/pygrass/utils.py (revision 66629)
+++ lib/python/pygrass/utils.py (working copy)
@@ -313,7 +313,7 @@
      pathlib = os.path.join(path, dirname)
      if os.path.exists(pathlib):
          # we are running the script from the script directory
- sys.path.append(os.path.abspath(path))
+ sys.path.append(os.path.abspath(pathlib))
      else:
          # running from GRASS GIS session
          path = get_lib_path(modulename, dirname)
}}}

--

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.2
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------
Changes (by martinl):

* milestone: 7.0.1 => 7.0.2

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.2
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------

Comment (by martinl):

Please attach diff as the attachment.

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.2
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------
Description changed by martinl:

Old description:

Hi,
The current code doesn't count with parameters of the function
"from grass.pygrass.utils import set_path". Diff[1] is below.

thanks
Matej

{{{
[1]
Index: lib/python/pygrass/utils.py

--- lib/python/pygrass/utils.py (revision 66629)
+++ lib/python/pygrass/utils.py (working copy)
@@ -313,7 +313,7 @@
     pathlib = os.path.join(path, dirname)
     if os.path.exists(pathlib):
         # we are running the script from the script directory
- sys.path.append(os.path.abspath(path))
+ sys.path.append(os.path.abspath(pathlib))
     else:
         # running from GRASS GIS session
         path = get_lib_path(modulename, dirname)
}}}

New description:

Hi,
The current code doesn't count with parameters of the function
"from grass.pygrass.utils import set_path". Diff is below:

thanks
Matej

{{{
[1]
Index: lib/python/pygrass/utils.py

--- lib/python/pygrass/utils.py (revision 66629)
+++ lib/python/pygrass/utils.py (working copy)
@@ -313,7 +313,7 @@
      pathlib = os.path.join(path, dirname)
      if os.path.exists(pathlib):
          # we are running the script from the script directory
- sys.path.append(os.path.abspath(path))
+ sys.path.append(os.path.abspath(pathlib))
      else:
          # running from GRASS GIS session
          path = get_lib_path(modulename, dirname)
}}}

--

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.2
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------
Changes (by krejcmat):

* Attachment "set_path.diff" added.

diff with fixed bug

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

#2785: pygrass util set_path bug
-----------------------+-------------------------
  Reporter: krejcmat | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.2
Component: PyGRASS | Version: svn-trunk
Resolution: fixed | Keywords: path
       CPU: x86-64 | Platform: Linux
-----------------------+-------------------------
Changes (by martinl):

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

Comment:

Done in r66637, backported to relbr70 as r66638

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