Bug #2087

Windows: Serial port handle not freed after exception thrown in chirpw

Added by Patrick Lang about 6 years ago. Updated about 6 years ago.

Status:New Start date:11/30/2014
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Chirp Version:daily Platform:Windows
Model affected:(All models)

Description

If an exception is thrown from the radio class, the serial port is not closed. If you try to do another download or upload, then you will get an access denied error

C:\hg\chirp.hg>python chirpw
CHIRP 0.3.0dev on WinVista/7 (Python 2.7.8)
Registered Alinco_DR03T = DR03Radio
--- snipped ---
Registered Kenwood_TM-D710 = TMD710Radio
Registered Kenwood_TH-D72_live_mode = THD72Radio
Registered Kenwood_TM-V71 = TMV71Radio
Registered Kenwood_TH-K2 = THK2Radio
Registered Kenwood_TM-271 = TM271Radio
--- snipped ---
Registered Wouxun_KG-818 = KG818Radio
--- snipped ---
Skipping existing stock config
User selected Kenwood TM-D710 on port COM4
Trying ID at baud 9600
PC->RADIO: ID
D7->PC: ID TM-D710G
Traceback (most recent call last):
File "C:\hg\chirp.hg\chirpui\mainapp.py", line 1391, in mh
self.do_download(*args)
File "C:\hg\chirp.hg\chirpui\mainapp.py", line 663, in do_download
radio = settings.radio_class(ser)
File "C:\hg\chirp.hg\chirp\kenwood_live.py", line 126, in init
self.MODEL))
Exception: Radio reports TM-D710G (not TM-D710)
User selected Kenwood TM-D710 on port COM4
--- Exception Dialog: could not open port COM4: [Error 5] Access is denied. ---
Traceback (most recent call last):
File "C:\hg\chirp.hg\chirpui\mainapp.py", line 655, in do_download
timeout=0.25)
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 30, in init

SerialBase.__init__(self, *args, **kwargs)
File "C:\Python27\lib\site-packages\serial\serialutil.py", line 260, in init

self.open()
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
inError()))
SerialException: could not open port COM4: [Error 5] Access is denied.
----------------------------

History

Updated by Patrick Lang about 6 years ago

You can also hit the same issue with any Kenwood live mode device by going to "Download" twice

Also available in: Atom PDF