Giter VIP home page Giter VIP logo

Comments (1)

valeriupredoi avatar valeriupredoi commented on August 26, 2024

OK I ended up spending a good part of today going down this rabbit hole 🐰

I have now isolated a minimal test case that replicates the issue: ruun this bit of code:

from defusedxml import ElementTree as ET


def parse_httpresponse():
    """Parse an HTTPResponse into xml."""
    xml = ET.parse("response.html")

parse_httpresponse()

where response.html is the API response from the example website in the failing test:

<!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ESGF MetaGrid</title><script async src="https://www.googletagmanager.com/gtag/js?id=G-515H3RKZYX"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-515H3RKZYX")</script><script defer="defer" src="/static/js/main.e7481ee3.js"></script><link href="/static/css/main.df7af308.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

This replicates exactly the test fail. Problem is, I have no idea why - moreover, test fail happens or doesn't with identical deps and envs (well, there are a couple deps that differ but those don't matter - see below the differing deps): deps that differ between an env with no test fail vs one with test fail:

3c3
<     + alabaster                            0.7.15  pyhd8ed1ab_0        conda-forge/noarch        19kB
---
>     + alabaster                            0.7.13  pyhd8ed1ab_0        conda-forge/noarch        18kB
26c26
<     + flake8                                7.0.0  pyhd8ed1ab_0        conda-forge/noarch       111kB
---
>     + flake8                                6.1.0  pyhd8ed1ab_0        conda-forge/noarch       112kB
35c35
<     + ipython                              8.20.0  pyh707e725_0        conda-forge/noarch       591kB
---
>     + ipython                              8.19.0  pyh707e725_0        conda-forge/noarch       591kB
41c41
<     + jupyter_core                          5.7.1  py312h7900ff3_0     conda-forge/linux-64      94kB
---
>     + jupyter_core                          5.7.0  py312h7900ff3_0     conda-forge/linux-64      92kB
86c86
<     + pyflakes                              3.2.0  pyhd8ed1ab_0        conda-forge/noarch        59kB
---
>     + pyflakes                              3.1.0  pyhd8ed1ab_0        conda-forge/noarch        58kB
98c98
<     + referencing                          0.32.1  pyhd8ed1ab_0        conda-forge/noarch        39kB
---
>     + referencing                          0.32.0  pyhd8ed1ab_0        conda-forge/noarch        39kB
122c122
<     + wcwidth                              0.2.13  pyhd8ed1ab_0        conda-forge/noarch        33kB
---
>     + wcwidth                              0.2.12  pyhd8ed1ab_0        conda-forge/noarch        32kB

Even so, I have resolved these differences and the test still fails for me (locally). My only take is that the HTTPResponse has changed (its body) from 3 weeks ago - problem is, I don't know what a right response should look like (one that can be parsed correctly) since I barely speak any HTML at all, @bouweandela any ideas?

from esgf-pyclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.