[IronPython] Bug report

Martin Maly Martin.Maly at microsoft.com
Mon Oct 1 17:19:25 CEST 2007

I don't believe it is a bug. Notice that when you appended C:\\bin, you used double  back-slash "\\", but when appending the C:\Windows\Bin you only used single backslash. Python standard then says:

Unlike Standard C, all unrecognized escape sequences are left in the string unchanged, i.e., the backslash is left in the string.

Therefore, the firs backslash "\w" is left in the string, but the 2nd one (\b) is replaced because it is a valid escape sequence (backspace).

You can use either r"C:\windows\bin" or "C:\\windows\\bin" to achieve what you need.


From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ???
Sent: Monday, July 16, 2007 12:38 AM
To: Dino Viehland; 'Discussion of IronPython'
Subject: [IronPython] Bug report

Hi Dino,  I met a IronPython bug, does this bug has been reported?

 IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.
>>> import sys
>>> sys.path.append("c:\\bin")
>>> sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin']
>>> sys.path.append("c:\windows")
>>> sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 'c:\\windows']
>>> sys.path.append("c:\windows\bin")
>>> sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 'c:\\windows', 'c:\\windows\x08in']

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20071001/646a4127/attachment.html>

More information about the Ironpython-users mailing list