[IronPython] None in sys.path

Dino Viehland dinov at exchange.microsoft.com
Tue May 22 19:49:03 CEST 2007


Thanks for the report Michael.  I've opened bug #10474 for this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10474) and assigned it to the 2.0 Alpha 2 release for the time being.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
Sent: Friday, May 18, 2007 11:15 AM
To: Discussion of IronPython
Subject: [IronPython] None in sys.path

Hello all,

Weird pseudo-bug in IronPython 1.1.  If you accidentally (!) None into
sys.path then a failed import will raise a TypeError rather than an
ImportError:

 >>> import sys
 >>> sys.path.append(None)
 >>> import wibble
Traceback (most recent call last):
  File , line 0, in <stdin>##81
  File , line 0, in __import__##4
  File mscorlib, line unknown, in Combine
TypeError: Value cannot be null.
Parameter name: path1
 >>>

CPython is resilient against this, ignoring the entry. Maybe this isn't
exactly a *bug* in IronPython - but it was the cause of a problem that
took us a while to find... :-)

Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list