question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

format_str() got an unexpected keyword argument 'line_length'

See original GitHub issue

Just installed with the Black formatter. Using anaconda with Python 3.7 as a base environment. When I hit the “Apply Black Formatter” button, nothing happens, and I see this in the terminal window:

[E 21:34:52.006 LabApp] Uncaught exception POST /jupyterlab_code_formatter/format?1552613692000 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/jupyterlab_code_formatter/format?1552613692000', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/matt/anaconda3/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/matt/anaconda3/lib/python3.7/site-packages/jupyterlab_code_formatter/handlers.py", line 66, in post
        data["code"], **(data["options"] or {})
      File "/home/matt/anaconda3/lib/python3.7/site-packages/jupyterlab_code_formatter/formatters.py", line 36, in format_code
        return format_str(code, **options)[:-1]
    TypeError: format_str() got an unexpected keyword argument 'line_length'
[W 21:34:52.007 LabApp] Unhandled error
[E 21:34:52.008 LabApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Content-Length": "95",
      "Authorization": "token 46089f9488d32aa5e5443396608c78d57921a545d95d4540",
      "Origin": "http://localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
      "Dnt": "1",
      "Content-Type": "application/json",
      "Accept": "*/*",
      "Referer": "http://localhost:8888/lab",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9",
      "Cookie": "username-localhost-9990=\"2|1:0|10:1551064122|23:username-localhost-9990|44:MjQ2YzBlMjczYTdjNDUzMWE0NzIwM2ZkMTdiMGEyMTM=|d2e4285f794b2259e27c87a7758bab7be1f40ce0c613d8bc8a645b2aa06a48ea\"; _xsrf=2|8cc9511d|04ae6d8f70ec186122e19d1d6c5a524d|1552336278; username-localhost-8888=\"2|1:0|10:1552613687|23:username-localhost-8888|44:Nzk5YzUyNTU0MjBlNDBjNzk5MmVlY2Y1MWEwYzYyY2M=|518486b2e7d4ba6f961a09e6abe1458810e6142666057474823c7d9a1ef0c833\
""
    }
[E 21:34:52.009 LabApp] 500 POST /jupyterlab_code_formatter/format?1552613692000 (127.0.0.1) 3.34ms referer=http://localhost:8888/lab```

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mattalhontecommented, Mar 25, 2019

Woohoo, works great now! Thanks!

0reactions
ryantam626commented, May 9, 2019

Good to hear 😄 It exist now in conda-forge btw

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error : save() got an unexpected keyword argument 'format'
The error states that the function save is not accepting argument format . So you need to remove it (from both functions).
Read more >
ActivePython 3.7.4 Documentation
Complete documentation for ActivePython 3.7.4.
Read more >
Changelog — Python 3.9.14 documentation
bpo-34480: Fix a bug where _markupbase raised an UnboundLocalError when an invalid keyword was found in marked section. Patch by Marek Suscak. bpo-27929:...
Read more >
ezdxf Documentation
Welcome! This is the documentation for ezdxf release 1.0.0, last updated Dec 09, 2022. • ezdxf is a Python package to create new...
Read more >
Gripe about lack of opinionated tools : r/csharp - Reddit
Python: opinionated formatter ( black ), usually no configuration needed ... public IEnumerable<WeatherForecast> Get() { var rng = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found