Strip "\n" from end of OS version string for OS X.

If you don't, it ends up in the UserAgent header and you get an error
like:
Invalid header value 'CertbotACMEClient/0.8.0 (darwin 10.10.5\n)...'
This commit is contained in:
mrstanwell
2016-06-03 00:42:40 -05:00
parent b9ce09419f
commit ee622618a2
+1 -1
View File
@@ -325,7 +325,7 @@ def get_python_os_info():
os_ver = subprocess.Popen(
["sw_vers", "-productVersion"],
stdout=subprocess.PIPE
).communicate()[0]
).communicate()[0].rstrip('\n')
elif os_type.startswith('freebsd'):
# eg "9.3-RC3-p1"
os_ver = os_ver.partition("-")[0]