dcoles / snaketrace Goto Github PK
View Code? Open in Web Editor NEWAn strace-like tool for Python audit events 🐍
Home Page: https://pypi.org/project/snaketrace/
License: MIT License
An strace-like tool for Python audit events 🐍
Home Page: https://pypi.org/project/snaketrace/
License: MIT License
Same versions on Linux -> same symptom
PS ~/upstream/snaketrace> python --version
Python 3.9.0a5
PS ~/upstream/snaketrace> git describe --tags
v0.3.0-1-gdcf6ba4
PS ~/upstream/snaketrace> echo "from _pickle import PickleBuffer" > py.py
PS ~/upstream/snaketrace> python -m snaketrace py.py
open('py.py', 'r', 32896)
open('C:\Users\e.medve\upstream\snaketrace\py.py', 'r', 32896)
open('C:\Users\e.medve\upstream\snaketrace\py.py', 'r', 32896)
compile(b'from _pickle import PickleBuffer\r\n', 'py.py')
exec(<code object at 0x000001A08D2C3EA0, file "py.py", line 1>)
import('_pickle', None, ['C:\Users\e.medve\upstream\snaketrace', 'C:\Program Files\Python3\python39.zip', 'C:\Program Files\Python3\DLLs', 'C:\Program Files\Python3\lib', 'C:\Program Files\Python3', 'C:\Program Files\Python3\lib\site-packages'], [<class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>], [<class 'zipimport.zipimporter'>, <function FileFinder.path_hook..path_hook_for_FileFinder at 0x000001A08B141D30>])
import('_compat_pickle', None, ['C:\Users\e.medve\upstream\snaketrace', 'C:\Program Files\Python3\python39.zip', 'C:\Program Files\Python3\DLLs', 'C:\Program Files\Python3\lib', 'C:\Program Files\Python3', 'C:\Program Files\Python3\lib\site-packages'], [<class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>], [<class 'zipimport.zipimporter'>, <function FileFinder.path_hook..path_hook_for_FileFinder at 0x000001A08B141D30>])
open('C:\Program Files\Python3\lib\pycache\compat_pickle.cpython-39.pyc', 'r', 32896)
exec(<code object at 0x000001A08D2CB240, file "C:\Program Files\Python3\lib_compat_pickle.py", line 9>)
builtins.id(1789074909600)
open('C:\Users\e.medve\upstream\snaketrace\snaketrace\trace.py', 'r', 32896)
open('C:\Program Files\Python3\lib\runpy.py', 'r', 32896)
open('py.py', 'r', 32896)
Traceback (most recent call last):
File "C:\Users\e.medve\upstream\snaketrace\snaketrace\trace.py", line 71, in trace
runpy.run_path(name, globals, run_name='main')
File "C:\Program Files\Python3\lib\runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Program Files\Python3\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Program Files\Python3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "py.py", line 1, in
from _pickle import PickleBuffer
KeyError: '_compat_pickle'
cpython._PySys_ClearAuditHooks()
This can be reproduced with the following Python script:
import argparse
import ctypes
import sys
import fnmatch
import io
import glob
$ snaketrace -e import test.py
import('glob', None, …)
Expected behaviour:
$ snaketrace -e import test.py
import('argparse', None, …)
import('ctypes', None, …)
import('sys', None, …)
import('fnmatch', None, …)
import('io', None, …)
import('glob', None, …)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.