Skip to content
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

Update read_text to use specified encoding (self._encoding|encoding) #17

Closed
wants to merge 1 commit into from
Closed

Conversation

FredHappyface
Copy link

Description

Update read_text to use specified encoding (self._encoding|encoding). After running tests looks like some additional work needs doing to have things run on windows. Happy to mark this WIP and work on that now or in a future pr if you'd prefer?

Fixes #16

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Pylint checks are passing
  • Mypy checks are passing
  • I have performed a self-review of my own code
  • I added docstring to new modules, classes and public methods -> N/A
  • I have added tests that prove my fix is effective or that my feature works -> tested locally - not sure how best to write platform specific tests here
  • New and existing unit tests pass locally with my changes -> NO: 14 failed, 99 passed
  • Any dependent changes have been merged and published in downstream modules -> N/A

Pytest Output

==================================================== short test summary info ==================================================== 
FAILED tests/test_generator.py::TestGenerator::test_generate_doc - AssertionError: expected call not found.
FAILED tests/test_generator.py::TestGenerator::test_generate_docs - AssertionError: expected call not found.
FAILED tests/test_generator.py::TestGenerator::test_init - AssertionError: expected call not found.
FAILED tests/test_main.py::TestMain::test_main - AssertionError: expected call not found.
FAILED tests/test_md_document.py::TestMDDocument::test_add_toc_if_not_exists - PermissionError: [Errno 13] Permission denied: '...
FAILED tests/test_md_document.py::TestMDDocument::test_append - handsdown.utils.path_finder.PathFinderError: Root path \ is not...
FAILED tests/test_md_document.py::TestMDDocument::test_append_title - handsdown.utils.path_finder.PathFinderError: Root path \ ...
FAILED tests/test_md_document.py::TestMDDocument::test_context_manager - PermissionError: [Errno 13] Permission denied: 'C:\\Us...
FAILED tests/test_md_document.py::TestMDDocument::test_generate_toc_section - handsdown.utils.path_finder.PathFinderError: Root...
FAILED tests/test_md_document.py::TestMDDocument::test_init - PermissionError: [Errno 13] Permission denied: 'C:\\Users\\<user>\\...
FAILED tests/test_md_document.py::TestMDDocument::test_render_doc_link - handsdown.utils.path_finder.PathFinderError: Root path...
FAILED tests/test_md_document.py::TestMDDocument::test_render_md_doc_link - handsdown.utils.path_finder.PathFinderError: Root p...
FAILED tests/utils/test_init.py::TestUtils::test_render_asset - TypeError: render_asset() missing 1 required positional argumen...
FAILED tests/utils/test_path_finder.py::TestPathFinder::test_relative - handsdown.utils.path_finder.PathFinderError: Root path ...
================================================= 14 failed, 99 passed in 2.00s ================================================= 

@vemel
Copy link
Owner

vemel commented Jan 29, 2022

Thank you for your PR. Even though I have already added similar changes, thanks to your PR, I found one more place where encoding should be added. Output files now should respect encoding as well.

I am going to close your PR and prepare a new release. Thanks a lot for your help and time!

@vemel vemel closed this Jan 29, 2022
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.

Handsdown crashes with a UnicodeDecodeError on windows due to the default encoding not being utf8
2 participants