diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b0138b3d..91c6a168a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ Please document all notable changes to this project in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [v0.2.2] + +### Fixed + +* Ignore filename too long ([#147]) + ## [v0.2.1] ### Fixed diff --git a/commodore/config.py b/commodore/config.py index a08029e1f..059f41834 100644 --- a/commodore/config.py +++ b/commodore/config.py @@ -57,10 +57,17 @@ def api_token(self): @api_token.setter def api_token(self, api_token): if api_token is not None: - p = P(api_token) - if p.is_file(): - with open(p) as apitoken: - api_token = apitoken.read() + try: + p = P(api_token) + if p.is_file(): + with open(p) as apitoken: + api_token = apitoken.read() + except OSError as e: + # File name too long, assume token is not configured as file + if 'File name too long' in e.strerror: + pass + else: + raise self._api_token = api_token.strip() def update_verbosity(self, verbose):