Dag Sverre Seljebotn wrote: > Robert wrote: >> Dag Sverre Seljebotn wrote: >>> Robert (not Bradshaw), can you perhaps submit the patch with the reload >>> stuff taken out for now? >> what is the time schedule? >> a new one is there: >> http://trac.cython.org/cython_trac/attachment/ticket/312/ >> http://trac.cython.org/cython_trac/attachment/ticket/312/pyxi3.patch > > A release candidate is dropped any time I get time for it, certainly > within the next 24 hours. After then this would have to go in 0.11.3 (it > might have to anyway, not sure yet). > >> did you with install(... reload_support=True) ? or without? > > With. > >> I just saw that on Linux you can (even without any >> Cython/pyximport) overwrite the .so, then reload(themodule) and: >> Bus error or Segfault. >> >> On Windows you cannot overwrite/remove/rename a loaded DLL file - >> and I (implicitly) relied on that - even when >> reload_support=False. The build,linking actually fails automatically. > > I will have to try your new patch, but don't think I'll get time before > the release. >
yes, its maybe too much a rush >> this is what implicitely happens/happened here with >> reload_support=True , loading from another temporary file - so far >> on Windows. Yet he iterated just upon the write blockage. Yet low >> level via imp.load_dynamic (no restriction on the shape of filename). >> ( The thing with extra python file is 95%+ not necessary I guess. >> As its a low level DLL/filesystem thing, not about the name in >> sys.modules or so) > > I find threads on the internet with people struggling with the PEP which > pyximport uses and reload functionality; I'm fairly sure it is more > complicated than this. > I've set up my Linux too now. That latest pyxi3.patch and it does. With reload_support=False its exactly like the old 0.11.1 behavior : >>> import my >>> reload(my) Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named my which is in my opinion bogus, because >>> reload(time) <module 'time' from '/usr/lib/python2.4/lib-dynload/time.so'> and with reload_support=True its now ok >>> my.f() from f 5 >>> reload(my) <module 'my' from '/home/www/.pyxbld/lib.linux-x86_64-2.4/my.so.reload1'> >>> reload(my) <module 'my' from '/home/www/.pyxbld/lib.linux-x86_64-2.4/my.so.reload1'> >>> reload(my) <module 'my' from '/home/www/.pyxbld/lib.linux-x86_64-2.4/my.so.reload1'> >>> reload(my) # changed the .pyx code here <<<<<<<<<<<< hello from pyx <module 'my' from '/home/www/.pyxbld/lib.linux-x86_64-2.4/my.so.reload2'> >>> my.f() from f 7 tried things in a few cases a dozen times. Think it was only that issue, that .so's are overwriteable. The reload of a different file with this imp-method is simply like a new module object (in other folder e.g.) (with same name). Guess it has not to do with this PEP. It crashed here before the patch (same as when I overwrote time.so and reload(time) ), and now not anymore. But more people should try on different installations ... When ok, I recommend to change the old&again reload_support=False behavior to do the same as normal reload(time) etc and not cause "ImportError: No module named my" in future. > I'd rather have a patch with only the configuration-file related changes, > otherwise this will definitely have to wait for the next release (if I was > less time-constrained I would have been kinder :-) ). > > (It's also nicer if you can use "hg export" to create the patches.) > have to learn this; never used .. Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
