You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with this is: what if file_extensions.values() is empty? Then we get "|".join([]) which is "". Unfortunately this is wrong. We want it to be the regex which matches nothing (no strings, not even the empty string). Instead it is the regex which matches the empty string, so it will match every zero-length position in a string.
To write the regex which matches nothing, you can do r"^\b$".
I can't follow how FILE_EXTENSIONS_REGEX is used in the rest of the file, so I'm not sure whether this could actually cause any problems. @pokey ?
In
create_spoken_forms.py
we defineFILE_EXTENSIONS_REGEX
like so:The problem with this is: what if
file_extensions.values()
is empty? Then we get"|".join([])
which is""
. Unfortunately this is wrong. We want it to be the regex which matches nothing (no strings, not even the empty string). Instead it is the regex which matches the empty string, so it will match every zero-length position in a string.To write the regex which matches nothing, you can do
r"^\b$"
.I can't follow how
FILE_EXTENSIONS_REGEX
is used in the rest of the file, so I'm not sure whether this could actually cause any problems. @pokey ?(Noticed this while reviewing #1199.)
The text was updated successfully, but these errors were encountered: