Page 1 of 1

[SOLVED] Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: January 29, 2025 - 4:51 PM
by fobrien
Good morning,

I am facing a package that is giving me trouble because it seems to be blocking my other deployments.
Let me explain: I created a package that runs an MSI installer and the installation goes perfectly.

However, I also have an audit function and I notice that in the tasks, it gets stuck indefinitely on the "Updating the list of available packages" status just before executing the audit task for my package:

Code: Select all

def audit():
    if installed_softwares('XLSTAT'):
        return 'OK'
    else:
        return 'ERROR'
The code is correctly indented, but when I test it, even with just PyScripter, I get the following error message when running the audit function:
2025-01-29 16:37:46,468 CRITICAL Audit C:\waptdev\xlstat-2024_26.4.0_x64_Windows\WAPT\..: AttributeError: 'PackageEntry' object has no attribute 'setuppy'
Have you ever seen this type of error?

I had thought it might be an encoding problem, but I am definitely using UTF-8 (checked with another editor such as Notepad++) and my "setup.py" file does have the header "# -*- coding: utf-8 -*-" at the beginning of the file.

Thanks in advance.

Fred

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: January 29, 2025 - 5:12 PM
by sfonteneau
Hello

, this bug was identified in the latest release; it only occurs during installation in development mode (package not yet built).

We are preparing a new release that will fix the issue.

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: January 30, 2025 - 10:16 AM
by fobrien
Hi Simon,

Thanks for your reply.
It's reassuring, as I spent quite a bit of time yesterday running cross-tests because, strangely enough, for some packages, the audit function works perfectly.

I should mention that I've already tried copying and pasting my raw script from Notepad (without formatting), just in case, but that didn't help either.

Do you know when the fix might be released?
Will it simply involve updating PyScripter?

Thanks in advance.

Fred

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: January 30, 2025 - 12:29 PM
by sfonteneau
Hello,

the release came out this morning. You can test it to see if the problem persists (you will need to reinstall the package before testing the audit).

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: January 30, 2025 - 2:28 PM
by fobrien
Simon,

Great, thanks for the feedback.
When we talk about the release, we're referring to the WAPT agent that needs updating on all workstations, right?
Indeed, I forgot to mention that we're still on version 2.5 while we plan an upgrade.

Thanks in advance.

Fred

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: February 14, 2025 - 10:23 AM
by fobrien
Hello,

I finally figured out why my audit wasn't working correctly.
I was using the "sys.exit" command with an error code of 0 if the script should exit without error, or 1 if it should exit with a warning.

Ultimately, exiting with a return "OK" or return "ERROR" in my installation function solved the problem.
The audit function now correctly captures this output and adapts its actions accordingly.

Fred

Re: Audit error message AttributeError: 'PackageEntry' object has no attribute 'setuppy'

Published: February 24, 2025 - 12:40 PM
by dcardon
Hi Frédéric,

thanks for the feedback, :-) I'm marking the topic as resolved.

Denis