Skip to content

Invalid import in cache_lock.py – portalocker.exceptions does not exist #145

@daga05

Description

@daga05

We're encountering a runtime failure using msal-extensions==1.3.1 due to an invalid reference to portalocker.exceptions in cache_lock.py:

LockError = portalocker.exceptions.LockException

This causes authentication logic to break with:

AttributeError: module 'portalocker' has no attribute 'exceptions'

The current version of the portalocker package (e.g., 2.10.1) no longer exposes an exceptions module or attribute at the top level.

Suggested Fix:

Change the reference to:

import portalocker
LockError = portalocker.LockException

Confirmed Environment:

msal-extensions: 1.3.1
portalocker: 2.10.1
Python 3.11
Runtime: Azure App Service (Linux)

Please let us know if a fix can be included in the next release. We're happy to help validate or contribute a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions