Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing as administrator and running as regular user raises PermissionError. #13

Open
rodrigogiraoserrao opened this issue Oct 20, 2021 · 1 comment
Labels
bug Things not working as they should.

Comments

@rodrigogiraoserrao
Copy link
Contributor

After using setup.py to install pynapl, with administrator permissions, in a Windows 10 system, pynapl is installed in the standard location for Python modules, in a “protected” folder.

Hence, when a regular user tries to start pynapl, it fails, because Python will try to write the WinPort.dyalog file in a protected location.

Here's the traceback we get after a script tries to import pynapl and run the APL function in APL.py:

  File "C:\Users\rodri\Documents\Dyalog\pynapl\pynapl\demos\game_of_life\game_of_life.py", line 5, in <module>
    apl = APL.APL()
  File "C:\Program Files\Python39\lib\site-packages\py_n_apl-0.1.0-py3.9.egg\pynapl\APL.py", line 29, in APL
    return APLPyConnect.Connection.APLClient(DEBUG=debug, dyalog=dyalog, forceTCP=forceTCP)
  File "C:\Program Files\Python39\lib\site-packages\py_n_apl-0.1.0-py3.9.egg\pynapl\APLPyConnect.py", line 437, in APLClient
    if not DEBUG: RunDyalog.dystart(outarg, inarg, dyalog=dyalog)
  File "C:\Program Files\Python39\lib\site-packages\py_n_apl-0.1.0-py3.9.egg\pynapl\RunDyalog.py", line 175, in dystart
    with open(to_bytes(os.path.dirname(SCRIPTFILE))+b'/WinPort.dyalog', "wb") as f:
PermissionError: [Errno 13] Permission denied: b'C:\\Program Files\\Python39\\Lib\\site-packages\\Py_n_APL-0.1.0-py3.9.egg\\pynapl/WinPort.dyalog'
@rodrigogiraoserrao rodrigogiraoserrao added the bug Things not working as they should. label Oct 20, 2021
@rodrigogiraoserrao
Copy link
Contributor Author

The original code comments that using the auxiliary WinPort.dyalog file ”is dumb, but works, but is still dumb”.

Either try to write the WinPort.dyalog file in a location appropriate for temp files, or try to remove this “hack” altogether (no idea how!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things not working as they should.
Projects
None yet
Development

No branches or pull requests

1 participant