bpoaugust added the comment:

Another case is get_filename.

The second call to unquote will only change the incoming parameter if the 
original value was enclosed in <> or "". This is not a common scenario, and was 
only discovered because a mailer used the form <<<abcd>>> as a boundary marker 
(yes, this is invalid). So existing tests are unlikely to notice any difference.

Note that it is wrong to unquote more times than the original value has been 
quoted. So the only possible reason for keeping unquote in the function is if 
unquote has not already been called on a quoted value. (It is not possible to 
tell from the parameter whether or not it is currently quoted).

The two sample callers are get_boundary and get_filename.
Both pass the value already unquoted.

This method should be fixed to remove the unquote calls.
If there is a caller (is there one?) that does not unquote the value first, 
then that needs to be fixed as well.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29020>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to