When I installed the package and ran the first command with colab auth login on Windows, it fails with "no module named fcntl". As I can see from the code, it's used for file locking operations:
|
with open(self.path, "r") as f: |
|
fcntl.flock(f, fcntl.LOCK_SH) |
|
try: |
|
yield f |
|
finally: |
|
fcntl.flock(f, fcntl.LOCK_UN) |
|
|
|
@contextlib.contextmanager |
|
def _lock_exclusive(self) -> Iterator[IO]: |
|
with open(self.path, "a+") as f: |
|
fcntl.flock(f, fcntl.LOCK_EX) |
|
try: |
|
yield f |
|
finally: |
|
fcntl.flock(f, fcntl.LOCK_UN) |
It can be replaced with filelock, which is cross-platform, or import winfcntl conditionally on Windows. I can raise a PR if it's ok to you.
When I installed the package and ran the first command with
colab auth loginon Windows, it fails with"no module named fcntl". As I can see from the code, it's used for file locking operations:google-colab-cli/src/colab_cli/state.py
Lines 66 to 80 in 510115b
It can be replaced with filelock, which is cross-platform, or import winfcntl conditionally on Windows. I can raise a PR if it's ok to you.