Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 6
    we need more encompassing types of answers like that. thanks. Commented Jan 15, 2015 at 5:36
  • Does this work with os.sep at all? I'm trying to do this: patt = '^' + self.prefix + os.sep ; name = sub(decode_escapes(patt), '', name) and it's not working. Semicolon is there in place of a new line. Commented Feb 20, 2015 at 11:18
  • 1
    @Pureferret I'm not really sure what you're asking, but you probably shouldn't run this on strings where the backslash has a different meaning, such as Windows file paths. (Is that what your os.sep is?) If you have backslashed escape sequences in your Windows directory names, the situation is pretty much unrecoverable. Commented Feb 20, 2015 at 22:10
  • The escape sequence doesn't have escapes in them, but I'm getting a 'bogus escape string ' error Commented Feb 20, 2015 at 23:28
  • 1
    @MarkIngram Yes, I'm using Python 3. I don't understand the relevance of the example you posted, which is doing something unrelated to my code. My code doesn't use bytestrings at any step. Commented Jul 13, 2015 at 16:10