Skip to content

Commit

Permalink
chore: recommend bytes over str
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Sep 12, 2024
1 parent bea21ed commit e7f2f1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ metadata = StandardMetadata.from_pyproject(parsed_pyproject)
print(metadata.entrypoints) # same fields as defined in PEP 621

pkg_info = metadata.as_rfc822()
print(str(pkg_info)) # core metadata
print(bytes(pkg_info).decode("utf-8")) # core metadata
```


Expand Down
2 changes: 1 addition & 1 deletion tests/test_standard_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def test_as_rfc822_set_metadata(metadata_version: str) -> None:
)
assert metadata.metadata_version == metadata_version

rfc822 = str(metadata.as_rfc822())
rfc822 = bytes(metadata.as_rfc822()).decode('utf-8')

assert f'Metadata-Version: {metadata_version}' in rfc822

Expand Down

0 comments on commit e7f2f1f

Please sign in to comment.