Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions commodore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down