Closed brocksam closed 3 years ago
Despite my previous PR, I don't think the issue should be fixed in the create_wordlist_filter_from_file
function. The test creates a tempfile.NamedTemporaryFile
and this is only ever done in the test itself.
It would make more sense to have custom abbreviations test data in a file and pass in the file path instead - perhaps via a mock argparse.Namespace
object. This would be more in line with how create_wordlist_filter_from_file
is actually used.
Alternatively, the test itself can be rewritten:
def test_custom_abbreviations():
f = tempfile.NamedTemporaryFile(mode='w', delete=False) # do not delete on close
# <snip>
f.close() # manually close
os.unlink(f.name) # manually delete
The test will then pass on Windows.
Alternatively, the test itself can be rewritten:
def test_custom_abbreviations(): f = tempfile.NamedTemporaryFile(mode='w', delete=False) # do not delete on close # <snip> f.close() # manually close os.unlink(f.name) # manually delete
Implemented as part of PR #85. Tests now passing on Windows with all Python versions. Thanks @fireundubh. This issue can be closed upon merging PR #85.
Fixed by #85.
As highlighted by @fireundubh in a comment on PR #84, due to a
PermissionError
. This error is generated when using both Regex and the optional fallback to re from the standard library. This is a Windows-only error and only affects using Titlecase with custom abbreviations.The
PermissionError
occurs in the testtest_custom_abbreviations
. An example output from the GitHub Actions workflow is shown below: