提交 1cb841bf 编写于 作者: O orangain

PY3: Fix TypeError when outputting to stdout

This will fix #1768.
上级 e328a9b9
......@@ -10,6 +10,7 @@ import logging
import posixpath
from tempfile import TemporaryFile
from datetime import datetime
import six
from six.moves.urllib.parse import urlparse
from ftplib import FTP
......@@ -57,7 +58,9 @@ class BlockingFeedStorage(object):
@implementer(IFeedStorage)
class StdoutFeedStorage(object):
def __init__(self, uri, _stdout=sys.stdout):
def __init__(self, uri, _stdout=None):
if not _stdout:
_stdout = sys.stdout if six.PY2 else sys.stdout.buffer
self._stdout = _stdout
def open(self, spider):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册