-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'int' object has no attribute 'lower' #1458
Comments
At first glance, it looks like your installation of Edit: please modify the pip command as needed since I just realized that you are using a virtual environment. |
@ichard26
|
@ichard26 I cloned, created a new venv and ran the test. I get one error(see below). I tried to run this version on black on my simple hello world file and get the same error as above
|
You need to install with the blackd "extra" dependencies to run the test suite.
I think it's time to write a wrapper to run all our unittests and make it easier for first timers. |
@cooperlees I did not have the (.venv) VMD-MBP-16:black vincentdavis$ python -m unittest output""""""
|
Right, so the tests pass for you. Then we're back to @ichard26's original diagnosis that you probably have some issue with click in your environment. |
I created a new env and pip installed black, and it fails. Sure it might be click but I am not trying to use click. :-) I did try installing several different versions of click with no luck. Ideas? |
Is there by any chance a |
Wow, yes that was it. The
Even though I am not in the folder with the |
Could you change
|
@vincentdavis, sorry for not responding earlier, my laptop charger decided yesterday was the day to stop working and that had thrown my plans to investigate the issue out the window. I'll see what can do in terms of documentation. FYI, if you run Black in verbose mode, you will see what config file it is using:
|
@SanketDG, do you know why (black-rHKUX7ap) R:\Programming\black>black setup.py
Usage: black [OPTIONS] [SRC]...
Try 'black -h' for help.
Error: Invalid value for '-S' / '--skip-string-normalization': hi is not a valid boolean It accepts |
Thanks for the help I will leave this to you. |
Apparently, that's how it's written https://github.com/pallets/click/blob/97de2c97275f52adc5c6ef8bb8aa993ce997fe7e/src/click/types.py#L389 Also, pallets/click#1553, this one's from running Black too
This seems hard to do when
👍 |
@SanketDG thanks for the info! What's interesting is that they accept Although this isn't exactly
|
So I have opened an issue on Click's repository to see if they would be interested in either having
Opinions? I like number four the most and it seems to not break anything. |
This seems the least invasive, but if I am getting it right, if |
Well |
Describe the bug
When I try to run black on a file I get this error. even a simple file that has only
print('hello world')
I am runnning
black temp.py
To Reproduce Steps to reproduce the behavior:
black temp.py
Environment (please complete the following information):
python 3.8 macos
black.version
'19.10b0'
click.version
'7.1.2'
Error
(venv) $ black temp.py Traceback (most recent call last): File "/venv/bin/black", line 10, in <module> sys.exit(patched_main()) File "/venv/lib/python3.8/site-packages/black.py", line 4135, in patched_main main() File "/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/venv/lib/python3.8/site-packages/click/core.py", line 781, in main with self.make_context(prog_name, args, **extra) as ctx: File "/venv/lib/python3.8/site-packages/click/core.py", line 700, in make_context self.parse_args(ctx, args) File "/venv/lib/python3.8/site-packages/click/core.py", line 1048, in parse_args value, args = param.handle_parse_result(ctx, opts, args) File "/venv/lib/python3.8/site-packages/click/core.py", line 1623, in handle_parse_result value = self.full_process_value(ctx, value) File "/venv/lib/python3.8/site-packages/click/core.py", line 1965, in full_process_value return Parameter.full_process_value(self, ctx, value) File "/venv/lib/python3.8/site-packages/click/core.py", line 1589, in full_process_value value = self.process_value(ctx, value) File "/venv/lib/python3.8/site-packages/click/core.py", line 1579, in process_value return self.type_cast_value(ctx, value) File "/venv/lib/python3.8/site-packages/click/core.py", line 1568, in type_cast_value return _convert(value, (self.nargs != 1) + bool(self.multiple)) File "/venv/lib/python3.8/site-packages/click/core.py", line 1565, in _convert return self.type(value, self, ctx) File "/venv/lib/python3.8/site-packages/click/types.py", line 46, in __call__ return self.convert(value, param, ctx) File "/venv/lib/python3.8/site-packages/click/types.py", line 412, in convert value = value.lower() AttributeError: 'int' object has no attribute 'lower'
The text was updated successfully, but these errors were encountered: