Skip to content

Commit d5c0471

Browse files
committed
quick check to see if we can revert changes to enable the integration tests to pass
1 parent d7520ed commit d5c0471

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

jupyter_server/services/contents/filemanager.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ def check_folder_size(self, path):
674674
limit_str = f"{limit_mb}MB"
675675
limit_bytes = limit_mb * 1024 * 1024
676676
size = int(self._get_dir_size(self._get_os_path(path)))
677-
size = size * 1024 if platform.system() == "Darwin" else size
677+
# size = size * 1024 if platform.system() == "Darwin" else size
678678

679679
if size > limit_bytes:
680680
raise web.HTTPError(
@@ -690,21 +690,21 @@ def _get_dir_size(self, path="."):
690690
calls the command line program du to get the directory size
691691
"""
692692
try:
693-
# result = subprocess.run(
694-
# ["du", "-s", "--block-size=1", path], capture_output=True
695-
# ).stdout.split()
696-
# self.log.info(f"current status of du command {result}")
697-
# size = result[0].decode("utf-8")
698-
if platform.system() == "Darwin":
699-
result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
700-
701-
else:
702-
result = subprocess.run(
703-
["du", "-s", "--block-size=1", path], capture_output=True
704-
).stdout.split()
705-
693+
result = subprocess.run(
694+
["du", "-s", "--block-size=1", path], capture_output=True
695+
).stdout.split()
706696
self.log.info(f"current status of du command {result}")
707697
size = result[0].decode("utf-8")
698+
# if platform.system() == "Darwin":
699+
# result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
700+
701+
# else:
702+
# result = subprocess.run(
703+
# ["du", "-s", "--block-size=1", path], capture_output=True
704+
# ).stdout.split()
705+
706+
# self.log.info(f"current status of du command {result}")
707+
# size = result[0].decode("utf-8")
708708
except Exception as err:
709709
self.log.error(f"Error during directory copy: {err}")
710710
raise web.HTTPError(
@@ -1158,7 +1158,7 @@ async def check_folder_size(self, path: str) -> None:
11581158
limit_str = f"{limit_mb}MB"
11591159
limit_bytes = limit_mb * 1024 * 1024
11601160
size = int(await self._get_dir_size(self._get_os_path(path)))
1161-
size = size * 1024 if platform.system() == "Darwin" else size
1161+
# size = size * 1024 if platform.system() == "Darwin" else size
11621162
if size > limit_bytes:
11631163
raise web.HTTPError(
11641164
400,
@@ -1173,17 +1173,17 @@ async def _get_dir_size(self, path: str = ".") -> str:
11731173
calls the command line program du to get the directory size
11741174
"""
11751175
try:
1176-
# result = subprocess.run(
1177-
# ["du", "-s", "--block-size=1", path], capture_output=True
1178-
# ).stdout.split()
1176+
result = subprocess.run(
1177+
["du", "-s", "--block-size=1", path], capture_output=True
1178+
).stdout.split()
11791179

1180-
if platform.system() == "Darwin":
1181-
result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
1180+
# if platform.system() == "Darwin":
1181+
# result = subprocess.run(["du", "-sk", path], capture_output=True).stdout.split()
11821182

1183-
else:
1184-
result = subprocess.run(
1185-
["du", "-s", "--block-size=1", path], capture_output=True
1186-
).stdout.split()
1183+
# else:
1184+
# result = subprocess.run(
1185+
# ["du", "-s", "--block-size=1", path], capture_output=True
1186+
# ).stdout.split()
11871187

11881188
self.log.info(f"current status of du command {result}")
11891189
size = result[0].decode("utf-8")

0 commit comments

Comments
 (0)