Skip to content

Commit 5a84bbf

Browse files
jamestiotioArusekk
authored andcommitted
Force ELF.path to be of type string (Gallopsled#2174)
This commit forces the `path` class variable of the `ELF` class to be of type string, even if a byte string argument is passed. This also makes the implementation consistent with the documentation, which states that `ELF.path` is of type `str`. Fixes Gallopsled#2166 Cherry-picked from 60af3a2 Signed-off-by: James Raphael Tiovalen <[email protected]>
1 parent 060746e commit 5a84bbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pwnlib/elf/elf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def __init__(self, path, checksec=True):
225225
super(ELF,self).__init__(self.mmap)
226226

227227
#: :class:`str`: Path to the file
228-
self.path = os.path.abspath(path)
228+
self.path = packing._need_text(os.path.abspath(path))
229229

230230
#: :class:`str`: Architecture of the file (e.g. ``'i386'``, ``'arm'``).
231231
#:

0 commit comments

Comments
 (0)