{"receipt_id":"agent1-1","seq":1,"branch_id":"agent1","kind":"command","cmd":"git ls-files -z","path":null,"exit_code":0,"stdout_tail":"c/memray/reporters/assets/common.test.js\u0000src/memray/reporters/assets/flamegraph.js\u0000src/memray/reporters/assets/flamegraph_common.js\u0000src/memray/reporters/assets/table.js\u0000src/memray/reporters/assets/temporal_flamegraph.js\u0000src/memray/reporters/flamegraph.py\u0000src/memray/reporters/frame_tools.py\u0000src/memray/reporters/stats.py\u0000src/memray/reporters/summary.py\u0000src/memray/reporters/table.py\u0000src/memray/reporters/templates/__init__.py\u0000src/memray/reporters/templates/assets/.gitattributes\u0000src/memray/reporters/templates/assets/flamegraph.css\u0000src/memray/reporters/templates/assets/flamegraph.js\u0000src/memray/reporters/templates/assets/flamegraph_common.js\u0000src/memray/reporters/templates/assets/table.css\u0000src/memray/reporters/templates/assets/table.js\u0000src/memray/reporters/templates/assets/temporal_flamegraph.js\u0000src/memray/reporters/templates/base.html\u0000src/memray/reporters/templates/classic_base.html\u0000src/memray/reporters/templates/flamegraph.html\u0000src/memray/reporters/templates/table.html\u0000src/memray/reporters/templates/temporal_flamegraph.html\u0000src/memray/reporters/transform.py\u0000src/memray/reporters/tree.css\u0000src/memray/reporters/tree.py\u0000src/memray/reporters/tui.css\u0000src/memray/reporters/tui.py\u0000src/vendor/libbacktrace/.gitignore\u0000src/vendor/libbacktrace/Isaac.Newton-Opticks.txt\u0000src/vendor/libbacktrace/LICENSE\u0000src/vendor/libbacktrace/Makefile.am\u0000src/vendor/libbacktrace/Makefile.in\u0000src/vendor/libbacktrace/README.md\u0000src/vendor/libbacktrace/aclocal.m4\u0000src/vendor/libbacktrace/alloc.c\u0000src/vendor/libbacktrace/allocfail.c\u0000src/vendor/libbacktrace/allocfail.sh\u0000src/vendor/libbacktrace/atomic.c\u0000src/vendor/libbacktrace/backtrace-supported.h.in\u0000src/vendor/libbacktrace/backtrace.c\u0000src/vendor/libbacktrace/backtrace.h\u0000src/vendor/libbacktrace/btest.c\u0000src/vendor/libbacktrace/compile\u0000src/vendor/libbacktrace/config.guess\u0000src/vendor/libbacktrace/config.h.in\u0000src/vendor/libbacktrace/config.sub\u0000src/vendor/libbacktrace/config/enable.m4\u0000src/vendor/libbacktrace/config/lead-dot.m4\u0000src/vendor/libbacktrace/config/libtool.m4\u0000src/vendor/libbacktrace/config/ltoptions.m4\u0000src/vendor/libbacktrace/config/ltsugar.m4\u0000src/vendor/libbacktrace/config/ltversion.m4\u0000src/vendor/libbacktrace/config/lt~obsolete.m4\u0000src/vendor/libbacktrace/config/multi.m4\u0000src/vendor/libbacktrace/config/override.m4\u0000src/vendor/libbacktrace/config/unwind_ipinfo.m4\u0000src/vendor/libbacktrace/config/warnings.m4\u0000src/vendor/libbacktrace/configure\u0000src/vendor/libbacktrace/configure.ac\u0000src/vendor/libbacktrace/debuginfod_support.h\u0000src/vendor/libbacktrace/dwarf.c\u0000src/vendor/libbacktrace/edtest.c\u0000src/vendor/libbacktrace/edtest2.c\u0000src/vendor/libbacktrace/elf.c\u0000src/vendor/libbacktrace/fileline.c\u0000src/vendor/libbacktrace/filenames.h\u0000src/vendor/libbacktrace/filetype.awk\u0000src/vendor/libbacktrace/install-debuginfo-for-buildid.sh.in\u0000src/vendor/libbacktrace/install-sh\u0000src/vendor/libbacktrace/instrumented_alloc.c\u0000src/vendor/libbacktrace/internal.h\u0000src/vendor/libbacktrace/libtool.m4\u0000src/vendor/libbacktrace/ltmain.sh\u0000src/vendor/libbacktrace/ltoptions.m4\u0000src/vendor/libbacktrace/ltsugar.m4\u0000src/vendor/libbacktrace/ltversion.m4\u0000src/vendor/libbacktrace/lt~obsolete.m4\u0000src/vendor/libbacktrace/macho.c\u0000src/vendor/libbacktrace/missing\u0000src/vendor/libbacktrace/mmap.c\u0000src/vendor/libbacktrace/mmapio.c\u0000src/vendor/libbacktrace/move-if-change\u0000src/vendor/libbacktrace/mtest.c\u0000src/vendor/libbacktrace/nounwind.c\u0000src/vendor/libbacktrace/pecoff.c\u0000src/vendor/libbacktrace/posix.c\u0000src/vendor/libbacktrace/print.c\u0000src/vendor/libbacktrace/read.c\u0000src/vendor/libbacktrace/simple.c\u0000src/vendor/libbacktrace/sort.c\u0000src/vendor/libbacktrace/state.c\u0000src/vendor/libbacktrace/stest.c\u0000src/vendor/libbacktrace/test-driver\u0000src/vendor/libbacktrace/test_format.c\u0000src/vendor/libbacktrace/testlib.c\u0000src/vendor/libbacktrace/testlib.h\u0000src/vendor/libbacktrace/ttest.c\u0000src/vendor/libbacktrace/unittest.c\u0000src/vendor/libbacktrace/unknown.c\u0000src/vendor/libbacktrace/xcoff.c\u0000src/vendor/libbacktrace/xztest.c\u0000src/vendor/libbacktrace/ztest.c\u0000src/vendor/libbacktrace_2446c66076480ce07a6bd868badcbceb3eeecc2e_debuginfod_patch.diff\u0000src/vendor/libbacktrace_2446c66076480ce07a6bd868badcbceb3eeecc2e_patch.diff\u0000src/vendor/regenerate_libbacktrace.sh\u0000tests/__init__.py\u0000tests/conftest.py\u0000tests/integration/__init__.py\u0000tests/integration/misbehaving_extension/__init__.py\u0000tests/integration/misbehaving_extension/misbehaving.cpp\u0000tests/integration/misbehaving_extension/setup.py\u0000tests/integration/multithreaded_extension/__init__.py\u0000tests/integration/multithreaded_extension/main.py\u0000tests/integration/multithreaded_extension/setup.py\u0000tests/integration/multithreaded_extension/testext.cpp\u0000tests/integration/native_extension/main.py\u0000tests/integration/native_extension/native_ext.c\u0000tests/integration/native_extension/setup.py\u0000tests/integration/rpath_extension/ext.c\u0000tests/integration/rpath_extension/setup.py\u0000tests/integration/rpath_extension/sharedlibs/sharedlib.c\u0000tests/integration/test_api.py\u0000tests/integration/test_attach.py\u0000tests/integration/test_extensions.py\u0000tests/integration/test_greenlet.py\u0000tests/integration/test_ipython.py\u0000tests/integration/test_main.py\u0000tests/integration/test_native_tracking.py\u0000tests/integration/test_processes.py\u0000tests/integration/test_socket.py\u0000tests/integration/test_threads.py\u0000tests/integration/test_tracing.py\u0000tests/integration/test_tracking.py\u0000tests/test_utils.py\u0000tests/unit/__init__.py\u0000tests/unit/__snapshots__/test_tree_reporter.ambr\u0000tests/unit/__snapshots__/test_tui_reporter.ambr\u0000tests/unit/conftest.py\u0000tests/unit/test_allocation_lifetime_aggregator.py\u0000tests/unit/test_attach.py\u0000tests/unit/test_cli.py\u0000tests/unit/test_flamegraph_reporter.py\u0000tests/unit/test_frame_tools.py\u0000tests/unit/test_high_water_mark_aggregator.py\u0000tests/unit/test_highwatermark_command.py\u0000tests/unit/test_reader.py\u0000tests/unit/test_stats_reporter.py\u0000tests/unit/test_summary_reporter.py\u0000tests/unit/test_table_reporter.py\u0000tests/unit/test_templates.py\u0000tests/unit/test_tracker.py\u0000tests/unit/test_transform_reporter.py\u0000tests/unit/test_tree_reporter.py\u0000tests/unit/test_tui_reporter.py\u0000tests/utils.py\u0000valgrind.supp\u0000webpack.config.js\u0000","stderr_tail":"","stdout_sha256":"fb203cd2b77a4df44c19482b42f0b7149ed30108799b0558344ac7adf62cfb34","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-1.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T17:17:32.421914Z","duration_s":0.003744,"timed_out":false,"image_before":"60731ef8-fab0-45e3-912e-25ab2b18dd29","image_after":"06644075-6aa2-4b30-8ba2-d9048a97b28b","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-2","seq":2,"branch_id":"agent1","kind":"write","cmd":"/opt/receipts-57a82f3e0f3846ba81bf308e957c3d34/bin/busybox sh -c 'mkdir -p /memray/src/memray/commands && cp /opt/receipts-57a82f3e0f3846ba81bf308e957c3d34/incoming/24828a4379f5eb75363fb65a4ef68591a92aaa5ab2edbf89bd39709b0577cb07 /memray/src/memray/commands/run.py'","path":"src/memray/commands/run.py","exit_code":0,"stdout_tail":"","stderr_tail":"","stdout_sha256":"24828a4379f5eb75363fb65a4ef68591a92aaa5ab2edbf89bd39709b0577cb07","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-2.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T17:17:47.828891Z","duration_s":0.005027,"timed_out":false,"image_before":"06644075-6aa2-4b30-8ba2-d9048a97b28b","image_after":"77e215c0-e357-499b-a13e-288b361ed39f","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-3","seq":3,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-4ea305eefb864989899b1f8ab061b279/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-4ea305eefb864989899b1f8ab061b279/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-3.xml","path":null,"exit_code":0,"stdout_tail":"============================= test session starts ==============================\nplatform linux -- Python 3.10.19, pytest-8.4.2, pluggy-1.6.0 -- /usr/local/bin/python\nrootdir: /memray\nconfigfile: pyproject.toml\nplugins: cov-7.0.0, textual-snapshot-1.1.0, syrupy-4.8.0\ncollecting ... collected 1 item\n\ntests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I] PASSED\n\n==================================== PASSES ====================================\n------------ generated xml file: /opt/receipts/reports/agent1-3.xml ------------\n=========================== short test summary info ============================\nPASSED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]\n============================== 1 passed in 0.44s ===============================\n","stderr_tail":"","stdout_sha256":"13fc5c2ffcb51dc1390f8bc408ed5d2a876535951af80f23f35795f69d8656e5","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-3.log","tree_digest":"9e0b5f5664b063268dc0755d8b86fee63b383ab1e6cb98d827195cc2c2747c0d","tree_download_s":29.260909542208537,"started_at":"2026-10-03T17:17:49.859200Z","duration_s":0.916315,"timed_out":false,"image_before":"77e215c0-e357-499b-a13e-288b361ed39f","image_after":"04ffdd72-5898-49e7-9f5f-aac96e1204a3","junit":{"passed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]"],"failed":[],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-4","seq":4,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-428ed7560f0541d79206c7b4cc6be059/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-428ed7560f0541d79206c7b4cc6be059/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-4.xml","path":null,"exit_code":1,"stdout_tail":"module[-I] _\n\nself = <tests.integration.test_main.TestRunSubcommand object at 0x7ffff5506710>\ntmp_path = PosixPath('/tmp/pytest-of-root/pytest-3/test_suppressing_sys_manipulat0')\nisolation_flag = '-I'\n\n    @pytest.mark.parametrize(\n        \"isolation_flag\", [\"-I\"] + ([\"-P\"] if sys.version_info > (3, 11) else [])\n    )\n    def test_suppressing_sys_manipulations_when_running_module(\n        self, tmp_path, isolation_flag\n    ):\n        # GIVEN\n        out_file = tmp_path / \"result.bin\"\n    \n        # WHEN\n>       proc = subprocess.run(\n            [\n                sys.executable,\n                isolation_flag,\n                \"-c\",\n                \"import sys; from memray.commands import main; sys.exit(main())\",\n                \"run\",\n                \"--quiet\",\n                \"--output\",\n                str(out_file),\n                \"-m\",\n                \"site\",\n            ],\n            check=True,\n            capture_output=True,\n            text=True,\n        )\n\ntests/integration/test_main.py:382: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ninput = None, capture_output = True, timeout = None, check = True\npopenargs = (['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', ...],)\nkwargs = {'stderr': -1, 'stdout': -1, 'text': True}\nprocess = <Popen: returncode: 10 args: ['/usr/local/bin/python', '-I', '-c', 'import s...>\nstdout = '/usr/local/lib/python3.10/site.py [--user-base] [--user-site]\\n\\nWithout arguments print some useful information\\nWit...d by user\\n  2 - user site directory is disabled by super user\\n      or for security reasons\\n >2 - unknown error\\n\\n'\nstderr = '', retcode = 10\n\n    def run(*popenargs,\n            input=None, capture_output=False, timeout=None, check=False, **kwargs):\n        \"\"\"Run command with arguments and return a CompletedProcess instance.\n    \n        The returned instance will have attributes args, returncode, stdout and\n        stderr. By default, stdout and stderr are not captured, and those attributes\n        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,\n        or pass capture_output=True to capture both.\n    \n        If check is True and the exit code was non-zero, it raises a\n        CalledProcessError. The CalledProcessError object will have the return code\n        in the returncode attribute, and output & stderr attributes if those streams\n        were captured.\n    \n        If timeout is given, and the process takes too long, a TimeoutExpired\n        exception will be raised.\n    \n        There is an optional argument \"input\", allowing you to\n        pass bytes or a string to the subprocess's stdin.  If you use this argument\n        you may not also use the Popen constructor's \"stdin\" argument, as\n        it will be used internally.\n    \n        By default, all communication is in bytes, and therefore any \"input\" should\n        be bytes, and the stdout and stderr will be bytes. If in text mode, any\n        \"input\" should be a string, and stdout and stderr will be strings decoded\n        according to locale encoding, or by \"encoding\" if set. Text mode is\n        triggered by setting any of text, encoding, errors or universal_newlines.\n    \n        The other arguments are the same as for the Popen constructor.\n        \"\"\"\n        if input is not None:\n            if kwargs.get('stdin') is not None:\n                raise ValueError('stdin and input arguments may not both be used.')\n            kwargs['stdin'] = PIPE\n    \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-3/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError\n------------ generated xml file: /opt/receipts/reports/agent1-4.xml ------------\n=========================== short test summary info ============================\nFAILED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]\n!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!\n============================== 1 failed in 0.49s ===============================\n","stderr_tail":"","stdout_sha256":"8fa6a2a3e97c3b4f291fe28419db753c7661f635dcae95cbb3e81634fdd9007a","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-4.log","tree_digest":"9e0b5f5664b063268dc0755d8b86fee63b383ab1e6cb98d827195cc2c2747c0d","tree_download_s":32.79691237513907,"started_at":"2026-10-03T17:18:27.609125Z","duration_s":0.981437,"timed_out":false,"image_before":"04ffdd72-5898-49e7-9f5f-aac96e1204a3","image_after":"b42fd9e0-d12c-42cc-ae65-271308eff49f","junit":{"passed":[],"failed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]"],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{"tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]":"[...]   \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-3/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError"}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-5","seq":5,"branch_id":"agent1","kind":"write","cmd":"/opt/receipts-156a97aec814457a9b67c16a54a7c5bb/bin/busybox sh -c 'mkdir -p /memray/src/memray/commands && cp /opt/receipts-156a97aec814457a9b67c16a54a7c5bb/incoming/27f7e85e5fedaa1533a4c71de7cbc25928143d8fee2147ec8d19ca78a7936896 /memray/src/memray/commands/run.py'","path":"src/memray/commands/run.py","exit_code":0,"stdout_tail":"","stderr_tail":"","stdout_sha256":"27f7e85e5fedaa1533a4c71de7cbc25928143d8fee2147ec8d19ca78a7936896","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-5.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T17:19:15.321151Z","duration_s":0.005328,"timed_out":false,"image_before":"b42fd9e0-d12c-42cc-ae65-271308eff49f","image_after":"adb51f55-87d1-47a7-ad45-0f530959cc5d","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-6","seq":6,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-90bb519b3d864b80a98821933a4ca9f8/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-90bb519b3d864b80a98821933a4ca9f8/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-6.xml","path":null,"exit_code":1,"stdout_tail":"module[-I] _\n\nself = <tests.integration.test_main.TestRunSubcommand object at 0x7ffff53d7760>\ntmp_path = PosixPath('/tmp/pytest-of-root/pytest-4/test_suppressing_sys_manipulat0')\nisolation_flag = '-I'\n\n    @pytest.mark.parametrize(\n        \"isolation_flag\", [\"-I\"] + ([\"-P\"] if sys.version_info > (3, 11) else [])\n    )\n    def test_suppressing_sys_manipulations_when_running_module(\n        self, tmp_path, isolation_flag\n    ):\n        # GIVEN\n        out_file = tmp_path / \"result.bin\"\n    \n        # WHEN\n>       proc = subprocess.run(\n            [\n                sys.executable,\n                isolation_flag,\n                \"-c\",\n                \"import sys; from memray.commands import main; sys.exit(main())\",\n                \"run\",\n                \"--quiet\",\n                \"--output\",\n                str(out_file),\n                \"-m\",\n                \"site\",\n            ],\n            check=True,\n            capture_output=True,\n            text=True,\n        )\n\ntests/integration/test_main.py:382: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ninput = None, capture_output = True, timeout = None, check = True\npopenargs = (['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', ...],)\nkwargs = {'stderr': -1, 'stdout': -1, 'text': True}\nprocess = <Popen: returncode: 10 args: ['/usr/local/bin/python', '-I', '-c', 'import s...>\nstdout = '/usr/local/lib/python3.10/site.py [--user-base] [--user-site]\\n\\nWithout arguments print some useful information\\nWit...d by user\\n  2 - user site directory is disabled by super user\\n      or for security reasons\\n >2 - unknown error\\n\\n'\nstderr = '', retcode = 10\n\n    def run(*popenargs,\n            input=None, capture_output=False, timeout=None, check=False, **kwargs):\n        \"\"\"Run command with arguments and return a CompletedProcess instance.\n    \n        The returned instance will have attributes args, returncode, stdout and\n        stderr. By default, stdout and stderr are not captured, and those attributes\n        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,\n        or pass capture_output=True to capture both.\n    \n        If check is True and the exit code was non-zero, it raises a\n        CalledProcessError. The CalledProcessError object will have the return code\n        in the returncode attribute, and output & stderr attributes if those streams\n        were captured.\n    \n        If timeout is given, and the process takes too long, a TimeoutExpired\n        exception will be raised.\n    \n        There is an optional argument \"input\", allowing you to\n        pass bytes or a string to the subprocess's stdin.  If you use this argument\n        you may not also use the Popen constructor's \"stdin\" argument, as\n        it will be used internally.\n    \n        By default, all communication is in bytes, and therefore any \"input\" should\n        be bytes, and the stdout and stderr will be bytes. If in text mode, any\n        \"input\" should be a string, and stdout and stderr will be strings decoded\n        according to locale encoding, or by \"encoding\" if set. Text mode is\n        triggered by setting any of text, encoding, errors or universal_newlines.\n    \n        The other arguments are the same as for the Popen constructor.\n        \"\"\"\n        if input is not None:\n            if kwargs.get('stdin') is not None:\n                raise ValueError('stdin and input arguments may not both be used.')\n            kwargs['stdin'] = PIPE\n    \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-4/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError\n------------ generated xml file: /opt/receipts/reports/agent1-6.xml ------------\n=========================== short test summary info ============================\nFAILED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]\n!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!\n============================== 1 failed in 0.49s ===============================\n","stderr_tail":"","stdout_sha256":"5b0beca18c3a65eae78c46e57feda26fc4ec35c681b370eba5fe41e954d8507e","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-6.log","tree_digest":"acad1920959b3c5947fd881fc92622cb4678aa52ff67e238ed28c0713cd7608d","tree_download_s":33.46045704209246,"started_at":"2026-10-03T17:19:18.054371Z","duration_s":0.971677,"timed_out":false,"image_before":"adb51f55-87d1-47a7-ad45-0f530959cc5d","image_after":"1103de46-c4f9-44f5-bcc5-c59274895048","junit":{"passed":[],"failed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]"],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{"tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]":"[...]   \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-4/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError"}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-7","seq":7,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-cfb75ed1e8774bc8a782899ad0dca7aa/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-cfb75ed1e8774bc8a782899ad0dca7aa/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]' 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]' 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_cmd[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-7.xml","path":null,"exit_code":1,"stdout_tail":"============================= test session starts ==============================\nplatform linux -- Python 3.10.19, pytest-8.4.2, pluggy-1.6.0 -- /usr/local/bin/python\nrootdir: /memray\nconfigfile: pyproject.toml\nplugins: cov-7.0.0, textual-snapshot-1.1.0, syrupy-4.8.0\ncollecting ... collected 3 items\n\ntests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I] FAILED\n\n=================================== FAILURES ===================================\n_ TestRunSubcommand.test_suppressing_sys_manipulations_when_running_script[-I] _\n\nself = <tests.integration.test_main.TestRunSubcommand object at 0x7ffff555c9a0>\ntmp_path = PosixPath('/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0')\nisolation_flag = '-I'\n\n    @pytest.mark.parametrize(\n        \"isolation_flag\", [\"-I\"] + ([\"-P\"] if sys.version_info > (3, 11) else [])\n    )\n    def test_suppressing_sys_manipulations_when_running_script(\n        self, tmp_path, isolation_flag\n    ):\n        # GIVEN\n        out_file = tmp_path / \"result.bin\"\n        target_file = tmp_path / \"test.py\"\n        target_file.write_text(\"import json, sys; print(json.dumps(sys.path))\")\n    \n        # WHEN\n        proc = subprocess.run(\n            [\n                sys.executable,\n                isolation_flag,\n                \"-m\",\n                \"memray\",\n                \"run\",\n                \"--quiet\",\n                \"--output\",\n                str(out_file),\n                str(target_file),\n                \"some\",\n                \"provided args\",\n            ],\n            check=True,\n            capture_output=True,\n            text=True,\n        )\n    \n        # THEN\n        assert out_file.exists()\n        assert proc.returncode == 0\n        # Running `python -m` did not put cwd in sys.path; ensure it isn't\n        # there, and neither is the tmp_path we would have replaced it with.\n        path = json.loads(proc.stdout)\n        assert os.getcwd() not in path\n>       assert str(tmp_path) not in path\nE       AssertionError: assert '/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0' not in ['/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0', '/usr/local/lib/python3.10', '/usr/local/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/site-packages', '/memray/src']\nE        +  where '/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0' = str(PosixPath('/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0'))\n\ntests/integration/test_main.py:338: AssertionError\n------------ generated xml file: /opt/receipts/reports/agent1-7.xml ------------\n=========================== short test summary info ============================\nFAILED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]\n!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!\n============================== 1 failed in 0.46s ===============================\n","stderr_tail":"","stdout_sha256":"798150478196fcd91769eca6f7ba345c49ce03f6a06e91f0e6234d607ed332e5","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-7.log","tree_digest":"acad1920959b3c5947fd881fc92622cb4678aa52ff67e238ed28c0713cd7608d","tree_download_s":71.16368058300577,"started_at":"2026-10-03T17:20:09.171193Z","duration_s":0.914589,"timed_out":false,"image_before":"1103de46-c4f9-44f5-bcc5-c59274895048","image_after":"6776b94f-1194-4d10-8cb1-b975e05a12bd","junit":{"passed":[],"failed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]"],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{"tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]":"[...]oot/pytest-5/test_suppressing_sys_manipulat0'))\nself = <tests.integration.test_main.TestRunSubcommand object at 0x7ffff555c9a0>\ntmp_path = PosixPath('/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0')\nisolation_flag = '-I'\n\n    @pytest.mark.parametrize(\n        \"isolation_flag\", [\"-I\"] + ([\"-P\"] if sys.version_info > (3, 11) else [])\n    )\n    def test_suppressing_sys_manipulations_when_running_script(\n        self, tmp_path, isolation_flag\n    ):\n        # GIVEN\n        out_file = tmp_path / \"result.bin\"\n        target_file = tmp_path / \"test.py\"\n        target_file.write_text(\"import json, sys; print(json.dumps(sys.path))\")\n    \n        # WHEN\n        proc = subprocess.run(\n            [\n                sys.executable,\n                isolation_flag,\n                \"-m\",\n                \"memray\",\n                \"run\",\n                \"--quiet\",\n                \"--output\",\n                str(out_file),\n                str(target_file),\n                \"some\",\n                \"provided args\",\n            ],\n            check=True,\n            capture_output=True,\n            text=True,\n        )\n    \n        # THEN\n        assert out_file.exists()\n        assert proc.returncode == 0\n        # Running `python -m` did not put cwd in sys.path; ensure it isn't\n        # there, and neither is the tmp_path we would have replaced it with.\n        path = json.loads(proc.stdout)\n        assert os.getcwd() not in path\n>       assert str(tmp_path) not in path\nE       AssertionError: assert '/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0' not in ['/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0', '/usr/local/lib/python3.10', '/usr/local/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/site-packages', '/memray/src']\nE        +  where '/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0' = str(PosixPath('/tmp/pytest-of-root/pytest-5/test_suppressing_sys_manipulat0'))\n\ntests/integration/test_main.py:338: AssertionError"}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-8","seq":8,"branch_id":"agent1","kind":"diff","cmd":"compute patch in executor staging agent1-f1189cb6660e4c6b8d1635e3a9c68594: /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false add -A && /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false diff --cached --binary --no-ext-diff --no-textconv --no-renames 771ef5266a0f63d30bfb244fbd0f950517f0c6a1","path":null,"exit_code":0,"stdout_tail":"diff --git a/src/memray/commands/run.py b/src/memray/commands/run.py\nindex 2808ade..e14fb81 100644\n--- a/src/memray/commands/run.py\n+++ b/src/memray/commands/run.py\n@@ -51,18 +51,25 @@ def _run_tracker(\n     with tracker:\n         pid = os.getpid()\n         try:\n+            # Determine if we should skip overwriting sys.argv[0]\n+            # due to isolated mode (-I) or plain mode (-P) which suppress\n+            # the interpreter's automatic path adjustments.\n+            skip_argv_overwrite = sys.flags.isolated or getattr(sys.flags, \"ignore_environment\", False)\n             if args.run_as_module:\n                 sys.path[0] = os.getcwd()\n                 # run_module will replace argv[0] with the script's path\n-                sys.argv = [\"\", *args.script_args]\n+                if not skip_argv_overwrite:\n+                    sys.argv = [\"\", *args.script_args]\n                 runpy.run_module(args.script, run_name=\"__main__\", alter_sys=True)\n             elif args.run_as_cmd:\n                 sys.path[0] = \"\"\n-                sys.argv = [\"-c\", *args.script_args]\n+                if not skip_argv_overwrite:\n+                    sys.argv = [\"-c\", *args.script_args]\n                 exec(args.script, {\"__name__\": \"__main__\"})\n             else:\n                 sys.path[0] = str(pathlib.Path(args.script).resolve().parent.absolute())\n-                sys.argv = [args.script, *args.script_args]\n+                if not skip_argv_overwrite:\n+                    sys.argv = [args.script, *args.script_args]\n                 runpy.run_path(args.script, run_name=\"__main__\")\n         finally:\n             if not args.quiet and post_run_message is not None and pid == os.getpid():\n","stderr_tail":"","stdout_sha256":"9f5aa076c147a00f134528b5ef25822420937377147d732113e4307f624d7595","log_path":null,"tree_digest":"acad1920959b3c5947fd881fc92622cb4678aa52ff67e238ed28c0713cd7608d","tree_download_s":32.53594645787962,"started_at":"2026-10-03T17:22:53.493770Z","duration_s":0.35903720813803375,"timed_out":false,"image_before":"6776b94f-1194-4d10-8cb1-b975e05a12bd","image_after":"6776b94f-1194-4d10-8cb1-b975e05a12bd","junit":null,"diff":{"files":[{"path":"src/memray/commands/run.py","added":10,"deleted":3,"category":"source","status":"modified"}],"patch_sha256":"9f5aa076c147a00f134528b5ef25822420937377147d732113e4307f624d7595","patch_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/artifacts/agent1/agent1-8.patch"},"patch_sha256":"9f5aa076c147a00f134528b5ef25822420937377147d732113e4307f624d7595","dropped_paths":[],"snapshot_sha":"771ef5266a0f63d30bfb244fbd0f950517f0c6a1"}
{"receipt_id":"agent1-9","seq":9,"branch_id":"agent1","kind":"write","cmd":"/opt/receipts-c8c763a14d144f66a53785f9bf99de99/bin/busybox sh -c 'mkdir -p /memray/src/memray/commands && cp /opt/receipts-c8c763a14d144f66a53785f9bf99de99/incoming/24828a4379f5eb75363fb65a4ef68591a92aaa5ab2edbf89bd39709b0577cb07 /memray/src/memray/commands/run.py'","path":"src/memray/commands/run.py","exit_code":0,"stdout_tail":"","stderr_tail":"","stdout_sha256":"24828a4379f5eb75363fb65a4ef68591a92aaa5ab2edbf89bd39709b0577cb07","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-9.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T17:25:05.988178Z","duration_s":0.00464,"timed_out":false,"image_before":"6776b94f-1194-4d10-8cb1-b975e05a12bd","image_after":"51d5b36b-a346-419d-8bc8-43e1a6f49d75","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-10","seq":10,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-7d09905638714f30b5adcb320b9ac639/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-7d09905638714f30b5adcb320b9ac639/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-10.xml","path":null,"exit_code":0,"stdout_tail":"============================= test session starts ==============================\nplatform linux -- Python 3.10.19, pytest-8.4.2, pluggy-1.6.0 -- /usr/local/bin/python\nrootdir: /memray\nconfigfile: pyproject.toml\nplugins: cov-7.0.0, textual-snapshot-1.1.0, syrupy-4.8.0\ncollecting ... collected 1 item\n\ntests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I] PASSED\n\n==================================== PASSES ====================================\n----------- generated xml file: /opt/receipts/reports/agent1-10.xml ------------\n=========================== short test summary info ============================\nPASSED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]\n============================== 1 passed in 0.44s ===============================\n","stderr_tail":"","stdout_sha256":"4e88ff1deeda5c99f913d21bfe3e97f30b2abf2cc36ffb7ab7bc646db1d4f49b","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-10.log","tree_digest":"9c8eb95a56735922de2f14dcc539e2e006f2b2efcd5bf063ba6af6d0df54df18","tree_download_s":33.328803290845826,"started_at":"2026-10-03T17:25:09.226816Z","duration_s":0.8993289999999999,"timed_out":false,"image_before":"51d5b36b-a346-419d-8bc8-43e1a6f49d75","image_after":"0f7f89be-3056-4e3a-803c-58311a1e53f4","junit":{"passed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_script[-I]"],"failed":[],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-11","seq":11,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-835ea5a18ee54f5ea21c6576013dad79/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-835ea5a18ee54f5ea21c6576013dad79/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-11.xml","path":null,"exit_code":1,"stdout_tail":"module[-I] _\n\nself = <tests.integration.test_main.TestRunSubcommand object at 0x7ffff555ea70>\ntmp_path = PosixPath('/tmp/pytest-of-root/pytest-7/test_suppressing_sys_manipulat0')\nisolation_flag = '-I'\n\n    @pytest.mark.parametrize(\n        \"isolation_flag\", [\"-I\"] + ([\"-P\"] if sys.version_info > (3, 11) else [])\n    )\n    def test_suppressing_sys_manipulations_when_running_module(\n        self, tmp_path, isolation_flag\n    ):\n        # GIVEN\n        out_file = tmp_path / \"result.bin\"\n    \n        # WHEN\n>       proc = subprocess.run(\n            [\n                sys.executable,\n                isolation_flag,\n                \"-c\",\n                \"import sys; from memray.commands import main; sys.exit(main())\",\n                \"run\",\n                \"--quiet\",\n                \"--output\",\n                str(out_file),\n                \"-m\",\n                \"site\",\n            ],\n            check=True,\n            capture_output=True,\n            text=True,\n        )\n\ntests/integration/test_main.py:382: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ninput = None, capture_output = True, timeout = None, check = True\npopenargs = (['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', ...],)\nkwargs = {'stderr': -1, 'stdout': -1, 'text': True}\nprocess = <Popen: returncode: 10 args: ['/usr/local/bin/python', '-I', '-c', 'import s...>\nstdout = '/usr/local/lib/python3.10/site.py [--user-base] [--user-site]\\n\\nWithout arguments print some useful information\\nWit...d by user\\n  2 - user site directory is disabled by super user\\n      or for security reasons\\n >2 - unknown error\\n\\n'\nstderr = '', retcode = 10\n\n    def run(*popenargs,\n            input=None, capture_output=False, timeout=None, check=False, **kwargs):\n        \"\"\"Run command with arguments and return a CompletedProcess instance.\n    \n        The returned instance will have attributes args, returncode, stdout and\n        stderr. By default, stdout and stderr are not captured, and those attributes\n        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,\n        or pass capture_output=True to capture both.\n    \n        If check is True and the exit code was non-zero, it raises a\n        CalledProcessError. The CalledProcessError object will have the return code\n        in the returncode attribute, and output & stderr attributes if those streams\n        were captured.\n    \n        If timeout is given, and the process takes too long, a TimeoutExpired\n        exception will be raised.\n    \n        There is an optional argument \"input\", allowing you to\n        pass bytes or a string to the subprocess's stdin.  If you use this argument\n        you may not also use the Popen constructor's \"stdin\" argument, as\n        it will be used internally.\n    \n        By default, all communication is in bytes, and therefore any \"input\" should\n        be bytes, and the stdout and stderr will be bytes. If in text mode, any\n        \"input\" should be a string, and stdout and stderr will be strings decoded\n        according to locale encoding, or by \"encoding\" if set. Text mode is\n        triggered by setting any of text, encoding, errors or universal_newlines.\n    \n        The other arguments are the same as for the Popen constructor.\n        \"\"\"\n        if input is not None:\n            if kwargs.get('stdin') is not None:\n                raise ValueError('stdin and input arguments may not both be used.')\n            kwargs['stdin'] = PIPE\n    \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-7/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError\n----------- generated xml file: /opt/receipts/reports/agent1-11.xml ------------\n=========================== short test summary info ============================\nFAILED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]\n!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!\n============================== 1 failed in 0.49s ===============================\n","stderr_tail":"","stdout_sha256":"cb137245b41acff9898f5308934aacd4d3e0872ae6735b3065f46dd91debdc05","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-11.log","tree_digest":"9c8eb95a56735922de2f14dcc539e2e006f2b2efcd5bf063ba6af6d0df54df18","tree_download_s":31.81703233392909,"started_at":"2026-10-03T17:25:52.107820Z","duration_s":0.972468,"timed_out":false,"image_before":"0f7f89be-3056-4e3a-803c-58311a1e53f4","image_after":"748eab7c-071f-4de9-96b9-e03e174b8cd0","junit":{"passed":[],"failed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]"],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{"tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_module[-I]":"[...]   \n        if capture_output:\n            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:\n                raise ValueError('stdout and stderr arguments may not be used '\n                                 'with capture_output.')\n            kwargs['stdout'] = PIPE\n            kwargs['stderr'] = PIPE\n    \n        with Popen(*popenargs, **kwargs) as process:\n            try:\n                stdout, stderr = process.communicate(input, timeout=timeout)\n            except TimeoutExpired as exc:\n                process.kill()\n                if _mswindows:\n                    # Windows accumulates the output in a single blocking\n                    # read() call run on child threads, with the timeout\n                    # being done in a join() on those threads.  communicate()\n                    # _after_ kill() is required to collect that and add it\n                    # to the exception.\n                    exc.stdout, exc.stderr = process.communicate()\n                else:\n                    # POSIX _communicate already populated the output so\n                    # far into the TimeoutExpired exception.\n                    process.wait()\n                raise\n            except:  # Including KeyboardInterrupt, communicate handled that.\n                process.kill()\n                # We don't call process.wait() as .__exit__ does that for us.\n                raise\n            retcode = process.poll()\n            if check and retcode:\n>               raise CalledProcessError(retcode, process.args,\n                                         output=stdout, stderr=stderr)\nE               subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-I', '-c', 'import sys; from memray.commands import main; sys.exit(main())', 'run', '--quiet', '--output', '/tmp/pytest-of-root/pytest-7/test_suppressing_sys_manipulat0/result.bin', '-m', 'site']' returned non-zero exit status 10.\n\n/usr/local/lib/python3.10/subprocess.py:526: CalledProcessError"}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-12","seq":12,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-bbbcaf0b33984594afac0875c7424568/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-bbbcaf0b33984594afac0875c7424568/receipts_pytest.py 'tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_cmd[-I]' -xvs -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-12.xml","path":null,"exit_code":0,"stdout_tail":"============================= test session starts ==============================\nplatform linux -- Python 3.10.19, pytest-8.4.2, pluggy-1.6.0 -- /usr/local/bin/python\nrootdir: /memray\nconfigfile: pyproject.toml\nplugins: cov-7.0.0, textual-snapshot-1.1.0, syrupy-4.8.0\ncollecting ... collected 1 item\n\ntests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_cmd[-I] PASSED\n\n==================================== PASSES ====================================\n----------- generated xml file: /opt/receipts/reports/agent1-12.xml ------------\n=========================== short test summary info ============================\nPASSED tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_cmd[-I]\n============================== 1 passed in 0.43s ===============================\n","stderr_tail":"","stdout_sha256":"39a9b1443fd7c6d5cb43726fd82fd016f0b910d183f9ed90a50de8f9e536167c","log_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/logs/agent1/agent1-12.log","tree_digest":"9c8eb95a56735922de2f14dcc539e2e006f2b2efcd5bf063ba6af6d0df54df18","tree_download_s":31.493851624894887,"started_at":"2026-10-03T17:26:35.996684Z","duration_s":0.9055249999999999,"timed_out":false,"image_before":"748eab7c-071f-4de9-96b9-e03e174b8cd0","image_after":"f070714e-548b-43e6-8b86-6a63f2d63628","junit":{"passed":["tests/integration/test_main.py::TestRunSubcommand::test_suppressing_sys_manipulations_when_running_cmd[-I]"],"failed":[],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-13","seq":13,"branch_id":"agent1","kind":"diff","cmd":"compute patch in executor staging agent1-3ea261bc37594105a9a0897969ab3af3: /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false add -A && /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false diff --cached --binary --no-ext-diff --no-textconv --no-renames 771ef5266a0f63d30bfb244fbd0f950517f0c6a1","path":null,"exit_code":0,"stdout_tail":"diff --git a/src/memray/commands/run.py b/src/memray/commands/run.py\nindex 2808ade..5f34d49 100644\n--- a/src/memray/commands/run.py\n+++ b/src/memray/commands/run.py\n@@ -51,18 +51,28 @@ def _run_tracker(\n     with tracker:\n         pid = os.getpid()\n         try:\n+            # Determine if we should skip sys.path/sys.argv modifications\n+            # due to isolated mode (-I) or plain mode (-P) which suppress\n+            # the interpreter's automatic path adjustments.\n+            skip_sys_mods = sys.flags.isolated or getattr(sys.flags, \"ignore_environment\", False)\n             if args.run_as_module:\n-                sys.path[0] = os.getcwd()\n+                if not skip_sys_mods:\n+                    sys.path[0] = os.getcwd()\n                 # run_module will replace argv[0] with the script's path\n-                sys.argv = [\"\", *args.script_args]\n+                if not skip_sys_mods:\n+                    sys.argv = [\"\", *args.script_args]\n                 runpy.run_module(args.script, run_name=\"__main__\", alter_sys=True)\n             elif args.run_as_cmd:\n-                sys.path[0] = \"\"\n-                sys.argv = [\"-c\", *args.script_args]\n+                if not skip_sys_mods:\n+                    sys.path[0] = \"\"\n+                if not skip_sys_mods:\n+                    sys.argv = [\"-c\", *args.script_args]\n                 exec(args.script, {\"__name__\": \"__main__\"})\n             else:\n-                sys.path[0] = str(pathlib.Path(args.script).resolve().parent.absolute())\n-                sys.argv = [args.script, *args.script_args]\n+                if not skip_sys_mods:\n+                    sys.path[0] = str(pathlib.Path(args.script).resolve().parent.absolute())\n+                if not skip_sys_mods:\n+                    sys.argv = [args.script, *args.script_args]\n                 runpy.run_path(args.script, run_name=\"__main__\")\n         finally:\n             if not args.quiet and post_run_message is not None and pid == os.getpid():\n","stderr_tail":"","stdout_sha256":"378d56459e5c616e00c7069ab397224a3d8481500fa2de5905b6744d2b5b63a7","log_path":null,"tree_digest":"9c8eb95a56735922de2f14dcc539e2e006f2b2efcd5bf063ba6af6d0df54df18","tree_download_s":26.7159002921544,"started_at":"2026-10-03T17:27:57.954213Z","duration_s":0.29310933290980756,"timed_out":false,"image_before":"f070714e-548b-43e6-8b86-6a63f2d63628","image_after":"f070714e-548b-43e6-8b86-6a63f2d63628","junit":null,"diff":{"files":[{"path":"src/memray/commands/run.py","added":16,"deleted":6,"category":"source","status":"modified"}],"patch_sha256":"378d56459e5c616e00c7069ab397224a3d8481500fa2de5905b6744d2b5b63a7","patch_path":"~/dev/nebius-hackathon/pilot/v2-P/bloomberg__memray-552/runs/pilot-bloomberg__memray-552-e7dba23977/artifacts/agent1/agent1-13.patch"},"patch_sha256":"378d56459e5c616e00c7069ab397224a3d8481500fa2de5905b6744d2b5b63a7","dropped_paths":[],"snapshot_sha":"771ef5266a0f63d30bfb244fbd0f950517f0c6a1"}
