| 1 |
--- |
| 2 |
name: Bug report |
| 3 |
about: Create a report to help us improve Black's quality |
| 4 |
title: "" |
| 5 |
labels: "T: bug" |
| 6 |
assignees: "" |
| 7 |
--- |
| 8 |
|
| 9 |
<!-- |
| 10 |
Please make sure that the bug is not already fixed either in newer versions or the |
| 11 |
current development version. To confirm this, you have three options: |
| 12 |
|
| 13 |
1. Update Black's version if a newer release exists: `pip install -U black` |
| 14 |
2. Install the latest `main` branch directly: |
| 15 |
`pip install "black @ git+https://github.com/psf/black.git"` |
| 16 |
3. Or run _Black_ from source on your machine: |
| 17 |
- create a new virtualenv (make sure it's the same Python version); |
| 18 |
- clone this repository; |
| 19 |
- run `pip install -e .[d]`; |
| 20 |
- run `pip install --group tests` |
| 21 |
- make sure it's sane by running `python -m pytest -n auto`; and |
| 22 |
- run `black` like you did last time. |
| 23 |
--> |
| 24 |
|
| 25 |
**Describe the bug** |
| 26 |
|
| 27 |
<!-- A clear and concise description of what the bug is. --> |
| 28 |
|
| 29 |
**To Reproduce** |
| 30 |
|
| 31 |
<!-- |
| 32 |
Minimal steps to reproduce the behavior with source code and Black's configuration. |
| 33 |
--> |
| 34 |
|
| 35 |
For example, take this code: |
| 36 |
|
| 37 |
```python |
| 38 |
this = "code" |
| 39 |
``` |
| 40 |
|
| 41 |
And run it with these arguments: |
| 42 |
|
| 43 |
```sh |
| 44 |
$ black file.py --target-version py310 |
| 45 |
``` |
| 46 |
|
| 47 |
The resulting error is: |
| 48 |
|
| 49 |
> cannot format file.py: INTERNAL ERROR: ... |
| 50 |
|
| 51 |
**Expected behavior** |
| 52 |
|
| 53 |
<!-- A clear and concise description of what you expected to happen. --> |
| 54 |
|
| 55 |
**Environment** |
| 56 |
|
| 57 |
<!-- Please complete the following information: --> |
| 58 |
|
| 59 |
- Black's version: <!-- e.g. [main] --> |
| 60 |
- OS and Python version: <!-- e.g. [Linux/Python 3.7.4rc1] --> |
| 61 |
|
| 62 |
**Additional context** |
| 63 |
|
| 64 |
<!-- Add any other context about the problem here. --> |