Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New version of click (8.x.x) may have been causing an issue with cog_translate

See original GitHub issue

To re-create, run test:

$ pytest -k test_cog_translate_valid
rio_cogeo/ in cog_translate
    with click.progressbar(wind, file=fout, show_percent=True) as windows:  # type: ignore
.direnv/python-3.7.3/lib/python3.7/site-packages/click/ in __enter__
.direnv/python-3.7.3/lib/python3.7/site-packages/click/ in render_progress
    echo(self.label, file=self.file, color=self.color)
>       file.write(out)  # type: ignore
E       AttributeError: 'str' object has no attribute 'write'

.direnv/python-3.7.3/lib/python3.7/site-packages/click/ AttributeError

Locking down to click==7.1.2 seems to work around the issue:

$ pip install click==7.1.2
$ pytest -k test_cog_translate_valid
=============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.7.3, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/gcihj/Projects/_tools/rio-cogeo
plugins: cov-2.12.1
collected 74 items / 67 deselected / 7 selected

tests/ .......                                                                                                                                                 [100%]

================================================================================ warnings summary =================================================================================
  /Users/gcihj/.pyenv/versions/3.7.3/lib/python3.7/importlib/ RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
    return f(*args, **kwds)

  /Users/gcihj/Projects/_tools/rio-cogeo/rio_cogeo/ UserWarning: Non-standard compression schema: webp. The output COG might not be fully supported by software not build against latest libtiff.
    " supported by software not build against latest libtiff.".format(key)

-- Docs:
================================================================== 7 passed, 67 deselected, 2 warnings in 1.66s =====

Maybe a simple fix for now is to modify requirements.txt:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

ghelobytescommented, Jun 17, 2021


>>> import rio_cogeo, click, rasterio
>>> print(rio_cogeo.__version__)
>>> print(click.__version__)
>>> print(rasterio.__version__)
vincentsaragocommented, Jun 17, 2021

yep, I was going to push this fix! I’ll cc you in the PR and wait for your 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changes — Click Documentation (8.1.x)
Version 2.6¶. Released 2014-08-11. Fixed an issue where the wrapped streams on Python 3 would be reporting incorrect values for seekable.
Read more >
DTrack2 User Manual V2.12.0 ART DTrack 2.12
are ok). ... no one can stumble over the cords, ... the cords cannot be damaged, ... the cords cannot damage the cameras...
Read more >
... ... ...
Read more >
Dropped 02-29-2020-COM - Domain Data - NameDog
... ... ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found