Code Monkey home page Code Monkey logo

Comments (7)

jayzeng avatar jayzeng commented on July 28, 2024

@vreen what version of Python do you use?

from scrapy-elasticsearch.

jayzeng avatar jayzeng commented on July 28, 2024

@vreen I pushed a new build, please give it a test and let me know (0aec4cc)

from scrapy-elasticsearch.

saplaum avatar saplaum commented on July 28, 2024

@jayzeng I am using Python 3.5.2
Your commit fixes the 'ListType' issue but heads to the next one:

Traceback (most recent call last):
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/twisted/internet/defer.py", line 587, in _runCallbacks
current.result = callback(current.result, _args, *_kw)
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/scrapyelasticsearch/scrapyelasticsearch.py", line 112, in process_item
self.index_item(item)
File "/home/spl/Code/python_env/myenv/lib/python3.5/site-packages/scrapyelasticsearch/scrapyelasticsearch.py", line 94, in index_item
item_id = hashlib.sha1(unique_key).hexdigest()
TypeError: Unicode-objects must be encoded before hashing

from scrapy-elasticsearch.

jayzeng avatar jayzeng commented on July 28, 2024

@vreen never tested it w/ Python 3, I will make whatever changes required to make it compatible. Stay tuned

from scrapy-elasticsearch.

jayzeng avatar jayzeng commented on July 28, 2024

@vreen pushed the fix 4c35d75 and cut a new release (0.8.5), give it a test and let me know if it works.

from scrapy-elasticsearch.

saplaum avatar saplaum commented on July 28, 2024

@jayzeng Line 94 has to be modified accordingly:
item_id = hashlib.sha1(unique_key.encode('utf-8')).hexdigest()

After that, this nice Pipeline works with Python 3.5!
Thanks for having an eye on this.

from scrapy-elasticsearch.

jayzeng avatar jayzeng commented on July 28, 2024

@vreen sorry I linked the wrong commit for the fix, here it is 8aa92f6, it is essentially the same as what you did, except it is added in the get_unique_key(), which is more appricate. Either way, I pushed my change to pypi, feel free to pull the latest.

Have fun :)

from scrapy-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.