(22878) Scope the call to CloseHandle#1999
Conversation
|
Waiting for CLA signature by @mrwulf @mrwulf - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppetlabs.com/ Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppetlabs.com/community/trivial_patch_exemption.html |
|
This is a trivial change and doesn't require a cla.
|
|
Thanks for the patch! The win32-process gem used to extend Windows::Handle from the windows-pr gem, so that the C:\work\win32-process>git checkout master Branch master set up to track remote branch master from origin. Switched to a new branch 'master' C:\work\win32-process>ruby -r win32/process -e "Process.CloseHandle(0)" C:\work\win32-process> But newer version of the gem, based on ffi, and what we are shipping with puppet, doesn't do this: C:\work\win32-process>git checkout ffi Switched to branch 'ffi' C:\work\win32-process>ruby -r win32/process -e "Process.CloseHandle(0)" -e:1:in `': private method `CloseHandle' called for Process:Module (NoMethodError) Being explicit about which |
|
Your test and explanation are spot on. Thanks- I'm surprised this isn't affecting more people. Do you know when this Thanks for the patch! The win32-process gem used to extend C:\work\win32-process>git checkout master But newer version of the gem, based on ffi, and what we are shipping with C:\work\win32-process>git checkout ffi Being explicit about which CloseHandle we are using is a good thing™ — |
|
summary: this was cherry-picked onto stable in 7e3493b and merged up into master; this should be released in 3.4.0. Thanks for the contribution! |
Without this patch the ensure block calls a private method (throwing an error). By continuing the scope used in the main block the correct method is called.