[IronPython] multiprocessing in 2.7
Romain Gilles
romain.gilles at gmail.com
Wed Mar 23 14:19:45 CET 2011
Ok,
I have patched the corresponding line:
19a20
> from System.Text import UTF8Encoding
283c284,288
< self._authkey = AuthenticationString(os.urandom(32))
---
> bytes = os.urandom(32)
> encoding=UTF8Encoding()
> if isinstance(bytes, str):
> bytes = encoding.GetBytes(bytes)
> self._authkey = AuthenticationString(bytes)
but who can I add to my IronPython the _multiprocessing module ?
------------------------------------------------------------------
c:\temp>ipy test-ipy-multiprocessing.py
Traceback (most recent call last):
File "test-ipy-multiprocessing.py", line 1, in <module>
File "c:\Program Files\IronPython
2.7\lib\site-packages\multiprocessing\__init__.py", line 83, in <module>
ImportError: No module named _multiprocessing
------------------------------------------------------------------
Maybe It cannot be resolved that way.
Regards,
Romain
2011/3/23 Davy Mitchell <daftspaniel at gmail.com>
> If it is a 'C' based extension then it won't directly work with IronPython.
>
> Maybe someone has a workaround / alternative?
>
> Cheers,
> Davy
>
> On 23 March 2011 10:23, Romain Gilles <romain.gilles at gmail.com> wrote:
> > Hi,
> > First of all thanks for your answer :). But after updated
> > my IRONPYTHONPATH as follow:
> > set IRONPYTHONPATH=c:\Python27\Lib
> > I get this error:
> > -----------------------------------------
> > c:\temp>ipy test-ipy-multiprocessing.py
> > Traceback (most recent call last):
> > File "test-ipy-multiprocessing.py", line 1, in <module>
> > File "c:\Python27\Lib\multiprocessing\__init__.py", line 63, in
> <module>
> > File "c:\Python27\Lib\multiprocessing\process.py", line 286, in
> <module>
> > File "c:\Python27\Lib\multiprocessing\process.py", line 283, in
> __init__
> > TypeError: expected IList[Byte], got str
> > -----------------------------------------
> > 2011/3/23 Oleksii Bidiuk <oleksii.bidiuk at gmail.com>
> >>
> >> Hi Romain,
> >> AFAIK you have to download the Python standard library separately. See
> >> e.g.
> http://www.ironpython.info/index.php/Using_the_Python_Standard_Library for
> >> examples (I've done it a while ago, so had to Google around a bit).
> >>
> >> 2011/3/23 Romain Gilles <romain.gilles at gmail.com>
> >>>
> >>> Hi all,
> >>> I'm trying to use this feature in ironpython. I just follow the first
> >>> sample:
> >>> --------------------------------------------
> >>> from multiprocessing import Process
> >>> def f(name):
> >>> print 'hello', name
> >>> if __name__ == '__main__':
> >>> p = Process(target=f, args=('bob',))
> >>> p.start()
> >>> p.join()
> >>> --------------------------------------------
> >>> But I get the following error when I'm executing it:
> >>> --------------------------------------------
> >>> c:\temp>ipy test-ipy-multiprocessing.py
> >>> Traceback (most recent call last):
> >>> File "test-ipy-multiprocessing.py", line 1, in <module>
> >>> ImportError: No module named multiprocessing
> >>> --------------------------------------------
> >>> Thanks for any help.
> >>> Regards.
> >>> Romain.
> >>> PS: I have just installed the last release of IronPython 2.7
> >>> --------------------------------------------
> >>> c:\temp>ipy -V
> >>> PythonContext 2.7.0.40 on .NET 4.0.30319.1
> >>> --------------------------------------------
> >>> _______________________________________________
> >>> Users mailing list
> >>> Users at lists.ironpython.com
> >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >>>
> >>
> >>
> >>
> >> --
> >> oleksii
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> >
>
>
>
> --
> --
> Davy's Blog - http://daftspaniel.wordpress.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110323/e9fa5827/attachment.html>
More information about the Ironpython-users
mailing list