[GRASS-git] [OSGeo/grass] d58e02: grass.pygrass: Fix Ilist.extend and Ilist.remove a...

Bhuvan Somisetty noreply at github.com
Wed Oct 7 10:18:06 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: d58e02b86b102fa7ed94f0024585de5c4f8e5461
      https://github.com/OSGeo/grass/commit/d58e02b86b102fa7ed94f0024585de5c4f8e5461
  Author: Bhuvan Somisetty <somisettybhuvan5 at gmail.com>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M python/grass/pygrass/vector/basic.py
    A python/grass/pygrass/vector/tests/test_basic.py

  Log Message:
  -----------
  grass.pygrass: Fix Ilist.extend and Ilist.remove accessing non-existent attribute (#7977)

grass.pygrass: Fix Ilist attribute access, indexing, and append issues

In `python/grass/pygrass/vector/basic.py`, `Ilist.extend()` and `Ilist.remove()`
incorrectly attempted to access `ilist.ilist` and `value.ilist`, which do not
exist on `Ilist` instances (the C pointer is stored in `c_ilist`), resulting
in an `AttributeError`.

Additionally:
- `Ilist.append()` previously used a bare `raise` when `Vect_list_append()` failed;
  raise `GrassError` from `grass.pygrass.errors` and coerce `value` with `int()`.
- `Ilist.__getitem__()` negative index calculation allowed negative out-of-bounds
  lookups without raising `IndexError`.
- `Ilist.__contains__()` now delegates directly to `contains()` using the C routine.
- Add comprehensive pytest unit tests in `python/grass/pygrass/vector/tests/test_basic.py`.

Fixes #7976.

Signed-off-by: bhuvan-somisetty <somisettybhuvan5 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list