Source: python-oauth2client
Severity: important

Dear Maintainer,

Building (or running autopkgtest) for python-oauth2client against flask
3.0 leads to an error when running the test-suite:

  Traceback:
  oauth2client/contrib/flask_util.py:173: in <module>
      from flask import _app_ctx_stack
  E   ImportError: cannot import name '_app_ctx_stack' from 'flask' 
(/usr/lib/python3/dist-packages/flask/__init__.py)

With previous versions of flask, the same code would produce a warning
instead:

  oauth2client/contrib/flask_util.py:173: DeprecationWarning: '_app_ctx_stack' 
is deprecated and will be removed in Flask 2.3.

Flask decided to remove the deprecated _app_ctx_stack [1] in 3.0.0. The
recommended approach is to "use 'g' to store data instead."

Quote from Version 2.2.0 changelog [2]:

> The app and request contexts are managed using Python context vars directly 
> rather than Werkzeug’s LocalStack. This should result in better performance 
> and memory use. #4682
> 
>     Extension maintainers, be aware that _app_ctx_stack.top and 
> _request_ctx_stack.top are deprecated. Store data on g instead using a unique 
> prefix, like g._extension_name_attr.
> 

Nowadays oauth2client is marked deprecated [3] and the upstream repository [4]
has been read only for four years.

NOTE: When building with python3.12, there are other errors but they have
already been reported as part of bug 1058392 [5]

Thank you

[1] https://github.com/pallets/flask/pull/5223
[2] https://flask.palletsprojects.com/en/2.3.x/changes/#version-2-2-0
[3] https://google-auth.readthedocs.io/en/latest/oauth2client-deprecation.html
[4] https://github.com/googleapis/oauth2client
[5] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058392

-- System Information:
Debian Release: trixie/sid
  APT prefers mantic-updates
  APT policy: (500, 'mantic-updates'), (500, 'mantic-security'), (500, 
'mantic'), (100, 'mantic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-16-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to