GithubHelp home page GithubHelp logo

dcoles / snaketrace Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 0.0 32 KB

An strace-like tool for Python audit events 🐍

Home Page: https://pypi.org/project/snaketrace/

License: MIT License

Python 100.00%
python audit strace python-3-8 tracing

snaketrace's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snaketrace's Issues

import _pickle

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()

`import` events missing for modules used by snaketrace

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, …)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.