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

Bugfix: Make click.progressbar work with codecs.open files #637

Closed
wants to merge 59 commits into from

Conversation

mina-asham
Copy link

  • codecs.open returns a StreamReaderWriter when used with encoding, this object doesn't have a __len__ attribute, so calling the len function on it result in an AttributeError instead of a TypeError
  • this will catch the AttributeError as well as the TypeError instead of only catching the later
  • Fixes: Progress bar doesn't work with codecs.open when using encoding #636

mitsuhiko and others added 30 commits November 25, 2015 10:09
Revert changes made to ``BadOptionUsage.__init__`` in
5f98f57. Additionally, store
``option_name`` on the exception instance to allow programmatic access
to it (this matches the behavior of several other exceptions) and
document the param in ``BadOptionUsage``'s docstring. Fixes pallets#474.
fix minor doc typo: "pf" -> "of"
Restore option_name parameter to BadOptionUsage
introduce int_types compat to fix python3 type error in _length_hint
Add the ability to hide commands and options from help
Fixed a typo in the advanced help docs
'resolve_path' suggests, that it will also call os.path.expanduser(), while in fact it does not.
Avoid confusion by stating this in the docstring of :class:`Path`.
untitaker and others added 22 commits April 4, 2016 18:38
issue pallets#393: Usage error should show there is a --help option
Removed unnecessary word.
fix external package broken link on CONTRIBUTING
- codecs.open returns a StreamReaderWriter when used with encoding, this object doesn't have a `__len__` attribute, so calling the `len` function on it result in an `AttributeError` instead of a `TypeError`
- this will catch the AttributeError as well as the TypeError instead of only catching the later
@untitaker untitaker changed the base branch from master to 6.x-maintenance August 19, 2016 15:06
@untitaker
Copy link
Contributor

Oops, sorry, I thought I could actually cherry-pick your commit with this new GitHub feature. I'll merge manually.

untitaker added a commit that referenced this pull request Aug 19, 2016
@untitaker
Copy link
Contributor

Manually applied, thanks!

@untitaker untitaker closed this Aug 19, 2016
pgkelley4 pushed a commit to pgkelley4/click that referenced this pull request Aug 20, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.