-
Notifications
You must be signed in to change notification settings - Fork 2
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
AttributeError: 'MemoryTempfile' object has no attribute 'tempdir' #12
Comments
Doesn't seem to be related to this service only. I got the same when starting
|
Seems to be related to the fact that Mac OS doesn't have |
According to their example, there is a "fallback" if the file can't be created into memory. # We now do not want to use /dev/shm or /run/shm and no ramfs paths
# If /run/user/{uid} is available, we prefer it to /tmp
# And we want to try /var/run as a last resort
# If all fails, fallback to platform's tmp dir
from memory_tempfile import MemoryTempfile
import memory_tempfile
# By the way, all paths with string {uid} will have it replaced with the user id
tempfile = MemoryTempfile(preferred_paths=['/run/user/{uid}'], remove_paths=['/dev/shm', '/run/shm'],
additional_paths=['/var/run'], filesystem_types=['tmpfs'], fallback=True)
if tempfile.found_mem_tempdir():
print('We could use any of the following paths: {}'.format(tempfile.get_usable_mem_tempdir_paths()))
print('And we are using now: {}'.format(tempfile.gettempdir()))
with tempfile.NamedTemporaryFile() as ntf:
# use it as usual...
pass |
fallback flag is passed https://github.com/forslund/combo-lock/blob/master/combo_lock/util.py#L6 ... xfering issue to combo-lock repo |
fixed in forslund/combo-lock#20 :) |
All good!
|
Thanks for testing and verifying! |
Thanks for fixing!!! |
When starting the service on Mac OS (Python 3.11) without any
mycroft.conf
.The text was updated successfully, but these errors were encountered: