Comments (3)
I also encountered some Unicode issues when using Python 2.7:
# ./toggl.py
Traceback (most recent call last):
File "/opt/initso/togglsync/toggl-cli-master/toggl.py", line 1265, in <module>
CLI().act()
File "/opt/initso/togglsync/toggl-cli-master/toggl.py", line 1039, in act
Logger.info(TimeEntryList())
File "/opt/initso/togglsync/toggl-cli-master/toggl.py", line 294, in info
print("%s%s" % (msg, end)),
File "/opt/initso/togglsync/toggl-cli-master/toggl.py", line 881, in __str__
s += str(entry) + "\n"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 31: ordinal not in range(128)
Using Python 3.5.1 solved it for me.
from toggl-cli.
Have the same issue.
Made a small patch to change a few str() to unicode() etc.
diff --git a/toggl.py b/toggl.py
old mode 100644
new mode 100755
index 6aff029..2af28b6
--- a/toggl.py
+++ b/toggl.py
@@ -878,7 +878,8 @@ class TimeEntryList(object):
s += date + "\n"
duration = 0
for entry in days[date]:
- s += str(entry) + "\n"
+ # s += str(entry) + "\n"
+ s += unicode(entry) + "\n"
duration += entry.normalized_duration()
s += " (%s)\n" % DateAndTime().elapsed_time(int(duration))
return s.rstrip() # strip trailing \n
@@ -1062,7 +1063,8 @@ class CLI(object):
def _show_projects(self, args):
workspace_name = self._get_workspace_arg(args, optional=True)
- print(ProjectList(workspace_name))
+ # print(ProjectList(workspace_name))
+ print(unicode(ProjectList(workspace_name)))
def _continue_entry(self, args):
"""
@@ -1206,7 +1208,8 @@ class CLI(object):
entry = TimeEntryList().now()
if entry != None:
- Logger.info(str(entry))
+ # Logger.info(str(entry))
+ Logger.info(unicode(entry))
else:
Logger.info("You're not working on anything right now.")
from toggl-cli.
This should be now fixed with the new version of Toggl CLI.
from toggl-cli.
Related Issues (20)
- Test failures
- Some more CLI example, please HOT 1
- Project Add command incorrectly claims created projects are public by default
- CLI should not show entry is running when time entry has stop == start HOT 3
- sum command doesn't respect configured timezone HOT 1
- Option to set task? HOT 4
- Rework CLI completion with new Click 8.0 release HOT 1
- Unable to find user for TimeEntry HOT 1
- Add `--colors=always` option for passing to `click` HOT 2
- Authentication fail on "ls" command -- but works for other commands
- How do I find entries without project? HOT 1
- Install completion to $ZDOTDIR/.zshrc HOT 4
- toggl projects add -n "asd asd" --color 123 HOT 3
- Flag to quickly do `toggl stop -p $TIME; toggl start -s $TIME ...` HOT 3
- API v8 is being deprecated and shut down by toggle HOT 12
- [Feature request] rewrite in javascript HOT 1
- Add `num-entries` option to `ls` HOT 3
- Print entry description on `toggl start`
- Feature Request: Summed Worklogs Grouped by Description HOT 5
- Python 3.12 Support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toggl-cli.