Dyalog / Dyalog/pynapl

Installing as administrator and running as regular user raises `PermissionError`.

Open
#13 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
86
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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`:

```py
File "C:\Users\rodri\Documents\Dyalog\pynapl\pynapl\demos\game_of_life\game_of_life.py", line 5, in
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'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in pynapl/RunDyalog.py at dystart, especially the open call for WinPort.dyalog, and review how APL.py and APLPyConnect.py reach it. Reproduce the Windows administrator-installation and regular-user run described in the issue. Done means a regular user can start pynapl after installation without a PermissionError in the protected site-packages directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.