Closed tysonclugg closed 6 years ago
Coveralls failed to run in Travis with the following error:
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. The next version of cryptography will drop support for Python 2.6
DeprecationWarning
Submitting coverage to coveralls.io...
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.6.9/bin/coveralls", line 11, in <module>
sys.exit(main())
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/cli.py", line 72, in main
result = coverallz.wear()
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/api.py", line 156, in wear
json_string = self.create_report()
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/api.py", line 174, in create_report
data = self.create_data()
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/api.py", line 229, in create_data
self._data.update(self.git_info())
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/api.py", line 289, in git_info
'id': gitlog('%H'),
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/coveralls/api.py", line 326, in gitlog
'--pretty=format:{}'.format(fmt))
ValueError: zero length field name in format
The tests passed, so this is a coveralls vs Python 2.6 issue. I suggest the options are drop support for 2.6, or to use an older version of coveralls for 2.6 builds.
I created almost the same PR at the same time, but I'm happy to accept yours. I think the best strategy for the python 2.6 issues is to drop support for python 2.6.
This is a rework of https://github.com/campaignmonitor/createsend-python/pull/26 which was badly out of date.
The current behaviour is that the default timeout is used when API requests are made, matching whatever
socket.getdefaulttimeout()
returns. This patch allows setting a timeout that only affects the createsend API, so thatsocket.setdefaulttimeout
does not have to be called.To set a timeout for createsend (without changing the global socket default timeout), create an instance and assign a new timeout, like this:
If the timeout attribute is not set, then the previous behaviour is maintained.