format_str() got an unexpected keyword argument 'line_length'
See original GitHub issueJust 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:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top 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 >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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Woohoo, works great now! Thanks!
Good to hear 😄 It exist now in conda-forge btw