Files
09fbd3a681 fix: replace bare except with except Exception (#2743)
* fix: improve exception handling in process.py and adb.py

- process.py: restore bare except with pylint disable (intentional: catches
  non-Exception errors during Python interpreter shutdown)
- adb.py: use specific (OSError, EOFError) instead of broad except Exception

* fix: add missing import for remote in adb.py

The bare except was silently catching NameError from the missing
remote import. Added 'from pwnlib.tubes.remote import remote' to
fix the actual underlying bug.

* docs: add changelog entry for PR #2743

* docs: move changelog reference link near 5.0.0 release section

* fix: catch PwnlibException in emulator AVD name lookup

The bare except was catching PwnlibException raised by remote() when
connection fails. Replacing with except (OSError, EOFError) caused
PwnlibException to propagate, potentially causing retry loops in
Android CI.

Fix by adding PwnlibException to the exception tuple.

* fix: prevent __getattr__ infinite recursion with context.device setter

When context.device setter accesses device.arch, it triggers AdbDevice's
__getattr__ (instead of the arch property). __getattr__ then calls
context.local(device=self), which triggers the setter again, causing
infinite recursion.

Fix: check if the attribute exists on the class via MRO.__dict__
before entering the context.local() path. This lets Python's normal
property resolution handle class-defined attributes.

* revert: remove __getattr__ MRO guard

Peace-maker correctly points out that __getattr__ is only called when
normal attribute lookup fails, so the MRO guard is unnecessary.
The infinite recursion is a pre-existing bug unrelated to this PR.

* Assign to `_avd` instead of `avd`

---------

Co-authored-by: mshzy <[email protected]>
Co-authored-by: peace-maker <[email protected]>
2026-06-27 23:42:54 +02:00
..
2026-02-20 10:48:42 +01:00
2017-01-20 18:59:23 -05:00