[New-bugs-announce] [issue17366] os.chdir win32

Dave Humphries report at bugs.python.org
Wed Mar 6 08:20:02 CET 2013


New submission from Dave Humphries:

os.chdir missed a back slash in rewriting a file path see example below (the extra backslash was missing from the trunk directory). 
Modifying the path with an extra slash enabled this to work for some reason. (os windows 8 64 bit Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 :
spyder console output:
>>> os.chdir("C:\Projects\trunk\BusPirate\dangerous-prototypes-open-hardware-read-only\Bus_Pirate\scripts\pyBusPirateLite")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 123] The filename, directory name or volume label syntax is incorrect: 'C:\\Projects\trunk\\BusPirate\\dangerous-prototypes-open-hardware-read-only\\Bus_Pirate\\scripts\\pyBusPirateLite'
>>> os.chdir("C:\Projects\\trunk\BusPirate\dangerous-prototypes-open-hardware-read-only\Bus_Pirate\scripts\pyBusPirateLite")
>>> from pyBusPirateLite.SPI import *

----------
components: Windows
messages: 183582
nosy: DaveH
priority: normal
severity: normal
status: open
title: os.chdir win32
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17366>
_______________________________________


More information about the New-bugs-announce mailing list