Closed mouadhkaabachi closed 7 years ago
Can't reproduce it as I don't have a windows machine. This seems to be offending code:
from dateutil.tz import tzlocal
from datetime import datetime
_ = datetime.now(tzlocal()).tzname()
What happens when you try this in isolation?
Also, what version of Python are you using?
Few more questions: what version of dateutil are you using?
Just found this in the dateutil documentation:
If you need dateutil for Python 2.X, please continue using the 1.X series.
I'm using python 2.7 dateutil 2.6 I tried with dateutil 1.5 and it works, but i got another problem with slicer serve slicer.ini
SyntaxError: Non-ASCII character '\x90' in file C:\Users\Mouadh\envs\cubes\Scripts\slicer.exe on line 1, but no encoding declared; see http:// python.org/dev/peps/pep-0263/ for details
the problem is that datetime.now(tzlocal()).tzname() return Paris, Madrid (heure d��t�) Normally, it must return Paris, Madrid (heure d'été) and can be used in other classes (encoding french characters) 'heure d'été' ==> 'summer time'
This looks like some Python 2.x + Windows + Unicode combination issue. I would recommend to to some research on that side or maybe try to switch to Python 3 to see what are the results.
Closing this as this does not seems to be Cubes related problem.
Hi, i use Python 3.6, Windows and have error:
slicer serve slicer.ini
Errore: non-utf-8 code starting with ' x 90' in file AppData\Local\Programs\Python\Python37\Scripts\Slicer.exe
Whats problem?
Python 3.7.0a2 on Win 8.1 64bit I have the error when I try to run the CubesViewer webshop demo "slicer serve slicer.ini"
Programs\Python\Python37\Scripts\slicer.exe", line 1 SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Users....\AppData\Local\Programs\Python\Python37\Scripts\slicer.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
on windows, I tried to run the server with command
slicer serve slicer.ini
I got the following error
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 22: ordinal not in range(128)
on linux, it works
Stack trace:
Traceback (most recent call last): File "C:\Users\Mouadh\envs\cubes\Scripts\slicer-script.py", line 11, in
load_entry_point('cubes==1.1', 'console_scripts', 'slicer')()
File "build\bdist.win32\egg\cubes\slicer\commands.py", line 593, in main
File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\core.py", line 722, in call return self.main(args, kwargs) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\core.py", line 697, in main rv = self.invoke(ctx) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\core.py", line 535, in invoke return callback(args, *kwargs) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\click\decorators.py", line 17, in new_func return f(get_current_context(), args, **kwargs) File "build\bdist.win32\egg\cubes\slicer\commands.py", line 65, in serve
File "build\bdist.win32\egg\cubes\server\base.py", line 67, in run_server File "build\bdist.win32\egg\cubes\server\base.py", line 46, in create_server File "C:\Users\Mouadh\envs\cubes\lib\site-packages\flask\app.py", line 64, in wrapper_func return f(self, *args, **kwargs) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\flask\app.py", line 951, in register_blueprint blueprint.register(self, options, first_registration) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\flask\blueprints.py", line 154, in register deferred(state) File "C:\Users\Mouadh\envs\cubes\lib\site-packages\flask\blueprints.py", line 129, in wrapper func(state) File "build\bdist.win32\egg\cubes\server\blueprint.py", line 102, in initialize_slicer File "build\bdist.win32\egg\cubes\workspace.py", line 209, in init File "build\bdist.win32\egg\cubes\calendar.py", line 145, in init Return an iterator for one week of weekday numbers starting with the File "build\bdist.win32\egg\dateutil\tz_common.py", line 21, in adjust_encoding UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 22: ordinal not in range(128)