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

Pipfile failed to load when trying to lower() tomlkit's Bool object #183

Closed
felixonmars opened this issue Aug 28, 2019 · 1 comment · Fixed by #193
Closed

Pipfile failed to load when trying to lower() tomlkit's Bool object #183

felixonmars opened this issue Aug 28, 2019 · 1 comment · Fixed by #193
Labels
bug Something isn't working in progress

Comments

@felixonmars
Copy link
Contributor

This is what I get when I remove the capture-all except in ProjectFile.read(). Turns out tomlkit parses bool into a Bool object and trying to lower() it fails here. IMHO the if condition should be instance(str), since lower() can only work on that.

cls = <class 'requirementslib.models.pipfile.PipfileLoader'>
source = {'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': <tomlkit.items.Bool object at 0x7fec71f19110>}

    @classmethod
    def populate_source(cls, source):
        """Derive missing values of source from the existing fields."""
        # Only URL pararemter is mandatory, let the KeyError be thrown.
        if "name" not in source:
            source["name"] = get_url_name(source["url"])
        if "verify_ssl" not in source:
            source["verify_ssl"] = "https://" in source["url"]
        if not isinstance(source["verify_ssl"], bool):
>           source["verify_ssl"] = source["verify_ssl"].lower() == "true"
E           AttributeError: 'Bool' object has no attribute 'lower'

src/requirementslib/models/pipfile.py:118: AttributeError
@uranusjr
Copy link
Member

python-poetry/tomlkit#56

@techalchemy techalchemy added bug Something isn't working in progress labels Nov 23, 2019
techalchemy added a commit that referenced this issue Nov 23, 2019
- Point at new version of `pip-shims`
- Cut functionality over to rely on shimmed functions where possible
  - This includes in particular the resolver and finder access
- Update compatibility of VCS access
- Fixes #191
- Fix now-broken usage of `Link` objects (fixes #190)
- Fix test failures due to changes in the `pyparsing` api (fixes #181)
- Fix `Pipfile` loader by removing now-unneeded validation and relying
  on `plette` (fixes #182, fixes #189)
- Remove `plette` monkeypatches
- Fix failed attempts to call `.lower()` on the `validate_ssl` field in
  the `[[source]]` section of a `Pipfile` by casting it as a string
  (fixes #183)
- Fix failed calls to `Lockfile.as_requirements()` caused by attempting
  to set a property on an `InstallRequirement` that is no longer valid
  (fixes #188)
- Added support for hiding tokens even without separate user/password
  strings when they appear in a URL provided for a package (fixes #192)

Signed-off-by: Dan Ryan <dan@danryan.co>
techalchemy added a commit that referenced this issue Nov 23, 2019
- Point at new version of `pip-shims`
- Cut functionality over to rely on shimmed functions where possible
  - This includes in particular the resolver and finder access
- Update compatibility of VCS access
- Fixes #191
- Fix now-broken usage of `Link` objects (fixes #190)
- Fix test failures due to changes in the `pyparsing` api (fixes #181)
- Fix `Pipfile` loader by removing now-unneeded validation and relying
  on `plette` (fixes #182, fixes #189)
- Remove `plette` monkeypatches
- Fix failed attempts to call `.lower()` on the `validate_ssl` field in
  the `[[source]]` section of a `Pipfile` by casting it as a string
  (fixes #183)
- Fix failed calls to `Lockfile.as_requirements()` caused by attempting
  to set a property on an `InstallRequirement` that is no longer valid
  (fixes #188)
- Added support for hiding tokens even without separate user/password
  strings when they appear in a URL provided for a package (fixes #192)

Signed-off-by: Dan Ryan <dan@danryan.co>
techalchemy added a commit that referenced this issue Mar 31, 2020
- Point at new version of `pip-shims`
- Cut functionality over to rely on shimmed functions where possible
  - This includes in particular the resolver and finder access
- Update compatibility of VCS access
- Fixes #191
- Fix now-broken usage of `Link` objects (fixes #190)
- Fix test failures due to changes in the `pyparsing` api (fixes #181)
- Fix `Pipfile` loader by removing now-unneeded validation and relying
  on `plette` (fixes #182, fixes #189)
- Remove `plette` monkeypatches
- Fix failed attempts to call `.lower()` on the `validate_ssl` field in
  the `[[source]]` section of a `Pipfile` by casting it as a string
  (fixes #183)
- Fix failed calls to `Lockfile.as_requirements()` caused by attempting
  to set a property on an `InstallRequirement` that is no longer valid
  (fixes #188)
- Added support for hiding tokens even without separate user/password
  strings when they appear in a URL provided for a package (fixes #192)

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants