You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
String functions lstrip are not working properly when you have escape sequence #70167
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-12-30.02:39:09.720>created_at=<Date2015-12-30.02:11:39.827>labels= ['invalid', 'type-bug', 'expert-2to3']
title='String functions lstrip are not working properly when you have escape sequence'updated_at=<Date2015-12-30.02:39:09.706>user='https://bugs.python.org/KiranKotari'
In this python code I am collecting list of folders present in the given location path with parent folder and print the folder names (output went wrong due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine.
"\c \e \n \ne \t \te" went wrong.
Folder Structure :
parent ->
cat
eat
east
next
nest
test
In this python code I am collecting list of folders present in the given location path with parent folder and print the folder names (output went wrong due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine.
"\c \e \n \ne \t \te" went wrong.
Activity
kirankotari commentedon Dec 30, 2015
In this python code I am collecting list of folders present in the given location path with parent folder and print the folder names (output went wrong due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine.
"\c \e \n \ne \t \te" went wrong.
Folder Structure :
parent ->
cat
eat
east
next
nest
test
Wrong Output :
Path: .\parent\, List: ['cat', 'st', '', 'st', 'xt', 'st']
kirankotari commentedon Dec 30, 2015
In this python code I am collecting list of folders present in the given location path with parent folder and print the folder names (output went wrong due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine.
"\c \e \n \ne \t \te" went wrong.
Python Code :
import glob as g
Folder Structure :
parent ->
cat
eat
east
next
nest
test
Wrong Output :
Path: .\parent\, List: ['cat', 'st', '', 'st', 'xt', 'st']
ethanfurman commentedon Dec 30, 2015
lstrip() works by removing any of the characters in its argument, in any order; for example:
'catchy'.lstrip('cat')
# 'hy'
'actchy'.lstrip('tac')
# 'hy'
is stripping, from the left, all 'c's and all 'a's and all 't's -- not just the first three, and order does not matter.
The docs: https://docs.python.org/3/library/stdtypes.html?highlight=lstrip#str.lstrip