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
It would be great if Salmon could be told to treat errors in byte decoding with something other than "strict". For example, it might be desirable to use "replace" instead if half an email was better than no email.
guess_encoding_and_decode has an optional argument errors which is set to DEFAULT_ERROR_HANDLING by default. Because this is set in the function signature it's impossible to monkey-patch the default to some other value without monkey-patching the entire function.
I imagine this was the original intention behind errors/DEFAULT_ERROR_HANDLING as other variables can be monkey-patched at runtime in lieu of a proper settings sytems.
Change the default value of errors to None and then set errors to DEFAULT_ERROR_HANDLING if errors is still None when the function is called.
Go up the function chain, all the way up to calls from MailRequest and give each one an errors argument. Also give MailRequest some property which can be set after object initialisation that controls the value of errors.
1 is required to be done to close this issue, 2 would be nice if there aren't too many functions between MailRequest and guess_encoding_and_decode
The text was updated successfully, but these errors were encountered:
It would be great if Salmon could be told to treat errors in byte decoding with something other than "strict". For example, it might be desirable to use "replace" instead if half an email was better than no email.
guess_encoding_and_decode
has an optional argumenterrors
which is set toDEFAULT_ERROR_HANDLING
by default. Because this is set in the function signature it's impossible to monkey-patch the default to some other value without monkey-patching the entire function.I imagine this was the original intention behind
errors
/DEFAULT_ERROR_HANDLING
as other variables can be monkey-patched at runtime in lieu of a proper settings sytems.errors
toNone
and then seterrors
toDEFAULT_ERROR_HANDLING
iferrors
is stillNone
when the function is called.MailRequest
and give each one anerrors
argument. Also giveMailRequest
some property which can be set after object initialisation that controls the value oferrors
.1 is required to be done to close this issue, 2 would be nice if there aren't too many functions between
MailRequest
andguess_encoding_and_decode
The text was updated successfully, but these errors were encountered: