Skip to content

Commit

Permalink
Merge pull request #106 from nathanjmcdougall/release/v0.3.3
Browse files Browse the repository at this point in the history
Build changelog for v0.3.3
  • Loading branch information
nathanjmcdougall authored Apr 24, 2024
2 parents 7412f56 + a817fc8 commit 2aa9e60
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions doc/source/release/changelog/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.3.3 (2024-04-25)
==================

Bug fixes
---------

- A bug has been fixed where UTF8 characters in Python files would give fatal errors.


0.3.2 (2024-04-25)
==================

Expand Down
2 changes: 1 addition & 1 deletion src/suiteas/read/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def get_toml_config(toml_path: Path) -> TOMLProjConfig:
msg = f"Could not find TOML configuration file at {toml_path}"
raise FileNotFoundError(msg)

with toml_path.open(mode="r") as file:
with toml_path.open(mode="r", encoding="utf8") as file:
pyproject_contents = file.read()

if not pyproject_contents:
Expand Down
2 changes: 1 addition & 1 deletion src/suiteas/read/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_file(path: Path, *, module_name: str) -> File:
msg = f"Could not find {path}"
raise FileNotFoundError(msg)

with path.open(mode="r") as _f:
with path.open(mode="r", encoding="utf8") as _f:
source = _f.read()
try:
tree = ast.parse(source)
Expand Down
1 change: 1 addition & 0 deletions tests/assets/files/unicode_backquotes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""”"""
6 changes: 5 additions & 1 deletion tests/unit/suiteas/read/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,18 @@ def test_multi(self, files_parent_dir: Path) -> None:
def test_random_file(self, tmp_path: Path, seed: int) -> None:
"""Generate a random file and check we can at least run the tool."""
file_path = tmp_path / "random_file.py"
with file_path.open(mode="w") as _f:
with file_path.open(mode="w", encoding="utf8") as _f:
_f.write(generate(seed=seed))
try:
file = get_file(file_path, module_name="random_file")
except AnalyzedFileSyntaxError:
return
assert type(file) == File

def test_unicode_backquotes(self, files_parent_dir: Path) -> None:
file_path = files_parent_dir / "unicode_backquotes.py"

get_file(file_path, module_name="fakey.mcfake.unicode_backquotes")

class TestFlowCtrlTree:
def test_correspondence(self) -> None:
Expand Down

0 comments on commit 2aa9e60

Please sign in to comment.