Skip to content

cannot check 'python dict codestype' in jupyter lab #28

@yushiokamura

Description

@yushiokamura

Hi, I use pycodestyle_magic. This magic code is very nice.

When I check pythgon dict code style by %%pycodestyle, an error occurs.

for example, when I try

%%pycodestyle
{"a":0,"b":1}

then return ValueError

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-19-2c11b8fb9c7b> in <module>
----> 1 get_ipython().run_cell_magic('pycodestyle', '', '{"a":0,"b":1}\n')

~/python3.8/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
   2379             with self.builtin_trap:
   2380                 args = (magic_arg_s, cell)
-> 2381                 result = fn(*args, **kwargs)
   2382             return result
   2383 

~/python3.8/site-packages/pycodestyle_magic.py in pycodestyle(line, cell, auto)
    173         #logger.info(line)
    174         # on windows drive path also contains :
--> 175         line, col, error = line.split(':')[-4:]
    176         # do not subtract 1 for line for %%pycodestyle, inc pre py3.6 string
    177         if auto:

ValueError: too many values to unpack (expected 3)

It seems that the cause is that ":" is included in the code. right?

Is there a way around this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions