I am using following code
str = fnmatch.translate(u'ö')
print str
But it prints out as
'\ö'
Is there something I am missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The purpose of fnmatch.translate is to turn a shell pattern into a regular expression. Adding a backslash in front of non-ascii characters may not be as terse as possible, but it still works as a regular expression properly:
The backslash has a special meaning only when it precedes certain characters (e.g. numbers,
A,b,B,d, …) If it precedes other characters, such as'ö', the backslash is ignored.