MPh-py / MPh

Pythonic scripting interface for Comsol Multiphysics
https://mph.readthedocs.io
MIT License
274 stars 70 forks source link

Builds fail on macOS #18

Closed max3-2 closed 3 years ago

max3-2 commented 3 years ago

When using the deploy/build.py it creates

Traceback (most recent call last):
  File "deploy/build.py", line 17, in <module>
    move(root/'dist', root/'deploy'/'dist')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 562, in move
    real_dst = os.path.join(dst, _basename(src))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 526, in _basename
    return os.path.basename(path.rstrip(sep))
AttributeError: 'PosixPath' object has no attribute 'rstrip'

Explanation should be here... https://stackoverflow.com/questions/61327385/trying-to-use-on-path-object-python

john-hen commented 3 years ago

Same on Windows. I was wondering why I keep seeing a dist folder in root instead of in deploy. Thanks for reporting. Fixed in master.

This happens when the build script tries to move the dist folder, but the target already exists. The error message is confusing, by the way. And the Stack Overflow question misleading. All file-related functions in the standard library accept path-like objects, including shutil.move().