Skip to content

Conversation

Feyorsh
Copy link
Contributor

@Feyorsh Feyorsh commented Jul 24, 2025

(Tested on 4.14.1, unclear when this regression occurred.)

It appears context.timeout cannot be set in ~/.pwn.conf, even though the docs indicate that it can.

Example ~/.pwn.conf:

[context]
timeout = 10
$ python3 -c "from pwn import *"
[!] Unsupported configuration option 'timeout' in section 'context'
[!] Wrong value

This patch fixes this by adding float to the list of types that are allowable to be safeeval'd in update_context_defaults, which does not seem like it should cause issues (although I am new to the codebase, please correct me if I am mistaken).

Perhaps this has slid under the radar because timeout is the only member of context that is affected by this:

>>> import pwnlib
>>> [k for k,v in pwnlib.context.ContextType.defaults.items() if isinstance(v, float)]
['timeout']

This change functionally just allows setting `context.timeout` in
~/.pwn.conf.
@Feyorsh
Copy link
Contributor Author

Feyorsh commented Jul 24, 2025

This affects stable too, but with the transition away from six I think it's easier to land this in dev

@peace-maker
Copy link
Member

This seems like an oversight indeed. Thank you!

@peace-maker peace-maker merged commit d665644 into Gallopsled:dev Aug 6, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants