[tryton-debian-vcs] tryton-server branch upstream updated. upstream/4.0.1-1-g38fbf24
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Jul 12 13:01:20 UTC 2016
The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=upstream/4.0.1-1-g38fbf24
commit 38fbf2419ae21ea5ae384cd282f156ee724cee1e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Jul 11 19:08:15 2016 +0200
Adding upstream version 4.0.2.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 1dfc1ed..73608b1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.2 - 2016-07-04
+* Bug fixes (see mercurial logs for details)
+
Version 4.0.1 - 2016-05-11
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 1356989..46d3e59 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 4.0.1
+Version: 4.0.2
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/bin/trytond b/bin/trytond
index 11b38ae..2c7d2ee 100755
--- a/bin/trytond
+++ b/bin/trytond
@@ -14,16 +14,17 @@ if os.path.isdir(DIR):
import trytond.commandline as commandline
from trytond.config import config, split_netloc
-from trytond.application import app
-from trytond.pool import Pool
-from trytond.modules import get_module_list, get_module_info
-
parser = commandline.get_parser_daemon()
options = parser.parse_args()
commandline.config_log(options)
config.update_etc(options.configfile)
+# Import trytond things after it is configured
+from trytond.application import app
+from trytond.pool import Pool
+from trytond.modules import get_module_list, get_module_info
+
with commandline.pidfile(options):
for name in options.database_names:
Pool(name).init()
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 1356989..46d3e59 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 4.0.1
+Version: 4.0.2
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/trytond/__init__.py b/trytond/__init__.py
index 54f35f5..bee2fc6 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -5,7 +5,7 @@ import time
import logging
from email import charset
-__version__ = "4.0.1"
+__version__ = "4.0.2"
logger = logging.getLogger(__name__)
os.environ['TZ'] = 'UTC'
diff --git a/trytond/ir/model.py b/trytond/ir/model.py
index 9045980..d165104 100644
--- a/trytond/ir/model.py
+++ b/trytond/ir/model.py
@@ -188,7 +188,7 @@ class Model(ModelSQL, ModelView):
])
access = ModelAccess.get_access([m.model for m in models])
s = StringMatcher()
- if isinstance(text, str):
+ if isinstance(text, bytes):
text = text.decode('utf-8')
s.set_seq2(text)
@@ -200,7 +200,7 @@ class Model(ModelSQL, ModelView):
if not hasattr(Model, 'search_global'):
continue
for record, name, icon in Model.search_global(text):
- if isinstance(name, str):
+ if isinstance(name, bytes):
name = name.decode('utf-8')
s.set_seq1(name)
yield (s.ratio(), model.model, model.rec_name,
diff --git a/trytond/ir/ui/icon.py b/trytond/ir/ui/icon.py
index 2f419a3..14877d8 100644
--- a/trytond/ir/ui/icon.py
+++ b/trytond/ir/ui/icon.py
@@ -50,5 +50,5 @@ class Icon(ModelSQL, ModelView):
def get_icon(self, name):
path = os.path.join(self.module, self.path.replace('/', os.sep))
- with file_open(path, subdir='modules', mode='rb') as fp:
+ with file_open(path, subdir='modules', mode='r') as fp:
return fp.read()
diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py
index 3b6c9bc..d03dc6a 100644
--- a/trytond/ir/ui/view.py
+++ b/trytond/ir/ui/view.py
@@ -193,7 +193,7 @@ class View(ModelSQL, ModelView):
if self.name and self.module:
path = os.path.join(self.module, 'view', self.name + '.xml')
try:
- with file_open(path, subdir='modules', mode='rb') as fp:
+ with file_open(path, subdir='modules', mode='r') as fp:
value = fp.read()
except IOError:
pass
diff --git a/trytond/model/model.py b/trytond/model/model.py
index 68177bf..e02da28 100644
--- a/trytond/model/model.py
+++ b/trytond/model/model.py
@@ -388,7 +388,7 @@ class Model(WarningErrorMixin, URLMixin, PoolBase):
return u'%s,%s' % (self.__name__, self.id)
def __repr__(self):
- if self.id < 0:
+ if self.id is None or self.id < 0:
return "Pool().get('%s')(**%s)" % (self.__name__,
repr(self._default_values))
else:
diff --git a/trytond/protocols/jsonrpc.py b/trytond/protocols/jsonrpc.py
index 956d291..74c355d 100644
--- a/trytond/protocols/jsonrpc.py
+++ b/trytond/protocols/jsonrpc.py
@@ -1,7 +1,5 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
-import traceback
-import sys
import datetime
from decimal import Decimal
try:
@@ -155,11 +153,8 @@ class JSONProtocol:
if isinstance(data, TrytonException):
response['error'] = data.args
elif isinstance(data, Exception):
- tb_s = ''.join(traceback.format_exception(*sys.exc_info()))
- for path in sys.path:
- tb_s = tb_s.replace(path, '')
# report exception back to server
- response['error'] = (str(data), tb_s)
+ response['error'] = (str(data), data.__format_traceback__)
else:
response['result'] = data
return Response(json.dumps(response, cls=JSONEncoder),
diff --git a/trytond/wsgi.py b/trytond/wsgi.py
index 30deb51..edecd38 100644
--- a/trytond/wsgi.py
+++ b/trytond/wsgi.py
@@ -1,6 +1,8 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import logging
+import sys
+import traceback
from werkzeug.wrappers import Response
from werkzeug.routing import Map, Rule
@@ -44,6 +46,10 @@ class TrytondWSGI(object):
endpoint, request.view_args = adapter.match()
return endpoint(request, **request.view_args)
except Exception, e:
+ tb_s = ''.join(traceback.format_exception(*sys.exc_info()))
+ for path in sys.path:
+ tb_s = tb_s.replace(path, '')
+ e.__format_traceback__ = tb_s
response = e
for error_handler in self.error_handlers:
rv = error_handler(e)
--
tryton-server
More information about the tryton-debian-vcs
mailing list