Skip to content

Custom abbreviations not working on Windows with Python 3.5/3.6/3.7 #86

Description

@brocksam

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 test test_custom_abbreviations. An example output from the GitHub Actions workflow is shown below:

======================================================================
ERROR: titlecase.tests.test_custom_abbreviations
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\hostedtoolcache\windows\python\3.5.4\x64\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "D:\a\python-titlecase\python-titlecase\titlecase\tests.py", line 383, in test_custom_abbreviations
    assert titlecase('sending UDP packets over PPPoE works great', callback=create_wordlist_filter_from_file(f.name)) == 'Sending UDP Packets Over PPPoE Works Great'
  File "D:\a\python-titlecase\python-titlecase\titlecase\__init__.py", line 216, in create_wordlist_filter_from_file
    with open(file_path_str) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmp8iadjc2i'
-------------------- >> begin captured logging << --------------------
titlecase: DEBUG: Sending UDP Packets Over PPPoE Works Great
titlecase: DEBUG: Sending Udp Packets Over Pppoe Works Great
--------------------- >> end captured logging << ---------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions