From 1e2d9a270f6396e2f6cafebf0db681427fc9d3c0 Mon Sep 17 00:00:00 2001 From: Per Date: Tue, 1 Dec 2015 15:20:14 +0100 Subject: [PATCH] Make encoding regexp less strict Make the encoding detection regexp less strict so that it will detect the encoding of files that do not have a space between the "coding:" statement and the encoding value. Example: https://github.com/dateutil/dateutil/blob/master/dateutil/parser.py --- pymode/libs3/rope/base/fscommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymode/libs3/rope/base/fscommands.py b/pymode/libs3/rope/base/fscommands.py index 0ad79b53..ea1a061a 100644 --- a/pymode/libs3/rope/base/fscommands.py +++ b/pymode/libs3/rope/base/fscommands.py @@ -242,7 +242,7 @@ def read_str_coding(source): if not isinstance(source, str): source = source.decode("utf-8", "ignore") #TODO: change it to precompiled version - mex = re.search("\-\*\-\s+coding:\s+(.*?)\s+\-\*\-", source) + mex = re.search("\-\*\-\s+coding:\s*(.*?)\s+\-\*\-", source) if mex: return mex.group(1) return "utf-8" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy