Skip to content

Fixing carriage return error. Issue #326 - #328

Open
venturero wants to merge 2 commits into
PyCQA:mainfrom
venturero:carriage_return_fix
Open

Fixing carriage return error. Issue #326#328
venturero wants to merge 2 commits into
PyCQA:mainfrom
venturero:carriage_return_fix

Conversation

@venturero

Copy link
Copy Markdown

@fsouza fsouza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think stripping it is fine. Can you add a test?

Comment thread autoflake.py
Comment on lines +536 to +539
else:
# Eğer split işlemi beklenen şekilde çalışmazsa
indentation = ''
imports = line.replace('\r', '')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have an example of when this happens?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes in issue #326

@venturero venturero Jun 19, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is my pull request okay to merge? Do you have any other feedback for me? If so, I can update the code again. @fsouza

@venturero

venturero commented Jun 2, 2025

Copy link
Copy Markdown
Author

I think stripping it is fine. Can you add a test? @fsouza

I ran test_autoflake.py and this is the response i get:

..............'expand-star-imports' in the config file should be a boolean
.'expand-star-imports' in the config file should be a boolean
.'exclude' in the config file should be a comma separated string or list of strings
................................C:\Users\rvent\anaconda3\envs\env2\lib\unittest\case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=3>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
........usage: autoflake [-h] [-c | -cd] [--imports IMPORTS | --remove-all-unused-imports] [-r] [-j n] [--exclude globs]
[--expand-star-imports] [--ignore-init-module-imports] [--remove-duplicate-keys]
[--remove-unused-variables] [--remove-rhs-for-unused-variables] [--ignore-pass-statements]
[--ignore-pass-after-docstring] [--version] [--quiet] [-v] [--stdin-display-name STDIN_DISPLAY_NAME]
[--config CONFIG_FILE] [-i | -s]
files [files ...]
autoflake: error: argument -s/--stdout: not allowed with argument -i/--in-place
.................................................................................................................

Ran 169 tests in 3.115s

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants