Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve Warning Categories & Stacklevels#3674

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Bibo-Joshi merged 10 commits intomasterfromwarnings-categories
Apr 27, 2023
Merged

Conversation

@Bibo-Joshi
Copy link
Member

@Bibo-JoshiBibo-Joshi commentedApr 21, 2023
edited
Loading

  • Fixed a few warning categories that were missed in API 6.6.
  • Unifies warning handling inBot andExtBot, ensuring that the stacklevel is correct for both
  • adds missing tests & modifies existing ones

TODO:

  • Update all warning tests to also check the category
  • Update tests to double check stacklevel in ExtBot vs Bot

@Bibo-JoshiBibo-Joshi self-assigned thisApr 21, 2023
@Bibo-JoshiBibo-Joshi added enhancement ⚙️ testsaffected functionality: tests labelsApr 21, 2023
Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nice catches

@Bibo-JoshiBibo-Joshi marked this pull request as ready for reviewApril 22, 2023 21:13
Copy link
Member

@lemontree210lemontree210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm obviously out of my depth here, but one typo I did catch! :)

@Bibo-Joshi
Copy link
MemberAuthor

Just a related note: stackleveling will get way more fun soon :Dhttps://github.com/python-telegram-bot/python-telegram-bot/projects/8#card-88970053

lemontree210 reacted with hooray emoji

* Fix typo* Make sure to only use the local information on stacklevel
Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

much more extensive testing, I like it

@Bibo-JoshiBibo-Joshi changed the titleImprove Warning CategoriesImprove Warning Categories & StacklevelsApr 24, 2023
@Bibo-Joshi
Copy link
MemberAuthor

While working on#3673 I noticed that the subscription access to attributes ofTelegramObject can mess with the stacklevel. Becausemessage["text_markdown"] callsmessage.__getitem__("text_markdown") that's one more function call meaning that the warning will originate from_telegramobject.py instead of the user code. I guess the only workaround for that would be to catch & reraise all warnings in__getitem__ and that's not really clean … IMO the use case is small enough to ignore. Just wanted to note it in the context of this PR :)

@harshil21
Copy link
Member

I wonder if there is a way to dynamically inspect the stacklevel and pass the correct value for cases like those...

@Bibo-Joshi
Copy link
MemberAuthor

@harshil21 I guess there isinspect.stack. I'm not so sure if I want to get the inspect module involved for this though ...

Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

lgtm

@Bibo-Joshi
Copy link
MemberAuthor

Test failures are unrelated - see#3685 and#3673. Merging.

@Bibo-JoshiBibo-Joshi merged commit3f444da intomasterApr 27, 2023
@Bibo-JoshiBibo-Joshi deleted the warnings-categories branchApril 27, 2023 20:36
@Bibo-JoshiBibo-Joshi mentioned this pull requestApr 27, 2023
15 tasks
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 5, 2023
@Bibo-JoshiBibo-Joshi added 🔌 enhancementpr description: enhancement and removed enhancement labelsNov 3, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@lemontree210lemontree210lemontree210 requested changes

@harshil21harshil21harshil21 approved these changes

Assignees

@Bibo-JoshiBibo-Joshi

Labels

🔌 enhancementpr description: enhancement⚙️ testsaffected functionality: tests

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@Bibo-Joshi@harshil21@lemontree210

[8]ページ先頭

©2009-2025 Movatter.jp