Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

TypeError when calling extra_profane_word_dictionaries #21

Closed
eevelweezel opened this issue Apr 23, 2019 · 6 comments
Closed

TypeError when calling extra_profane_word_dictionaries #21

eevelweezel opened this issue Apr 23, 2019 · 6 comments
Labels
invalid This doesn't seem right wontfix This will not be worked on

Comments

@eevelweezel
Copy link

When supplying a dict ({lang: {set}}) to extra_profane_word_dictionaries, it raises a TypeError after trying to divide a string by a string:

Traceback (most recent call last): File "<console>", line 4, in <module> File "/home/hwhite/frac37/lib/python3.7/site-packages/profanity_filter/profanity_filter.py", line 265, in custom_profane_word_dictionaries self.clear_cache() File "/home/hwhite/frac37/lib/python3.7/site-packages/profanity_filter/profanity_filter.py", line 384, in clear_cache self._update_profane_word_dictionary_files() File "/home/hwhite/frac37/lib/python3.7/site-packages/profanity_filter/profanity_filter.py", line 429, in _update_profane_word_dictionary_files profane_word_file = self._DATA_DIR / f'{language}_profane_words.txt' TypeError: unsupported operand type(s) for /: 'str' and 'str'

@rominf
Copy link
Owner

rominf commented Apr 27, 2019

Cannot reproduce. Have you changed _DATA_DIR to str? Could you please send a minimal working example, that reproduces an issue?

@rominf rominf added bug Something isn't working invalid This doesn't seem right labels Apr 27, 2019
@rominf
Copy link
Owner

rominf commented Apr 30, 2019

Closing due inactivity. Feel free to open it again.

@rominf rominf closed this as completed Apr 30, 2019
@hcao2015
Copy link

Hi, I encountered the same bug above.
File "/home/hc/projects/fm_env/lib/python3.7/site-packages/profanity_filter/profanity_filter.py", line 375, in spells self._spells[language] = HunSpell(self._DATA_DIR / f'{language}.dic', TypeError: unsupported operand type(s) for /: 'str' and 'str'

@rominf
Copy link
Owner

rominf commented May 16, 2019

@hcao2015 Please attach a minimal working example.

@rominf rominf reopened this May 16, 2019
@rominf rominf removed the invalid This doesn't seem right label May 16, 2019
@hcao2015
Copy link

Sorry, I figured out it was the wrong format of self._DATA_DIR that caused the problem

@rominf
Copy link
Owner

rominf commented May 17, 2019

@hcao2015 you are welcome to implement #23. Sorry, but currently I don't have time for this.

@rominf rominf added invalid This doesn't seem right wontfix This will not be worked on labels May 17, 2019
@rominf rominf closed this as completed May 17, 2019
@rominf rominf removed the bug Something isn't working label May 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants