This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author 007hengxyx
Recipients 007hengxyx, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-08-02.07:25:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501658745.81.0.821961109576.issue31101@psf.upfronthosting.co.za>
In-reply-to
Content
I need to remove a file in python at Windows2012R2, but, os.remove()auto add \ in each seq.

code:
#coding=utf-8
import os
dir_path='d:\c\d\e\t\c\t.xf'
os.remove(dir_path)


result:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 

Traceback (most recent call last):
  File "D:\test\script\test.py", line 4, in <module>
    os.remove(dir_path)
WindowsError: [Error 3] The system cannot find the path specified: 'd:\\c\\d\\e\t\\c\t.xf'
>>>
History
Date User Action Args
2017-08-02 07:25:45007hengxyxsetrecipients: + 007hengxyx, paul.moore, tim.golden, zach.ware, steve.dower
2017-08-02 07:25:45007hengxyxsetmessageid: <1501658745.81.0.821961109576.issue31101@psf.upfronthosting.co.za>
2017-08-02 07:25:45007hengxyxlinkissue31101 messages
2017-08-02 07:25:45007hengxyxcreate