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
Describe the bug
I encountered an issue with the package where the open function defined in your code conflicts with Python's built-in open function. Here is the relevant part of your code:
defopen(process_id, debug=True, process_access=None):
"""Open a process given its process_id. By default, the process is opened with full access and in debug mode. https://msdn.microsoft.com/en-us/library/windows/desktop/ms684320%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa379588%28v=vs.85%29.aspx Parameters ---------- process_id: int The identifier of the process to be opened debug: bool If the process should be opened in debug mode process_access: pymem.ressources.structure.PROCESS Desired access level, defaulting to all access Returns ------- int A handle to the opened process """ifnotprocess_access:
process_access=pymem.ressources.structure.PROCESS.PROCESS_ALL_ACCESS.valueifdebug:
set_debug_privilege('SeDebugPrivilege', True)
process_handle=pymem.ressources.kernel32.OpenProcess(process_access, False, process_id)
returnprocess_handle
When I try to use Python's built-in open function within my code, it triggers an AttributeError: enter because Python uses the open function defined in your package instead of its own. This is causing compatibility issues with file operations.
Your Environment
Python 3.10.9
64-bit
pymem==1.13.1
Expected behavior
Traceback
Here's an example of the code that will trigger this error:
Additional context
This happens because the open function in pymem overrides the built-in open function. Renaming the open function in your package to something more specific (e.g., open_process) could resolve this conflict.
The text was updated successfully, but these errors were encountered:
Describe the bug
I encountered an issue with the package where the open function defined in your code conflicts with Python's built-in open function. Here is the relevant part of your code:
When I try to use Python's built-in open function within my code, it triggers an AttributeError: enter because Python uses the open function defined in your package instead of its own. This is causing compatibility issues with file operations.
Your Environment
Expected behavior
Traceback
Here's an example of the code that will trigger this error:
Error:
Stackoverflow explanation: https://stackoverflow.com/questions/53564755/python-error-attributeerror-enter
Additional context
This happens because the open function in pymem overrides the built-in open function. Renaming the open function in your package to something more specific (e.g., open_process) could resolve this conflict.
The text was updated successfully, but these errors were encountered: