cloudpathlib
cloudpathlib copied to clipboard
Module fails to import when Python is ran with -OO
Since -OO
removes docstrings, the module fails on import as shown in the following trace:
[...]
from cloudpathlib import AnyPath, CloudPath
File "/home/javier/.virtualenvs/WebsiteTopicClassifier/lib/python3.6/site-packages/cloudpathlib/__init__.py", line 3, in <module>
from .anypath import AnyPath
File "/home/javier/.virtualenvs/WebsiteTopicClassifier/lib/python3.6/site-packages/cloudpathlib/anypath.py", line 5, in <module>
from .cloudpath import InvalidPrefixError, CloudPath
File "/home/javier/.virtualenvs/WebsiteTopicClassifier/lib/python3.6/site-packages/cloudpathlib/cloudpath.py", line 136, in <module>
class CloudPath(metaclass=CloudPathMeta):
File "/home/javier/.virtualenvs/WebsiteTopicClassifier/lib/python3.6/site-packages/cloudpathlib/cloudpath.py", line 127, in __init__
docstring = getattr(Path, attr).__doc__ + " _(Docstring copied from pathlib.Path)_"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Thanks @jruere. We'd accept a PR that adds a condition to the ones that we check ahead of failure to also check that __doc__
is not None:
https://github.com/drivendataorg/cloudpathlib/blob/20b79c11974fce5b8e7b0fe292ba8d11b00dad49/cloudpathlib/cloudpath.py#L122-L126
@jruere This is released now in version 0.10.0 on PyPI
Much appreciated!
On Thu, 18 Aug 2022, 22:01 Peter Bull, @.***> wrote:
@jruere https://github.com/jruere This is released now in version 0.10.0 on PyPI
— Reply to this email directly, view it on GitHub https://github.com/drivendataorg/cloudpathlib/issues/238#issuecomment-1220125223, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ5FRTKC4EVO2SFVNKODRDVZ3MHHANCNFSM526VVW6Q . You are receiving this because you were mentioned.Message ID: @.***>