Skip to content

Unable to pass argument with space to cell magic #12729

Description

@memeplex

Cython defines this argument for the %%cython margin:

    @magic_arguments.argument(
        '--link-args', action="proxy.php?url=https%3A%2F%2Fgithub.com%2Fipython%2Fipython%2Fissues%2Fappend", default=[],
        help="Extra flags to pass to linker via the `extra_link_args` "
             "Extension flag (can be specified  multiple times)."
    )

But trying to pass %%cython --link-args="-L/Users/carlos/Desktop/Test LGBM API" I get:

UsageError: unrecognized arguments: LGBM API"

If I mimic what I believe this should be doing, I get:

EDIT: there is a typo in this code, please see comments below.

In [15]: l = shlex.shlex('%%cython --link-args="-L/Users/carlos/Desktop/Test LGBM API"', posix=False)

In [16]: a.whitespace_split=True

In [17]: a.commenters=''

In [18]: list(l)
Out[18]:
['%',
 '%',
 'cython',
 '-',
 '-',
 'link',
 '-',
 'args',
 '=',
 '"-L/Users/carlos/Desktop/Test LGBM API"']

which seems fine.

My system is MacOS 11.0.1. I'm using python 3.8.6 with ipython 7.19.0.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions