Gallopsled / pwntools

CTF framework and exploit development library
http://pwntools.com
Other
11.69k stars 1.67k forks source link

`xor` function raises `TypeError: pop expected at least 1 argument, got 0` #2390

Closed marinelay closed 2 months ago

marinelay commented 2 months ago

https://github.com/Gallopsled/pwntools/blob/5981c7290dd5190733c1f2e9ccf08633869f8b31/pwnlib/util/fiddling.py#L306-L330

At line 330, it raises the type error TypeError: pop expected at least 1 argument, got 0 because pop method cannot be used without arguments.

I believe that it should be fixed to report proper error message.

Arusekk commented 2 months ago

The code looks as if the intention was always to use popitem; anyway, when we finally drop py2 support, we could finally use keyword-only arguments here to get rid of all of this boilerplate.

Have you spotted more such uses throughout the code?

marinelay commented 2 months ago

I couldn't find any other occurrences for dict.pop like this issue