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

[FW][FIX] profiler: manage frame without lineno #98212

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Aug 16, 2022

In some cases the frame may have a filename and corresponding file but
no lineno. This may lead to an error

File ".../odoo/tools/profiler.py", line 571, in _add_file_lines
line = filelines[lineno - 1]
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

This commit simply fixes this by skipping the logic if we have no lineno

Forward-Port-Of: #98168

In some case the frame may have a filename and corresponding file but
no lineno. This may lead to an error

File ".../odoo/tools/profiler.py", line 571, in _add_file_lines
    line = filelines[lineno - 1]
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

This commit simply fixes this by skipping the logic if we have no lineno.

X-original-commit: 44715af
@robodoo
Copy link
Contributor

robodoo commented Aug 16, 2022

@fw-bot
Copy link
Contributor Author

fw-bot commented Aug 16, 2022

This PR targets saas-15.4 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Aug 16, 2022
@C3POdoo C3POdoo added the RD research & development, internal work label Aug 16, 2022
robodoo pushed a commit that referenced this pull request Aug 17, 2022
In some case the frame may have a filename and corresponding file but
no lineno. This may lead to an error

File ".../odoo/tools/profiler.py", line 571, in _add_file_lines
    line = filelines[lineno - 1]
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

This commit simply fixes this by skipping the logic if we have no lineno.

closes #98212

X-original-commit: 44715af
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
@robodoo robodoo temporarily deployed to merge August 17, 2022 09:37 Inactive
@robodoo robodoo closed this Aug 17, 2022
@fw-bot fw-bot deleted the saas-15.4-15.0-profiler-lineo-fix-xdo-_sGU-fw branch August 31, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants