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

Failed to delete cookiefile: 'AlexaLogin' object has no attribute 'delete_cookiefile' #2470

Closed
danielbrunt57 opened this issue Aug 18, 2024 · 2 comments

Comments

@danielbrunt57
Copy link
Collaborator

Describe the bug

Failed to delete cookiefile: 'AlexaLogin' object has no attribute 'delete_cookiefile'

To Reproduce

Update AMP to v4.12.8

Expected behavior

No error when deleting the config entry

System details

  • Home-assistant (version):
    • 2024.8.2
  • alexa_media (version from const.py or HA startup):
    • v4.12.8
  • alexapy (version from pip show alexapy or HA startup):
    • v1.28.2
  • Amazon 2SV is enabled (y/n):
    • Y

Logs

Source: custom_components/alexa_media/__init__.py:1339

Failed to delete cookiefile: 'AlexaLogin' object has no attribute 'delete_cookiefile'

Solution (for now)

Edit /config/custom_components/alexa_media/__init__.py and comment out lines 1335 - 1342

        # Delete cookiefile
#        try:
#            await login_obj.delete_cookiefile()
#            _LOGGER.debug("Deleted cookiefile")
#        except Exception as ex:
#            _LOGGER.error(
#                "Failed to delete cookiefile: %s",
#                ex,
#            )

image

@danielbrunt57
Copy link
Collaborator Author

New code in PR #2471:

        # Delete cookiefile
        if callable(getattr(AlexaLogin,'delete_cookiefile', None)):
          try:
              await login_obj.delete_cookiefile()
              _LOGGER.debug("Deleted cookiefile")
          except Exception as ex:
              _LOGGER.error(
                  "Failed to delete cookiefile: %s",
                  ex,
              )
        else:
            _LOGGER.warn(
                "Could not remove cookiefile: /config/.storage/alexa_media.%s.pickle."
                "  Please manually delete the file.",
                email,
            )

@danielbrunt57
Copy link
Collaborator Author

Fixed in AMP v4.12.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant