[Python.NET] exception from a contructor

Brian Lloyd brian at zope.com
Mon Dec 8 09:18:49 EST 2003


This was fixed in PythonNet beta 3.


Brian Lloyd        brian at zope.com
V.P. Engineering   540.361.1716              
Zope Corporation   http://www.zope.com 


> -----Original Message-----
> From: pythondotnet-bounces at python.org
> [mailto:pythondotnet-bounces at python.org]On Behalf Of xtian
> Sent: Monday, December 08, 2003 12:12 AM
> To: pythondotnet at python.org
> Subject: [Python.NET] exception from a contructor
> 
> 
> Hi -
> 
> Something odd is happening when I create a DateTime object with invalid 
> contructor parameters:
> 
>  >>> import CLR
>  >>> import CLR.System as System
>  >>> d = System.DateTime(2003, 2, 30)
>  >>> d
> <CLR.System.DateTime object at 0x0127AC90>
>  >>> d.ToString()
> 
> Traceback (most recent call last):
>    File "<pyshell#34>", line 1, in -toplevel-
>      d.ToString()
> <CLR.System.Reflection.TargetException object at 0x0127AC70>: Object 
> does not match target type.
>  >>> d.Month
> 
> Traceback (most recent call last):
>    File "<pyshell#35>", line 1, in -toplevel-
>      d.Month
> TypeError: Object does not match target type.
>  >>>
> 
> The docs say the call to DateTime() should throw an 
> ArgumentOutOfRangeException. Instead, I get something that thinks it's a 
> DateTime, until I try to do anything with it.
> 
> Is this something that people have seen already?
> 
> I'm using Python 2.3.2, PythonNet 1.0b2
> 
> Thanks,
> xtian
> 
> 
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
> 



More information about the PythonDotNet mailing list