Skip to content

Fix getting callback params on py3.14+#1741

Merged
JrooTJunior merged 3 commits intoaiogram:dev-3.xfrom
andrew000:fix-callback-get-spec
Jan 1, 2026
Merged

Fix getting callback params on py3.14+#1741
JrooTJunior merged 3 commits intoaiogram:dev-3.xfrom
andrew000:fix-callback-get-spec

Conversation

@andrew000
Copy link
Contributor

Description

inspect.getfullargspec(callback) can't process callback if it's arguments have "ForwardRef" annotations in Py3.14+

This PR replaces the old way with inspect.signature(callback) and add annotation_format = annotationlib.Format.FORWARDREF argument to it if runtime python version >=3.14.

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Dec 10, 2025
@github-actions
Copy link

github-actions bot commented Dec 10, 2025

✔️ Changelog found.

Thank you for adding a description of the changes

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (79ee135) to head (90d9fda).
⚠️ Report is 1 commits behind head on dev-3.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1741   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          591       591           
  Lines        13985     13999   +14     
=========================================
+ Hits         13985     13999   +14     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
aiogram/dispatcher/event/handler.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrew000 andrew000 force-pushed the fix-callback-get-spec branch from b32ade9 to 1e4a650 Compare December 23, 2025 07:42
@andrew000 andrew000 force-pushed the fix-callback-get-spec branch from 0ec5546 to 37a5eee Compare December 23, 2025 07:55
@JrooTJunior JrooTJunior merged commit b27ca9a into aiogram:dev-3.x Jan 1, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Issue or PR for stable 3.x version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants