Commit 455f2bd
Shrikant Giri
Use platform-specific path escaping with test evidence
Windows requires manual backslash replacement for repr() matching:
- repr() displays C:\Users as 'C:\Users' (double backslashes)
- Regex needs \\ to match \ (four backslashes in pattern)
- re.escape() only produces \ (matches single backslash)
Test evidence on Windows:
re.escape(path) in repr(path): None (fails)
path.replace('\', r'\\') in repr(path): Match (works)
Solution:
- Windows: Manual replacement for repr() double-escaping
- Unix: re.escape() for special character handling
Addresses @auvipy's review with detailed testing and explanation.1 parent 3400651 commit 455f2bd
1 file changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
171 | 197 | | |
172 | 198 | | |
173 | 199 | | |
| |||
192 | 218 | | |
193 | 219 | | |
194 | 220 | | |
195 | | - | |
| 221 | + | |
196 | 222 | | |
197 | 223 | | |
198 | 224 | | |
| |||
0 commit comments