Coder Social home page Coder Social logo

Comments (5)

tempname1024 avatar tempname1024 commented on August 15, 2024 1

jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'exit_count,1'

This is most likely due to an out-of-date Jinja2 install, update to 2.11.2. Should probably add a requirements.txt to ensure libraries are up to date.

urllib.error.HTTPError: HTTP Error 304: Not Modified

An HTTP 304 response indicates there has been no change (Not Modified) in the relay set since last execution, the date of which is derived from the timestamp file generated at runtime.

from allium.

tempname1024 avatar tempname1024 commented on August 15, 2024 1

Cool. I'd probably leave that code in though, it prevents regeneration of files when there hasn't been a change to the relay set.

Upgrade jinja with pip install --upgrade jinja2

from allium.

scriptzteam avatar scriptzteam commented on August 15, 2024
Traceback (most recent call last):
  File "generate.py", line 21, in <module>
    RELAY_SET = Relays()
  File "/home/allium/relays.py", line 55, in __init__
    self.json = self._fetch_onionoo_details()
  File "/home/allium/relays.py", line 77, in _fetch_onionoo_details
    api_response = urllib.request.urlopen(conn).read()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 304: Not Modified

from allium.

scriptzteam avatar scriptzteam commented on August 15, 2024

gonna try update jinja2

pip3 install --upgrade jinja2
Collecting jinja2
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 4.3 MB/s
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /usr/lib/python3/dist-packages (from jinja2) (1.1.0)
Installing collected packages: jinja2
  Attempting uninstall: jinja2
    Found existing installation: Jinja2 2.10.1
    Not uninstalling jinja2 at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'Jinja2'. No files were found to uninstall.
Successfully installed jinja2-2.11.2

also yeah, i tried this and problem gone

            with open(self.ts_file, 'r') as ts_file:
                prev_timestamp = ts_file.read()
            #headers = {"If-Modified-Since": prev_timestamp}
            #conn = urllib.request.Request(self.url, headers=headers)
            conn = urllib.request.Request(self.url)
        else:
            conn = urllib.request.Request(self.url)

from allium.

scriptzteam avatar scriptzteam commented on August 15, 2024

jinja2 upgrade helped, thx much!

from allium.

Related Issues (9)

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.