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.

Title: sys.path.append causes wrong behaviour
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, rappy
Priority: normal Keywords:

Created on 2012-12-21 17:04 by rappy, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit rappy, 2012-12-21 17:04
Messages (2)
msg177881 - (view) Author: rappy (rappy) Date: 2012-12-21 17:04
In print gives

['C:\\Users\\Glenn\\Desktop', 'C:\\Windows\\system32\\', C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Users\\Glenn\\Documents\\ua\\mosis\x07ssignment6']

What it should give is

['C:\\Users\\Glenn\\Desktop', 'C:\\Windows\\system32\\', C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Users\\Glenn\\Documents\\ua\\mosis\assignment6']
msg177882 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2012-12-21 17:06
You have to either quote the backslashes or use raw strings:

>>> "\a"
>>> "\\a"
>>> r"\a"
Date User Action Args
2022-04-11 14:57:39adminsetgithub: 60948
2012-12-21 17:06:32christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg177882

resolution: not a bug
2012-12-21 17:04:11rappycreate