Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediaing get-media str vs bytes issue #157

Open
danstoner opened this issue Apr 10, 2021 · 2 comments
Open

mediaing get-media str vs bytes issue #157

danstoner opened this issue Apr 10, 2021 · 2 comments
Assignees
Labels
python3 for issues specific to python3 conversion

Comments

@danstoner
Copy link
Contributor

2021-04-10 12:10:56.736 ERROR idb.mediaing჻ Unhandled error processing: https://herbarium.nkn.uidaho.edu/images/jpeg.php?Image=ID003067.jpg
Traceback (most recent call last):
  File "/home/dan/git/IDIGBIO/idb-backend/idigbio_ingestion/mediaing/fetcher.py", line 273, in get_media
    self.validate()
  File "/home/dan/git/IDIGBIO/idb-backend/idigbio_ingestion/mediaing/fetcher.py", line 335, in validate
    url=self.url, type=self.type, mime=self.mime)
  File "/home/dan/git/IDIGBIO/idb-backend/idb/postgres_backend/db.py", line 687, in frombuff
    return cls.fromobj(StringIO(buff), **attrs)
TypeError: initial_value must be str or None, not bytes
@danstoner danstoner added the python3 for issues specific to python3 conversion label Apr 10, 2021
@danstoner danstoner self-assigned this Apr 10, 2021
@danstoner
Copy link
Contributor Author

Reproduce with a command such as:

$ idigbio-ingestion -v  mediaing --prefix 'http://www.tropicos.org' get-media
2021-04-11 13:23:14.251 INFO  idb.mediaing჻ Started fetcher with User Agent string: 'iDigBio Media Ingestor ([email protected] https://www.idigbio.org/wiki/index.php/Media_Ingestor)'
2021-04-11 13:23:14.252 INFO  idb.mediaing჻ mediaing - run once mode
2021-04-11 13:23:28.044 INFO  idb.mediaing჻ Found 88577 urls to check
2021-04-11 13:23:28.227 INFO  idb.gevent_helpers჻ Closing all connections: 1
2021-04-11 13:23:28.675 ERROR idb.mediaing჻ Unhandled error processing: http://www.tropicos.org/ImageDownload.aspx?imageid=100000003
Traceback (most recent call last):
  File "/home/dan/git/IDIGBIO/idb-backend/idigbio_ingestion/mediaing/fetcher.py", line 272, in get_media
    self.validate()
  File "/home/dan/git/IDIGBIO/idb-backend/idigbio_ingestion/mediaing/fetcher.py", line 334, in validate
    url=self.url, type=self.type, mime=self.mime)
  File "/home/dan/git/IDIGBIO/idb-backend/idb/postgres_backend/db.py", line 687, in frombuff
    return cls.fromobj(StringIO(buff), **attrs)
TypeError: initial_value must be str or None, not bytes
^CKeyboardInterrupt
2021-04-11T17:23:30Z

Aborted!

@danstoner
Copy link
Contributor Author

Can't test at the moment due to infra issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python3 for issues specific to python3 conversion
Projects
None yet
Development

No branches or pull requests

1 participant