Skip to content

Commit 09ca021

Browse files
committed
Handle unreadable directories when listing files
1 parent 2b734fb commit 09ca021

7 files changed

Lines changed: 31 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ The image is based on the reference images for Apache Airflow.
5151

5252
You can find the following images there:
5353
* andreax79/airflow-code-editor:**latest** - the latest released Airflow Code Editor image with the latest Apache Airflow version
54-
* andreax79/airflow-code-editor:**3.1.7** - the latest released Airflow Code Editor with specific Airflow version
55-
* andreax79/airflow-code-editor:**3.1.7-8.2.0** - specific version of Airflow and Airflow Code Editor
54+
* andreax79/airflow-code-editor:**3.1.8** - the latest released Airflow Code Editor with specific Airflow version
55+
* andreax79/airflow-code-editor:**3.1.8-8.2.3** - specific version of Airflow and Airflow Code Editor
5656

5757
#### Installing from PyPI
5858

airflow_code_editor/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.2.2
1+
8.2.3

airflow_code_editor/commons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
'root_directory': None,
100100
'line_length': 88,
101101
'string_normalization': False,
102-
'ignored_entries': '.*,__pycache__',
102+
'ignored_entries': '.*,__pycache__,lost+found',
103103
'search_context': 2,
104104
}
105105
ROOT_MOUNTPOUNT = 'root'

airflow_code_editor/fs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def size(self) -> Optional[int]:
586586
return len(self.root_fs.listdir(self.path))
587587
else:
588588
return self.root_fs.size(self.path)
589-
except FSError:
589+
except Exception:
590590
return None
591591

592592
def move(self, target) -> None:

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,9 @@
515515
## Fix
516516

517517
- Disable listings cache for URL-like paths
518+
519+
## [8.2.3] - 2026-04-03
520+
521+
## Fix
522+
523+
- Handle unreadable directories when listing files

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "airflow-code-editor",
3-
"version": "8.2.2",
3+
"version": "8.2.3",
44
"description": "A plugin for [Apache Airflow](https://github.com/apache/airflow) that allows you to edit DAGs in browser. It provides a file managing interface within specified directories and it can be used to edit and download your files. If git support is enabled, the DAGs are stored in a Git repository. You may use it to view Git history, review local changes and commit.",
55
"private": true,
66
"repository": {

sh.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import cmd
1818
import shlex
1919
import sys
20+
from datetime import datetime
2021

2122
try:
2223
import readline
@@ -105,6 +106,13 @@ def do_pwd(self, args):
105106

106107
def do_ls(self, args):
107108
"List directory"
109+
110+
if "-l" in args:
111+
args.remove("-l")
112+
long_format = True
113+
else:
114+
long_format = False
115+
108116
for arg in args or ["."]:
109117
path = self.cwd / arg
110118
if not path.exists():
@@ -113,7 +121,17 @@ def do_ls(self, args):
113121
print(str(path.name))
114122
else:
115123
for item in path.iterdir():
116-
if item.is_dir():
124+
if long_format:
125+
s = item.stat()
126+
size = item.size()
127+
result = {
128+
'id': item.name,
129+
'size': size,
130+
'mode': s.st_mode,
131+
'mtime': datetime.fromtimestamp(int(s.st_mtime)).isoformat() if s.st_mtime else None,
132+
}
133+
print(result)
134+
elif item.is_dir():
117135
print(str(item.name) + "/")
118136
else:
119137
print(str(item.name))

0 commit comments

Comments
 (0)