Skip to content

Remove str concatenation #4

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

Merged
merged 1 commit into from
May 4, 2024

Conversation

justmobilize
Copy link

No description provided.

@@ -369,22 +369,22 @@ def _build_boundary_data(self, files: dict): # pylint: disable=too-many-locals
file_name = field_values[0]
file_handle = field_values[1]

boundary_data = f"--{boundary_string}\r\n"
boundary_data += f'Content-Disposition: form-data; name="{field_name}"'
boundary_objects.append(
Copy link
Author

Choose a reason for hiding this comment

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

add all strings to the list

boundary_objects.append(boundary_data)
for boundary_object in boundary_objects:
if isinstance(boundary_object, str):
content_length += len(boundary_object)
Copy link
Author

Choose a reason for hiding this comment

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

and calculate the length at the end

@@ -10,13 +10,15 @@ envlist = py311
description = run tests
deps =
pytest==7.4.3
requests
Copy link
Author

Choose a reason for hiding this comment

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

needed to run tox, since requests is now in optional

@justmobilize justmobilize marked this pull request as ready for review May 3, 2024 20:17
@FoamyGuy FoamyGuy merged commit 55f159f into FoamyGuy:files_arg May 4, 2024
1 check passed
@FoamyGuy
Copy link
Owner

FoamyGuy commented May 4, 2024

Thank you!

Looks good to me, I tested this successfully on a Feather S3 TFT.

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