Skip to content

Issue accessing globals() from library #136

Closed

Description

@ehrenfeu

Unfortunately the save_script_parameters() function introduced in #111 doesn't work as intended as the globals() call returns the dictionary of the current module. Inside a function, this is the module where it is defined, not the module from which it is called as described in the built-in functions API docs for Python 2.7.

Long story short, this call is getting the global symbol table of the imcflibs namespace instead of the one from the caller (which is what we'd need for the org.scijava.script.ScriptModule part:

module = globals().get("org.scijava.script.ScriptModule")

After discussing with @rohangirishrao we decided to remove the function from current devel in order to not have it block the next release and see what "the best solution"™️ could look like in a new branch.

Activity

  1. added theissue type on Jan 23, 2026
  2. moved this to In progress in IMCF-Fijion Jan 23, 2026
  3. ehrenfeu commented on Jan 23, 2026

    @ehrenfeu
    MemberAuthor

    @rohangirishrao you can fork the newly created branch and continue working on it there: https://github.com/imcf/python-imcflibs/tree/save-script-params

  4. rohangirishrao commented on Mar 25, 2026

    @rohangirishrao
    Contributor

    PR #140 made with a workaround, pass globals() directly to the method

  5. moved this from In progress to Done in IMCF-Fijion Mar 25, 2026
  6. added a commit that references this issue on Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingnext-coding-sessionLook into during the next CS.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions