Skip to content

Commit eeced40

Browse files
committed
Merge branch 'improved-wrapping-main' into update-wrapping-to-wrapt-for-sources
2 parents 44fafb1 + 1c48eaf commit eeced40

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

aikido_zen/sinks/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from wrapt import wrap_object, FunctionWrapper, when_imported
2-
32
from aikido_zen.background_process.packages import ANY_VERSION, is_package_compatible
43
from aikido_zen.errors import AikidoException
54
from aikido_zen.helpers.logging import logger

aikido_zen/sinks/http_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
@before
1414
def _putrequest(func, instance, args, kwargs):
15+
# putrequest(...) is called with path argument, store this on the HTTPConnection
16+
# instance for later use in the getresponse(...) function.
1517
path = get_argument(args, kwargs, 1, "path")
1618
setattr(instance, "_aikido_var_path", path)
1719

aikido_zen/sinks/os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def patch(m):
2828
- patches os.* functions that take in paths
2929
- patches os.path.* functions that take in paths
3030
- doesn't patch os.makedirs -> uses os.mkdir
31-
- doesn't patch os.path.realpath or os.path.abspath -> uses os.path.join
31+
- doesn't patch os.path.abspath -> uses os.path.join
3232
- doesn't patch os.path.exists and others -> to big of a performance impact
3333
- doesn't patch stat library https://docs.python.org/3/library/stat.html
3434
"""

aikido_zen/sinks/psycopg2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def patch(m):
1313
"""
1414
patching module psycopg2
1515
- patches psycopg2.connect
16-
Warning: cannot set 'execute' attribute of immutable type 'psycopg2.extensions.cursor'
16+
cannot set 'execute' attribute of immutable type 'psycopg2.extensions.cursor',
17+
so we create our own cursor factory to bypass this limitation.
1718
"""
1819
compatible = is_package_compatible(
1920
required_version="2.9.2", packages=["psycopg2", "psycopg2-binary"]

aikido_zen/sinks/shutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _shutil_func(func, instance, args, kwargs):
1616
op = f"shutil.{func.__name__}"
1717
if isinstance(source, str):
1818
vulns.run_vulnerability_scan(kind, op, args=(source,))
19-
if isinstance(source, str):
19+
if isinstance(destination, str):
2020
vulns.run_vulnerability_scan(kind, op, args=(destination,))
2121

2222

0 commit comments

Comments
 (0)