Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
401 views
in Technique[技术] by (71.8m points)

python - Access denied using Py2exe

I'm using Py2exe to create an executable as a windows service.

When I run the script I get this error:

File "C:TeamCityuildAgentwork582d895bd5b431acwinpythonWinPython-32bit-2.7.3.3python-2.7.3libsite-packagespy2exeuild_exe.py", line 860, in build_executable add_resource(ensure_unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, True) RuntimeError: EndUpdateResource: Access is denied.

This is the call to py2exe:

    setup(
    name = NAME,
    description = DESCRIPTION,
    version = '1.0.133.43',
    service = [{'modules':["ServiceLauncher"], 'cmdline':'pywin32'}],
    zipfile=None,
    options = {
        "py2exe":{"packages":"encodings",
                  "includes":"win32com,win32service,win32serviceutil,win32event",
                  "excludes":"libiomp5md.dll"
        },
        },
    )

The problem occurs only on the build machine, it runs fine on my dev pc.

I've tried to set Full Control to everyone on the work folder, but it doesn't work.

Any idea?

Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After two days investigating we found a solution with the help of the IT staff.

The issue arise when py2exe try to modify the executable adding metadata andor icon.

The root cause? Simple... ANTIVIRUS.

It considers that operation a threat and cause the Access Denied error.

Thank you all!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...