Message190180
On 28 May, 2013, at 10:28, Elazar Gershuni <report@bugs.python.org> wrote:
>
> Elazar Gershuni added the comment:
>
> Is it standard procedure to raise an unrelated exception in when an invalid parameter is passed? I did not encounter any other library function that behaves like this. Especially taking the fact that this is the normal usage in python3.
This is not the normal usage in python3, but one of the usecases supported in python3. In python3 compiled code is a byte string and source code is a regular (unicode) string, which means the two can easily be recognized, while in python2 both are 'str' strings.
>
> How do I supposed to *know* this is not a bug?
By reading the documentation?
> I can't find similar behavior in other library functions. An IndexError and a traceback *inside the library* does not help.
Other library functions can also raise fairly obscure exceptions when you pass in bad data, as an example of this "os.path.join(None, 'a')" raises AttributeError. |
|
Date |
User |
Action |
Args |
2013-05-28 08:36:23 | ronaldoussoren | set | recipients:
+ ronaldoussoren, elazar |
2013-05-28 08:36:23 | ronaldoussoren | link | issue18077 messages |
2013-05-28 08:36:23 | ronaldoussoren | create | |
|