compas-dev / compas-dev/compas

Loading remote files fails on mac

Open
#996 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
386
Forks
122
Avg merge
11d 46m
Merged PRs (30d)
1

Description

Originally reported by @Grangeot

---

**Describe the bug**

Scripts that use the `compas.get()` function to resolve file names are failing to resolve properly and defaulting to the remote version of the files. Additionally (perhaps a second, unrelated error), this machine seems to fail to get the remote files.

**To Reproduce**
- Open Rhino 7 on Mac
- Run the following script in the `EditPythonScript` editor:

```python
from compas.artists import Artist
from compas.robots import RobotModel

model = RobotModel.ur5(load_geometry=True)
```

**Expected behavior**
Instead of loading the files, the code fails to locate the local file, then reverts to the remote versions, but it also fails to retrieve the remote files with the following error message:
```
Message: HTTPError
Traceback:
line 407, in _call_chain, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 473, in error, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 547, in http_response, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 154, in urlopen, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 48, in open_file, “/Users/Maxence/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/compas/_iotools.py”
line 17, in __enter__, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/contextlib.py”
line 241, in open, “/Users/Maxence/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/compas/files/obj.py”
line 111, in read, “/Users/Maxence/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/compas/files/obj.py”
line 556, in http_error_default, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 435, in open, “/Applications/Rhino 7.app/Contents/Frameworks/RhCore.framework/Versions/Current/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/urllib2.py”
line 130, in from_obj, “/Users/Maxence/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/compas/datastructures/network/network.py”
line 34, in , “/var/folders/zz/mh7l1kfx3fg3fmlb6pxsfvyh0000gn/T/TempScript.py”
```

It might well be these are two separate errors, the first one is related to `readlink` for posix OSes in `compas._os.realpath`, and the second is the HTTP Error triggered by the attempt to load the file from remote.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.