Fix doc: open file with "wb" mode will get an error in python 3

This commit is contained in:
yandongxu 2017-05-08 18:50:30 +08:00
parent 6c1cacb5d5
commit 4966dd7a7f
1 changed files with 2 additions and 3 deletions

View File

@ -107,7 +107,7 @@ format::
class JsonWriterPipeline(object):
def open_spider(self, spider):
self.file = open('items.jl', 'wb')
self.file = open('items.jl', 'w')
def close_spider(self, spider):
self.file.close()
@ -134,7 +134,7 @@ method and how to clean up the resources properly.::
import pymongo
class MongoPipeline(object):
collection_name = 'scrapy_items'
def __init__(self, mongo_uri, mongo_db):
@ -248,4 +248,3 @@ To activate an Item Pipeline component you must add its class to the
The integer values you assign to classes in this setting determine the
order in which they run: items go through from lower valued to higher
valued classes. It's customary to define these numbers in the 0-1000 range.