[IronPython] Silverlight, cannot import os module?

Michael Foord fuzzyman at voidspace.org.uk
Thu Apr 17 18:34:39 CEST 2008


Dan Eloff wrote:
> Actually, asside from os.linesep, (which could be easily replaced) I
> don't see anything that I would use, 
I don't see why you would need linesep as you have no access to the 
filesystem.

> it was primarily because I was
> trying to get linecache working in silverlight, but I gave up on that
> and used (yours? fuzzymans?) traceback module without linecache. It'd
> be nice to have os with almost no features for modules that import it,
> so that you can use their non-os-using parts, but I can't think of one
> real life example of a module like that.
>
>   

Creating a stub module for this purpose should be easy.

Michael

> -Dan
>
> On Thu, Apr 17, 2008 at 5:06 AM, Michael Foord
> <fuzzyman at voidspace.org.uk> wrote:
>   
>> Dan Eloff wrote:
>>  > I've added os.py and ntpath.py to my .xap, but the trouble is os uses
>>  > sys.builtin_module_names to detect platform, and there is no platform
>>  > specific module in there for silverlight.
>>  >
>>  > Maybe it is os.py (using CPython 2.5 version) that needs to be changed
>>  > to support a silverlight platform? Or to stop throwing when no
>>  > platform detected?
>>  >
>>  > Or maybe IronPython should have a minimal or empty nt builtin module
>>  > for silverlight, since probably that's the closest to the desired
>>  > behavior.
>>  >
>>  > Surely somebody else has come across this? I'm going to hack os.py for
>>  > now to allow me to continue past this.
>>  >
>>
>>  Out of interest - what features of os do you want to use?
>>
>>  You could post a bug on the Python tracker that os.py fails to import on
>>  platforms with no 'platform' (and mention that it is in SIlverlight). A
>>  patch would be good too.
>>
>>  Michael Foord
>>  http://www.ironpythoninaction.com/
>>
>>  > Thanks,
>>  > -Dan
>>  > _______________________________________________
>>  > Users mailing list
>>  > Users at lists.ironpython.com
>>  > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>  >
>>
>>  _______________________________________________
>>  Users mailing list
>>  Users at lists.ironpython.com
>>  http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>     
> _______________________________________________
> 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