Skip to content

%load magic does not recognize notebooks #114

Description

@andrus
%load ../lib/my.ipynb
---------------------------------------------------------------------------
|   java.lang.RuntimeException: java.lang.RuntimeException, Exception running line magic 'load': [snippet: [{
|    "cells": [
|     {
|      "cell_type": "markdown",
|      "id": "48d49d50-02e6-4969-9d78-7604ee0736af",
|      "metadata": {},
|      "source": [ ....

So looks like this code used to detect whether the file is a notebook or not, does the wrong thing. Instead of checking an extension on a String, it actually checks the last path component, always returning "false":

if (scriptPath.getFileName().endsWith(NOTEBOOK_EXTENSION)) {
   execNotebook(kernel, scriptPath);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions