This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients elazar, ronaldoussoren
Date 2013-05-28.08:36:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <EDE89C86-42CC-459D-A6F5-10D25BA589E3@mac.com>
In-reply-to <1369729730.76.0.482393970055.issue18077@psf.upfronthosting.co.za>
Content
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.
History
Date User Action Args
2013-05-28 08:36:23ronaldoussorensetrecipients: + ronaldoussoren, elazar
2013-05-28 08:36:23ronaldoussorenlinkissue18077 messages
2013-05-28 08:36:23ronaldoussorencreate