Oh, I see my mistake now. My reasoning about when strings are expanded was faulty and when writing the example in C#, I didn't notice the option to not expand environment strings. <div><br></div><div>Having said that, I'm still looking for a guideline about what to do in the scenario where the behaviour of IronPython is more 'correct' than CPython.<div>
<br></div><div>Richard<br><div><div><div><br><div class="gmail_quote">On Sun, Jan 16, 2011 at 8:35 PM, Steve Dower <span dir="ltr"><<a href="mailto:s.j.dower@gmail.com">s.j.dower@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Going by the Windows documentation, I would expect REG_EXPAND_SZ to<br>
_optionally_ expand when retrieving the value, but never expand when<br>
setting it.<br>
<br>
The main set of Windows functions don't expand the value - the type is<br>
only an indicator that it may contain environment variables. That<br>
said, the only reason you wouldn't expand it is if you need the value<br>
to be portable to another user/system (%APPDATA% comes to mind here),<br>
so it makes sense for things to be simplified here by default (IIRC<br>
there is one Win32 function that will expand it, probably exposed by<br>
the shell rather than the kernel).<br>
<br>
Of course, without an option to switch behaviour, you are guaranteed<br>
to upset somebody. </IMHO><br>
<div><div></div><div class="h5"><br>
On Mon, Jan 17, 2011 at 05:33, Richard Nienaber <<a href="mailto:rjnienaber@gmail.com">rjnienaber@gmail.com</a>> wrote:<br>
>> Hmmm... it is still probably worth filing an issue with CPython:<br>
>><br>
>> <a href="http://bugs.python.org/" target="_blank">http://bugs.python.org/</a><br>
><br>
> Will do.<br>
> On Sun, Jan 16, 2011 at 5:29 PM, Michael Foord <<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>><br>
> wrote:<br>
>><br>
>> On 16/01/2011 09:23, Richard Nienaber wrote:<br>
>><br>
>> I've closed the following issues:<br>
>> test blocking: support setting field of value type when calling ctor<br>
>> keyword argument is also treated as args for params array<br>
>> unable to invoke delegate object with method which takes ref args<br>
>> binder does not handle argument list with keyword and tuple correctly for<br>
>> .net methods<br>
>> tracking: wrong message when calling System.Activator.CreateInstance(None)<br>
>> clr.AddReference need invalidate the cached rules related to<br>
>> NamespaceTracker<br>
>> Questions:<br>
>><br>
>> Incompatibility between CPy and IPy in the way REG_EXPAND_SZ works in<br>
>> _winreg module.<br>
>><br>
>> It seems to me that in this case that IronPython was doing the right<br>
>> thing, and CPython was doing the wrong thing. REG_EXPAND_SZ seems to mean<br>
>> that environment variables should be expanded when the value is inserted<br>
>> into the registry. I've assumed here that even if CPython does the wrong<br>
>> thing, IronPython should follow the behaviour of CPython (and closed the<br>
>> issue).<br>
>><br>
>> Hmmm... it is still probably worth filing an issue with CPython:<br>
>><br>
>> <a href="http://bugs.python.org/" target="_blank">http://bugs.python.org/</a><br>
>><br>
>> All the best,<br>
>><br>
>> Michael<br>
>><br>
>> Code has recently been added to fix this issue: types in assemblies loaded<br>
>> with .AddReferenceToFileAndPath() are not importable if they reference other<br>
>> assemblies<br>
>><br>
>> Should I close this one as well or does this need to make it into a build<br>
>> first?<br>
>><br>
>> -X:PreferComDispatch<br>
>><br>
>> I have come across quite a few issues where there are inconsistencies when<br>
>> IronPython is started with/without the '-X:PreferComDispatch' switch (like<br>
>> this one). If I look at the IronPython console help this switch is absent<br>
>> and attempting to run it gives me the error 'File -X:PreferComDispatch does<br>
>> not exist.'. Is this option no longer available/supported? If not, what<br>
>> should be done with these issues?<br>
>><br>
>> Richard<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
>> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
>><br>
>><br>
>> --<br>
>> <a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br>
>><br>
>> May you do good and not evil<br>
>> May you find forgiveness for yourself and forgive others<br>
>> May you share freely, never taking more than you give.<br>
>> -- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
><br>
><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>