cua
cua copied to clipboard
Variable shadowing in computer class breaks shared directories.
This section in the Computer.__init__ method:
if shared_directories:
for path in shared_directories:
abs_path = os.path.abspath(os.path.expanduser(path)) # type: ignore[attr-defined]
if not os.path.exists(abs_path): # type: ignore[attr-defined]
raise ValueError(f"Shared directory does not exist: {path}")
self.shared_paths.append(abs_path)
fails with:
abs_path = os.path.abspath(os.path.expanduser(path)) # type: ignore[attr-defined]
^^^^^^^
AttributeError: 'str' object has no attribute 'path'
because the module name is being shadowed by the init variable os, which is a string (macos, linux).
Please fix.
See: https://github.com/trycua/cua/pull/145
Resolved by renaming the argument os to os_type to avoid collision with the module
@brad-kenstler can you review to see whether this can be closed now that a solution has been implemented?
Is this issue still open or is it closed? It is showing open but the PR was submitted by @FinnBorge