URLs: changed paramter delimiter from / to ? and & as it is usual for URLs, update docs
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py
index a4deaef..d6ed458 100644
--- a/serial/urlhandler/protocol_spy.py
+++ b/serial/urlhandler/protocol_spy.py
@@ -165,13 +165,18 @@
formatter = FormatHexdump
color = False
output = sys.stderr
- for option, values in urlparse.parse_qs(parts.query, True).items():
- if option == 'dev':
- output = open(values[0], 'w')
- elif option == 'color':
- color = True
- elif option == 'raw':
- formatter = FormatRaw
+ try:
+ for option, values in urlparse.parse_qs(parts.query, True).items():
+ if option == 'dev':
+ output = open(values[0], 'w')
+ elif option == 'color':
+ color = True
+ elif option == 'raw':
+ formatter = FormatRaw
+ else:
+ raise ValueError('unknown option: %r' % (option,))
+ except ValueError as e:
+ raise SerialException('expected a string in the form "spy://port[?option[=value][&option[=value]]]": %s' % e)
self.formatter = formatter(output, color)
return ''.join([parts.netloc, parts.path])