You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"is_native" check seems to be failing to catch TypeError which is returned by os.path.dirname(None)
I was running into this while profiling some native code, and it may be a python 3.8 or older system issue.
"~/.virtualenv/production/lib/python3.8/site-packages/scalene/scalene_analysis.py" 137L, 5125C 23,13 Top
File "/home/ubuntu/.virtualenv/production/lib/python3.8/site-packages/scalene/scalene_profiler.py", line 932, in output_profile
json_output = Scalene.__json.output_profiles(
File "/home/ubuntu/.virtualenv/production/lib/python3.8/site-packages/scalene/scalene_json.py", line 393, in output_profiles
imports = ScaleneAnalysis.get_native_imported_modules(code_str)
File "/home/ubuntu/.virtualenv/production/lib/python3.8/site-packages/scalene/scalene_analysis.py", line 93, in get_native_imported_modules
if ScaleneAnalysis.is_native(node.module):
File "/home/ubuntu/.virtualenv/production/lib/python3.8/site-packages/scalene/scalene_analysis.py", line 23, in is_native
package_dir = os.path.dirname(package.__file__)
File "/usr/lib/python3.8/posixpath.py", line 152, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
I fixed/worked around by adding the check for TypeError to scalene_analysis.py. I've got a PR on the way.
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
Please include a minimum working example if at all possible.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
If you have not yet tried with the repository version (python3 -m pip install git+https://github.com/plasma-umass/scalene), please try that before reporting.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
This should address #587 which has more information, but basically the check for native fails on at least my system because package.__file__ exists, but is None, so os.path.dirname() returns a TypeError.
Describe the bug
"is_native" check seems to be failing to catch
TypeError
which is returned byos.path.dirname(None)
I was running into this while profiling some native code, and it may be a python 3.8 or older system issue.
I fixed/worked around by adding the check for TypeError to scalene_analysis.py. I've got a PR on the way.
To Reproduce
Steps to reproduce the behavior:
Please include a minimum working example if at all possible.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
If you have not yet tried with the repository version (
python3 -m pip install git+https://github.com/plasma-umass/scalene
), please try that before reporting.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: