Issue221

Title Problem with nuitka and logging
Priority bug Status chatting
Superseder Nosy List ralsina
Assigned To Keywords

Created on 2015-07-21.16:18:51 by ralsina, last changed by kayhayen.

Messages
msg1370 (view) Author: kayhayen Date: 2015-07-22.14:42:58
Hello Roberto,

great to see you using Nuitka. I am at Europython right now. You may play
around with --file-reference-mode. It may well be good enough to use
original or frozen mode.

Otherwise. As it's only the binary name that gives you that issue. You
could also just move code out of there.

Monkey patching linebuffer may also be an option.

Right now there is my dismay no option to just include the real source and
use that as filenames.

Yours
Kay
Am 21.07.2015 18:18 schrieb "Roberto Alsina (via Issue Tracker)" <
issue_tracker@nuitka.net>:

>
> New submission from Roberto Alsina <ralsina@netmanagers.com.ar>:
>
> I am trying to use nuitka to ship a product to some customers, and ran into
> this problem. In my code, I have something like this:
>
>         try:
>             result_path = os.path.join(working_dir, 'foo.json')
>             with open(result_path, 'r+', encoding='utf-8') as inf:
>                 payload = json.load(inf)
>         except Exception as err:
>             self.log.exception('Error loading foo: %s', err)
>
> When an exception occurs, it seems the logging module tries to parse the
> source
> file, which (being a binary) is not valid python, and then  everything
> explodes
> (sorry this is not real log, I had to sanitize to hide seeeecret stuff):
>
> FileNotFoundError: [Errno 2] No such file or directory:
>
> '/home/ralsina/canonical/build-foo-binaries/-foo-binaries/run/062b9df5-dbc7-
> 4702-be6b-ce43d220f62f_2015-07-21T13:13:04.102806/baz_bar_result.json'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
>     line_string = line.decode('utf-8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40:
> invalid continuation byte
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3.4/logging/__init__.py", line 978, in emit
>     msg = self.format(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 828, in format
>     return fmt.format(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 573, in format
>     record.exc_text = self.formatException(record.exc_info)
>   File "/usr/lib/python3.4/logging/__init__.py", line 523, in
> formatException
>     traceback.print_exception(ei[0], ei[1], tb, None, sio)
>   File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
>     for line in _format_exception_iter(etype, value, tb, limit, chain):
>   File "/usr/lib/python3.4/traceback.py", line 153, in
> _format_exception_iter
>     yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
>   File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
>     for filename, lineno, name, line in extracted_list:
>   File "/usr/lib/python3.4/traceback.py", line 65, in
> _extract_tb_or_stack_iter
>     line = linecache.getline(filename, lineno, f.f_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 15, in getline
>     lines = getlines(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 41, in getlines
>     return updatecache(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
>     with tokenize.open(fullname) as fp:
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 439, in open
>     encoding, lines = detect_encoding(buffer.readline)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
>     encoding = find_cookie(first)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
>     raise SyntaxError(msg)
> SyntaxError: invalid or missing encoding declaration for
> '/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
>     line_string = line.decode('utf-8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40:
> invalid continuation byte
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py",
> line
> 287, in main
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py",
> line
> 278, in start
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py",
> line
> 247, in process_bar
>   File "/usr/lib/python3.4/logging/__init__.py", line 1310, in exception
>     self.error(msg, *args, **kwargs)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1303, in error
>     self._log(ERROR, msg, args, **kwargs)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1409, in _log
>     self.handle(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1419, in handle
>     self.callHandlers(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1481, in callHandlers
>     hdlr.handle(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 853, in handle
>     self.emit(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1041, in emit
>     StreamHandler.emit(self, record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 984, in emit
>     self.handleError(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 906, in handleError
>     traceback.print_exception(t, v, tb, None, sys.stderr)
>   File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
>     for line in _format_exception_iter(etype, value, tb, limit, chain):
>   File "/usr/lib/python3.4/traceback.py", line 153, in
> _format_exception_iter
>     yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
>   File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
>     for filename, lineno, name, line in extracted_list:
>   File "/usr/lib/python3.4/traceback.py", line 65, in
> _extract_tb_or_stack_iter
>     line = linecache.getline(filename, lineno, f.f_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 15, in getline
>     lines = getlines(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 41, in getlines
>     return updatecache(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
>     with tokenize.open(fullname) as fp:
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 439, in open
>     encoding, lines = detect_encoding(buffer.readline)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
>     encoding = find_cookie(first)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
>     raise SyntaxError(msg)
> SyntaxError: invalid or missing encoding declaration for
> '/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
>     line_string = line.decode('utf-8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40:
> invalid continuation byte
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3.4/logging/__init__.py", line 978, in emit
>     msg = self.format(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 828, in format
>     return fmt.format(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 573, in format
>     record.exc_text = self.formatException(record.exc_info)
>   File "/usr/lib/python3.4/logging/__init__.py", line 523, in
> formatException
>     traceback.print_exception(ei[0], ei[1], tb, None, sio)
>   File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
>     for line in _format_exception_iter(etype, value, tb, limit, chain):
>   File "/usr/lib/python3.4/traceback.py", line 153, in
> _format_exception_iter
>     yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
>   File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
>     for filename, lineno, name, line in extracted_list:
>   File "/usr/lib/python3.4/traceback.py", line 65, in
> _extract_tb_or_stack_iter
>     line = linecache.getline(filename, lineno, f.f_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 15, in getline
>     lines = getlines(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 41, in getlines
>     return updatecache(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
>     with tokenize.open(fullname) as fp:
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 439, in open
>     encoding, lines = detect_encoding(buffer.readline)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
>     encoding = find_cookie(first)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
>     raise SyntaxError(msg)
> SyntaxError: invalid or missing encoding declaration for
> '/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
>     line_string = line.decode('utf-8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40:
> invalid continuation byte
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py",
> line
> 313, in <module>
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py",
> line
> 292, in main
>   File "/usr/lib/python3.4/logging/__init__.py", line 1310, in exception
>     self.error(msg, *args, **kwargs)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1303, in error
>     self._log(ERROR, msg, args, **kwargs)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1409, in _log
>     self.handle(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1419, in handle
>     self.callHandlers(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1481, in callHandlers
>     hdlr.handle(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 853, in handle
>     self.emit(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 1041, in emit
>     StreamHandler.emit(self, record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 984, in emit
>     self.handleError(record)
>   File "/usr/lib/python3.4/logging/__init__.py", line 906, in handleError
>     traceback.print_exception(t, v, tb, None, sys.stderr)
>   File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
>     for line in _format_exception_iter(etype, value, tb, limit, chain):
>   File "/usr/lib/python3.4/traceback.py", line 153, in
> _format_exception_iter
>     yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
>   File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
>     for filename, lineno, name, line in extracted_list:
>   File "/usr/lib/python3.4/traceback.py", line 65, in
> _extract_tb_or_stack_iter
>     line = linecache.getline(filename, lineno, f.f_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 15, in getline
>     lines = getlines(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 41, in getlines
>     return updatecache(filename, module_globals)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
>     with tokenize.open(fullname) as fp:
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 439, in open
>     encoding, lines = detect_encoding(buffer.readline)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
>     encoding = find_cookie(first)
>   File "/home/ralsina/canonical/build-foo-
> binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
>     raise SyntaxError(msg)
> SyntaxError: invalid or missing encoding declaration for
> '/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'
> 2015-07-21 13:13:04,142 CRITI Exception calling Agent:
> CalledProcessError(1,
> './foo.py -v --once x')
> Traceback (most recent call last):
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py",
> line
> 208, in <module>
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py",
> line
> 199, in run
>   File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py",
> line
> 166, in run_foo
>   File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command './foo.py -v --once x' returned
> non-zero
> exit status 1
>
> ----------
> messages: 1369
> nosy: ralsina
> priority: bug
> status: unread
> title: Problem with nuitka and logging
>
> _______________________________________________
> Nuitka issue tracker <issue_tracker@nuitka.net>
> <http://bugs.nuitka.net/issue221>
> _______________________________________________
>
msg1369 (view) Author: ralsina Date: 2015-07-21.16:18:51
I am trying to use nuitka to ship a product to some customers, and ran into 
this problem. In my code, I have something like this:

        try:
            result_path = os.path.join(working_dir, 'foo.json')
            with open(result_path, 'r+', encoding='utf-8') as inf:
                payload = json.load(inf)
        except Exception as err:
            self.log.exception('Error loading foo: %s', err)

When an exception occurs, it seems the logging module tries to parse the source 
file, which (being a binary) is not valid python, and then  everything explodes 
(sorry this is not real log, I had to sanitize to hide seeeecret stuff):

FileNotFoundError: [Errno 2] No such file or directory: 
'/home/ralsina/canonical/build-foo-binaries/-foo-binaries/run/062b9df5-dbc7-
4702-be6b-ce43d220f62f_2015-07-21T13:13:04.102806/baz_bar_result.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40: 
invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/logging/__init__.py", line 978, in emit
    msg = self.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 828, in format
    return fmt.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 573, in format
    record.exc_text = self.formatException(record.exc_info)
  File "/usr/lib/python3.4/logging/__init__.py", line 523, in formatException
    traceback.print_exception(ei[0], ei[1], tb, None, sio)
  File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
    for line in _format_exception_iter(etype, value, tb, limit, chain):
  File "/usr/lib/python3.4/traceback.py", line 153, in _format_exception_iter
    yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
  File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
    for filename, lineno, name, line in extracted_list:
  File "/usr/lib/python3.4/traceback.py", line 65, in _extract_tb_or_stack_iter
    line = linecache.getline(filename, lineno, f.f_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 15, in getline
    lines = getlines(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 41, in getlines
    return updatecache(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
    with tokenize.open(fullname) as fp:
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 439, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
    encoding = find_cookie(first)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 
'/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40: 
invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py", line 
287, in main
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py", line 
278, in start
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py", line 
247, in process_bar
  File "/usr/lib/python3.4/logging/__init__.py", line 1310, in exception
    self.error(msg, *args, **kwargs)
  File "/usr/lib/python3.4/logging/__init__.py", line 1303, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python3.4/logging/__init__.py", line 1409, in _log
    self.handle(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1419, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1481, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 853, in handle
    self.emit(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1041, in emit
    StreamHandler.emit(self, record)
  File "/usr/lib/python3.4/logging/__init__.py", line 984, in emit
    self.handleError(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 906, in handleError
    traceback.print_exception(t, v, tb, None, sys.stderr)
  File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
    for line in _format_exception_iter(etype, value, tb, limit, chain):
  File "/usr/lib/python3.4/traceback.py", line 153, in _format_exception_iter
    yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
  File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
    for filename, lineno, name, line in extracted_list:
  File "/usr/lib/python3.4/traceback.py", line 65, in _extract_tb_or_stack_iter
    line = linecache.getline(filename, lineno, f.f_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 15, in getline
    lines = getlines(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 41, in getlines
    return updatecache(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
    with tokenize.open(fullname) as fp:
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 439, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
    encoding = find_cookie(first)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 
'/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40: 
invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/logging/__init__.py", line 978, in emit
    msg = self.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 828, in format
    return fmt.format(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 573, in format
    record.exc_text = self.formatException(record.exc_info)
  File "/usr/lib/python3.4/logging/__init__.py", line 523, in formatException
    traceback.print_exception(ei[0], ei[1], tb, None, sio)
  File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
    for line in _format_exception_iter(etype, value, tb, limit, chain):
  File "/usr/lib/python3.4/traceback.py", line 153, in _format_exception_iter
    yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
  File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
    for filename, lineno, name, line in extracted_list:
  File "/usr/lib/python3.4/traceback.py", line 65, in _extract_tb_or_stack_iter
    line = linecache.getline(filename, lineno, f.f_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 15, in getline
    lines = getlines(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 41, in getlines
    return updatecache(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
    with tokenize.open(fullname) as fp:
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 439, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
    encoding = find_cookie(first)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 
'/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 374, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 40: 
invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py", line 
313, in <module>
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py", line 
292, in main
  File "/usr/lib/python3.4/logging/__init__.py", line 1310, in exception
    self.error(msg, *args, **kwargs)
  File "/usr/lib/python3.4/logging/__init__.py", line 1303, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python3.4/logging/__init__.py", line 1409, in _log
    self.handle(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1419, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1481, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 853, in handle
    self.emit(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 1041, in emit
    StreamHandler.emit(self, record)
  File "/usr/lib/python3.4/logging/__init__.py", line 984, in emit
    self.handleError(record)
  File "/usr/lib/python3.4/logging/__init__.py", line 906, in handleError
    traceback.print_exception(t, v, tb, None, sys.stderr)
  File "/usr/lib/python3.4/traceback.py", line 169, in print_exception
    for line in _format_exception_iter(etype, value, tb, limit, chain):
  File "/usr/lib/python3.4/traceback.py", line 153, in _format_exception_iter
    yield from _format_list_iter(_extract_tb_iter(tb, limit=limit))
  File "/usr/lib/python3.4/traceback.py", line 18, in _format_list_iter
    for filename, lineno, name, line in extracted_list:
  File "/usr/lib/python3.4/traceback.py", line 65, in _extract_tb_or_stack_iter
    line = linecache.getline(filename, lineno, f.f_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 15, in getline
    lines = getlines(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 41, in getlines
    return updatecache(filename, module_globals)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/linecache.py", line 126, in updatecache
    with tokenize.open(fullname) as fp:
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 439, in open
    encoding, lines = detect_encoding(buffer.readline)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 415, in detect_encoding
    encoding = find_cookie(first)
  File "/home/ralsina/canonical/build-foo-
binaries/env/lib/python3.4/tokenize.py", line 379, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 
'/home/ralsina/canonical/build-foo-binaries/-foo-binaries/foo.py'
2015-07-21 13:13:04,142 CRITI Exception calling Agent: CalledProcessError(1, 
'./foo.py -v --once x')
Traceback (most recent call last):
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py", line 
208, in <module>
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py", line 
199, in run
  File "/home/ralsina/canonical/build-foo-binaries/-foo-binaries/e2e.py", line 
166, in run_foo
  File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command './foo.py -v --once x' returned non-zero 
exit status 1
History
Date User Action Args
2015-07-22 14:42:58kayhayensetstatus: unread -> chatting
messages: + msg1370
2015-07-21 16:18:51ralsinacreate