Skip to content

Commit 4f58818

Browse files
committed
fix #8602 -- opening a file ending in .ipynb~ (NOT THE TILDE) causes a crash
1 parent 3e0a443 commit 4f58818

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/packages/frontend/file-editors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import {
7-
filename_extension_notilde,
7+
filename_extension,
88
meta_file,
99
path_split,
1010
defaults,
@@ -148,7 +148,7 @@ function get_ed(
148148
ext =
149149
ext ??
150150
altExt[key(project_id, path)] ??
151-
filename_extension_notilde(path).toLowerCase();
151+
filename_extension(path).toLowerCase();
152152

153153
// either use the one given by ext, or if there isn't one, use the '' fallback.
154154
const spec =

src/packages/frontend/project/open-file.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { retry_until_success } from "@cocalc/util/async-utils";
1717
import {
1818
defaults,
1919
filename_extension,
20-
filename_extension_notilde,
2120
path_to_tab,
2221
required,
2322
uuid,
@@ -173,7 +172,7 @@ export async function open_file(
173172
} catch (_) {
174173
// TODO: old projects will not have the new realpath api call -- can delete this try/catch at some point.
175174
}
176-
let ext = opts.ext ?? filename_extension_notilde(opts.path).toLowerCase();
175+
let ext = opts.ext ?? filename_extension(opts.path).toLowerCase();
177176

178177
// Next get the group.
179178
let group: string;

0 commit comments

Comments
 (0)