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 here is that polib can both parse a string directly, or read a file and parse its contents. If the input is not an existing file (polib.py line 1266), it assumes that input is a string and tries to parse it, hence the error message you're seeing.
"Fixing" the error message would mean guessing that the input looks path-like and giving the user feedback to that effect.
Hmm.. well that's unfortunate. I guess the real fix is to have different arguments for path and for a string. But the error message could at least say "The file does not exist, or there's a syntax error" or something. It's not great, but it's at least not a lie.
@kthy What about assuming that if the string contains a line break, it is meant as direct text, and in all other cases it's a filepath? This simple rule would get the error message from "always wrong" to "wrong in probably less than 1/10000 cases".
I don't think there are practical use cases where a file is named msgid "".po.
but in fact the file doesn't exist.
The text was updated successfully, but these errors were encountered: