From 0aaa74d2bd1460bacef9f88539469e1599b3cc39 Mon Sep 17 00:00:00 2001 From: Ping Yin Date: Thu, 22 Apr 2010 23:43:34 +0800 Subject: [PATCH] extract_regex: encoding arg defaults to 'utf-8' Sometimes it is not neccessary to pass the encoding argument. For example, when the text argument is unicode. So set a default encoding. Signed-off-by: Ping Yin --- scrapy/utils/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapy/utils/misc.py b/scrapy/utils/misc.py index 3fe1e4122..098bfdfa6 100644 --- a/scrapy/utils/misc.py +++ b/scrapy/utils/misc.py @@ -42,7 +42,7 @@ def load_object(path): return obj -def extract_regex(regex, text, encoding): +def extract_regex(regex, text, encoding='utf-8'): """Extract a list of unicode strings from the given text/encoding using the following policies: * if the regex contains a named group called "extract" that will be returned