[IronPython] Bug when calling ironpythonconsole from powershell

Neville Bagnall neville.bagnall at propylon.com
Fri Jun 30 15:20:07 PDT 2006


In PowerShell drive names are far less restrictive:

PS C:\IronPython> Get-PSDrive

Name       Provider      Root
----       --------      ----
Alias      Alias
C          FileSystem    C:\
cert       Certificate   \
D          FileSystem    D:\
E          FileSystem    E:\
Env        Environment
Function   Function
HKCU       Registry      HKEY_CURRENT_USER
HKLM       Registry      HKEY_LOCAL_MACHINE
Variable   Variable

So when the parser sees -X:SaveAssemblies it thinks it is the  
"SaveAssemblies" item on the "-X" Drive.

If you enclose the item in quotes '-X:SaveAssemblies' the parser will  
interpret it as a string and pass it through.

PS C:\IronPython> .\IronPythonConsole.exe '-X:SaveAssemblies'
IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>>

"Interestingly", cmdlets do the right thing:

PS C:\IronPython> gci -r:0

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/06/2006     09:32       4580 FAQ.html
-a---        19/06/2006     13:53      47904 FePy.exe
-a---        19/06/2006     13:53      43808 IronMath.dll
-a---        19/06/2006     13:53    1174304 IronPython.dll
-a---        19/06/2006     13:53      47904 IronPythonConsole.exe
-a---        19/06/2006     13:53      43808 IronPythonWindow.exe
-a---        12/06/2006     09:32       2832 License.html
-a---        12/06/2006     09:32       5945 Readme.html
d----        20/06/2006     16:36            Doc
d----        30/06/2006     23:09            Lib
d----        20/06/2006     16:36            Src
d----        20/06/2006     16:36            Tutorial

PS C:\IronPython>

Probably because the parser gets the parameter information through  
reflection.



On Thu, 29 Jun 2006 22:48:14 +0100, Dino Viehland  
<dinov at exchange.microsoft.com> wrote:

> This actually sounds more like a PowerShell bug than an IronPython bug  
> (it's splitting a command line option or maybe : is a special character  
> in PowerShell?).
>
> I don't currently have PowerShell installed, but does \: instead of :  
> work (it's just a crazy guess that maybe it needs to be escaped).
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com  
> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jörgen Stenarson
> Sent: Wednesday, June 28, 2006 11:37 AM
> To: Discussion of IronPython
> Subject: [IronPython] Bug when calling ironpythonconsole from powershell
>
> Hi
>
> I have a problem calling ironpythonconsole from windows powershell using  
> the -X: options. Below are excerpts from sessions both in cmd.exe and
> powershell:
>
>  From cmd.exe:
> C:\IronPython>IronPythonConsole.exe -X:SaveAssemblies hej.py HELLO WORLD!
>
>
>  From windows powershell:
> PS C:\IronPython> IronPythonConsole.exe -X:SaveAssemblies hej.py File  
> -X: does not exist
>
> looks like there is some issue with commandline parsing.
>
>
> Best regards,
> Jörgen Stenarson
>
>
> _______________________________________________
> 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 users mailing list