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

fix: small InputSource related issues #2255

Merged
merged 1 commit into from
Mar 10, 2023

Commits on Mar 10, 2023

  1. fix: small InputSource related issues

    I have added a bunch of tests for `InputSource` handling, checking
    every kind of input source with every parser. During this, I detected
    the following issues that I fixed:
    
    - `rdflib.util._iri2uri()` was URL quoting the `netloc` parameter, but
      this is wrong and the `idna` encoding already takes care of special
      characters. I removed the URL quoting of `netloc`.
    
    - HexTuple parsing was handling the input source in a way that would
      only work for some input sources, and not raising errors for other
      input sources. I changed the input source handling to be more generic.
    
    - `rdflib.parser.create_input_source()` incorrectly used `file.buffer`
      instead of `source.buffer` when dealing with IO stream sources.
    
    Other changes with no runtime impact include:
    
    - Changed the HTTP mocking stuff in test slightly to accommodate
      serving arbitrary files, as I used this in the `InputSource` tests.
    - Don't use google in tests as we keep getting
      `urllib.error.HTTPError: HTTP Error 429: Too Many Requests`
      from it.
    aucampia committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    ec2e5c6 View commit details
    Browse the repository at this point in the history