-
Notifications
You must be signed in to change notification settings - Fork 19
Fix pywintypes error during the launch of the discovery service after a fresh install of MeasurementLink #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pywintypes error during the launch of the discovery service after a fresh install of MeasurementLink #397
Conversation
…ttps://github.com/ni/measurement-services-python into users/sam/fix-discoveryservicelaunch-onfreshInstall
5e8b73b to
75262fa
Compare
|
If we wanted to reproduce this locally and test the fix without having to do a fresh install, would you recommend just deleting the 'Logs' or 'Discovery' folder in programdata? |
Yes, we can terminate any existing running discovery service, delete the Note: Running without any debuggers makes it more easily reproducible |
9cb7cf5 to
81444bc
Compare
… a fresh install of MeasurementLink (#397) * Fix launching of discovery service during fresh install
… a fresh install of MeasurementLink (#397) * Fix launching of discovery service during fresh install
What does this Pull Request accomplish?
When attempting to open the discovery service key file after a fresh install of MeasurementLink (i.e., folders such as
DiscoveryandLogsare not present inC:\ProgramData\National Instruments\MeasurementLink\), thewinerror.ERROR_PATH_NOT_FOUNDexception was thrown because these directories were not present at the start. This exception hadn't been handled in_open_key_file(). This unhandled error resulted in the exception being thrown in the command prompt during the first run of a measurement service alone.To fix this issue, I have made the following changes based on the suggestions provided by @bkeryan.
_open_key_fileto translateERROR_PATH_NOT_FOUNDtoFileNotFoundError, which is handled by its caller (_start_service)_start_serviceto catchOSError._open_key_file(), I have translated all unexpectedwin32file.errorcodes toWindowsErrorWhy should this Pull Request be merged?
Fixes Bug 2514643: Auto-launching discovery service fails after clean install (GitHub Issue #369)
What testing has been done?
Added/Updated unit tests to test the fix.