Author bwanamarko
Recipients Arfrever, Piotr.Lopusiewicz, amaury.forgeotdarc, bwanamarko, docs@python, eryksun, loewis, meador.inge, plynch76, r.david.murray, tim.golden
Date 2016-02-16.18:14:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455646442.94.0.571133870345.issue14597@psf.upfronthosting.co.za>
In-reply-to
Content
Snippets of "proprietary" code

`setup.py`
----------
# run clean or build libraries if they don't exist
if 'clean' in sys.argv:
    try:
        os.remove(os.path.join(LIB_DIR, SOLPOSAM_LIB_FILE))
        os.remove(os.path.join(LIB_DIR, SPECTRL2_LIB_FILE))
    except OSError as err:
        sys.stderr.write('%s\n' % err)

`core.py`
---------
    # load the DLL
    solposAM_dll = ctypes.cdll.LoadLibrary(SOLPOSAMDLL)
    _solposAM = solposAM_dll.solposAM

After deleting files, setup.py tries to build, then runs test_cdlls.py a unittest that contains test_solposAM() that calls solposAM() and imports core.py that contains solposAM.

Case 1:
-------
I put the load library calls inside the function solposAM().
Function calls works as expected.
I am able to delete dlls after interpreter exits and restarts using os.remove()

Case 2:
-------
I put the load library calls at the module level.
Function calls works as expected.
If I try to delete dlls after interpreter exits and restarts using os.remove() I get access denied, but I can delete them from windows explorer.
History
Date User Action Args
2016-02-16 18:14:02bwanamarkosetrecipients: + bwanamarko, loewis, amaury.forgeotdarc, tim.golden, Arfrever, r.david.murray, meador.inge, docs@python, plynch76, eryksun, Piotr.Lopusiewicz
2016-02-16 18:14:02bwanamarkosetmessageid: <1455646442.94.0.571133870345.issue14597@psf.upfronthosting.co.za>
2016-02-16 18:14:02bwanamarkolinkissue14597 messages
2016-02-16 18:14:02bwanamarkocreate