Giter Club home page Giter Club logo

Comments (8)

seanbreckenridge avatar seanbreckenridge commented on June 14, 2024

Hey, I've pushed a new version (0.2.4) which allows you to pass the key file with the -k flag.

Upgrade like: pip3 install keepassxc-pwned --upgrade

Let me know if that doesn't work.

from keepassxc-pwned.

opensource-assist avatar opensource-assist commented on June 14, 2024

Hey, I've pushed a new version (0.2.4) which allows you to pass the key file with the -k flag.

Upgrade like: pip3 install keepassxc-pwned --upgrade

Let me know if that doesn't work.

I've updated keepassxc_pwned, but it hasn't worked out.
It spits out the following error message:

Traceback (most recent call last):
  File "/usr/local/bin/keepassxc_pwned", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/keepassxc_pwned/keepassxc_pwned.py", line 193, in main
    credentials: List[Credential] = parse_keepassxc_cli_xml(kdbx_db_location)
  File "/usr/local/lib/python3.9/site-packages/keepassxc_pwned/keepassxc_pwned.py", line 162, in parse_keepassxc_cli_xml
    for entry in filter(lambda g: g.tag == "Entry", group.getchildren()):
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

from keepassxc-pwned.

seanbreckenridge avatar seanbreckenridge commented on June 14, 2024

Could I ask what version of python/OS you're using?

Seems getchildren may be deprecated.

from keepassxc-pwned.

seanbreckenridge avatar seanbreckenridge commented on June 14, 2024

I pushed a fix to a different branch, could you try:

pip3 uninstall -y keepassxc-pwned
pip3 install git+https://github.com/seanbreckenridge/keepassxc-pwned@fix-deprecation

and run again?

from keepassxc-pwned.

opensource-assist avatar opensource-assist commented on June 14, 2024

@seanbreckenridge

Could I ask what version of python/OS you're using?

Seems getchildren may be deprecated.

Python 3.9.0a3+ on Debian Experimental

I pushed a fix to a different branch, could you try:

pip3 uninstall -y keepassxc-pwned
pip3 install git+https://github.com/seanbreckenridge/keepassxc-pwned@fix-deprecation

and run again?

It worked! merge it.
But at first it had some errors about api.pwnedpasswords.com not being resolved.
It was horrible, I found my bank account's password to be in the database.

from keepassxc-pwned.

seanbreckenridge avatar seanbreckenridge commented on June 14, 2024

at first it has some errors about api.pwnedpassword.com not being resolved

Do you still have the stacktrace? would be nice to catch/print a nicer error message

3.9 experimental

I added the 3.9-dev branch to the travis CI, so hopefully it catches deprecation like this in the future

bank account password in the database

well, at least now you know!

I'll merge this into master and push a new version to pypi shortly.

Thanks for reporting the issue 👍

from keepassxc-pwned.

opensource-assist avatar opensource-assist commented on June 14, 2024

@seanbreckenridge

Do you still have the stacktrace? would be nice to catch/print a nicer error message

Here it is:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 316, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 168, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fc2dc3ae460>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 640, in urlopen
    retries = retries.increment(method, url, error=e, _pool=self,
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.pwnedpasswords.com', port=443): Max retries exceeded with url: /range/385D0 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc2dc3ae460>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/keepassxc_pwned", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/keepassxc_pwned/keepassxc_pwned.py", line 197, in main
    sha1, count = lookup_pwned(c.password, logger)
  File "/usr/local/lib/python3.9/site-packages/keepassxc_pwned/password.py", line 40, in lookup_pwned
    res = request_password_hash(head, logger)
  File "/usr/local/lib/python3.9/site-packages/keepassxc_pwned/password.py", line 20, in request_password_hash
    res = requests.get(
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.pwnedpasswords.com', port=443): Max retries exceeded with url: /range/385D0 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc2dc3ae460>: Failed to establish a new connection: [Errno -2] Name or service not known'))

The issue got away after I manually ran host api.pwnedpasswords.com on my system.
I recommend the httpx Python library for doing networking.

from keepassxc-pwned.

seanbreckenridge avatar seanbreckenridge commented on June 14, 2024

I've pushed 0.2.5 to pypi, you can uninstall and reinstall from there.

I'll look into the request error/httpx, thanks again.

from keepassxc-pwned.

Related Issues (10)

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.