GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — function not found with error AttributeError: "'module' has no attribute 'pre_save'" · Issue #224 · go-python/gpython

function not found with error AttributeError: "'module' has no attribute 'pre_save'" #224

New issue
Copy link
New issue
Copy link
Open
Open
function not found with error AttributeError: "'module' has no attribute 'pre_save'"#224
Copy link

Description

@ghost
ghost
opened on Aug 31, 2023

I have the small script below that I try to test:

import sys

def pre_save(value, numb):
	if value == "value":
		return("accepted by Python script " + sys.version)
	else:
		return("refused by Python script" + sys.version)

When I do a py.RunSrc(ctx, pythonCode, "", nil), I get "AttributeError: "'module' has no attribute 'pre_save'""

Activity

  1. sbinet commented on Aug 31, 2023

    @sbinet
    sbinet
    on Aug 31, 2023
    Member
    More actions

    it's (I think) the convolution of a bug and a missing feature.

    the missing feature:

    $> gpython
    Python 3.4.0 (none, unknown)
    [Gpython dev]
    - os/arch: linux/amd64
    - go version: devel go1.21-688d75b14f Wed Jun 7 06:52:47 2023 +0000
    >>> import sys
    >>> sys.version
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: "'module' has no attribute 'version'"
    

    the bug: the error being reported is misleading and doesn't point at the actual culprit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.