Hello community,

here is the log from the commit of package python3-bottle for openSUSE:Factory 
checked in at 2015-11-05 11:35:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-bottle (Old)
 and      /work/SRC/openSUSE:Factory/.python3-bottle.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-bottle"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-bottle/python3-bottle.changes    
2015-01-12 09:49:55.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-bottle.new/python3-bottle.changes       
2015-11-05 11:35:21.000000000 +0100
@@ -1,0 +2,7 @@
+Sun Nov  1 17:44:53 UTC 2015 - a...@gmx.de
+
+- update to version 0.12.9:
+  * Fix #720 : Allow unicode keys in ConfigDict.
+  * Prevent syntax errors when line-wrapping comprehensions
+
+-------------------------------------------------------------------

Old:
----
  bottle-0.12.8.tar.gz

New:
----
  bottle-0.12.9.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-bottle.spec ++++++
--- /var/tmp/diff_new_pack.shbGLi/_old  2015-11-05 11:35:22.000000000 +0100
+++ /var/tmp/diff_new_pack.shbGLi/_new  2015-11-05 11:35:22.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-bottle
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python3-bottle
-Version:        0.12.8
+Version:        0.12.9
 Release:        0
 Url:            http://bottlepy.org/
 Summary:        Fast and simple WSGI-framework for small web-applications

++++++ bottle-0.12.8.tar.gz -> bottle-0.12.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.12.8/PKG-INFO new/bottle-0.12.9/PKG-INFO
--- old/bottle-0.12.8/PKG-INFO  2014-12-28 17:52:33.000000000 +0100
+++ new/bottle-0.12.9/PKG-INFO  2015-10-24 20:03:38.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bottle
-Version: 0.12.8
+Version: 0.12.9
 Summary: Fast and simple WSGI-framework for small web-applications.
 Home-page: http://bottlepy.org/
 Author: Marcel Hellkamp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.12.8/bottle.py new/bottle-0.12.9/bottle.py
--- old/bottle-0.12.8/bottle.py 2014-12-28 17:49:14.000000000 +0100
+++ new/bottle-0.12.9/bottle.py 2015-10-24 20:00:11.000000000 +0200
@@ -16,7 +16,7 @@
 from __future__ import with_statement
 
 __author__ = 'Marcel Hellkamp'
-__version__ = '0.12.8'
+__version__ = '0.12.9'
 __license__ = 'MIT'
 
 # The gevent server adapter needs to patch some modules before they are 
imported
@@ -2107,7 +2107,7 @@
             if not isinstance(source, dict):
                 raise TypeError('Source is not a dict (r)' % type(key))
             for key, value in source.items():
-                if not isinstance(key, str):
+                if not isinstance(key, basestring):
                     raise TypeError('Key is not a string (%r)' % type(key))
                 full_key = prefix + '.' + key if prefix else key
                 if isinstance(value, dict):
@@ -2123,7 +2123,7 @@
             namespace. Apart from that it works just as the usual 
dict.update().
             Example: ``update('some.namespace', key='value')`` '''
         prefix = ''
-        if a and isinstance(a[0], str):
+        if a and isinstance(a[0], basestring):
             prefix = a[0].strip('.') + '.'
             a = a[1:]
         for key, value in dict(*a, **ka).items():
@@ -2135,7 +2135,7 @@
         return self[key]
 
     def __setitem__(self, key, value):
-        if not isinstance(key, str):
+        if not isinstance(key, basestring):
             raise TypeError('Key has type %r (not a string)' % type(key))
 
         value = self.meta_get(key, 'filter', lambda x: x)(value)
@@ -3415,15 +3415,19 @@
     _re_inl = _re_tok.replace('|\\n','') # We re-use this string pattern later
     # 2: Comments (until end of line, but not the newline itself)
     _re_tok += '|(#.*)'
-    # 3,4: Keywords that start or continue a python block (only start of line)
+    # 3,4: Open and close grouping tokens
+    _re_tok += '|([\[\{\(])'
+    _re_tok += '|([\]\}\)])'
+    # 5,6: Keywords that start or continue a python block (only start of line)
     _re_tok += '|^([ \\t]*(?:if|for|while|with|try|def|class)\\b)' \
                '|^([ \\t]*(?:elif|else|except|finally)\\b)'
-    # 5: Our special 'end' keyword (but only if it stands alone)
+    # 7: Our special 'end' keyword (but only if it stands alone)
     _re_tok += '|((?:^|;)[ \\t]*end[ \\t]*(?=(?:%(block_close)s[ 
\\t]*)?\\r?$|;|#))'
-    # 6: A customizable end-of-code-block template token (only end of line)
+    # 8: A customizable end-of-code-block template token (only end of line)
     _re_tok += '|(%(block_close)s[ \\t]*(?=$))'
-    # 7: And finally, a single newline. The 8th token is 'everything else'
+    # 9: And finally, a single newline. The 10th token is 'everything else'
     _re_tok += '|(\\r?\\n)'
+
     # Match the start tokens of code areas in a template
     _re_split = '(?m)^[ \t]*(\\\\?)((%(line_start)s)|(%(block_start)s))(%%?)'
     # Match inline statements (may contain python strings)
@@ -3437,6 +3441,7 @@
         self.code_buffer, self.text_buffer = [], []
         self.lineno, self.offset = 1, 0
         self.indent, self.indent_mod = 0, 0
+        self.paren_depth = 0
 
     def get_syntax(self):
         ''' Tokens as a space separated string (default: <% %> % {{ }}) '''
@@ -3493,8 +3498,8 @@
                 return
             code_line += self.source[self.offset:self.offset+m.start()]
             self.offset += m.end()
-            _str, _com, _blk1, _blk2, _end, _cend, _nl = m.groups()
-            if code_line and (_blk1 or _blk2): # a if b else c
+            _str, _com, _po, _pc, _blk1, _blk2, _end, _cend, _nl = m.groups()
+            if (code_line or self.paren_depth > 0) and (_blk1 or _blk2): # a 
if b else c
                 code_line += _blk1 or _blk2
                 continue
             if _str:    # Python string
@@ -3503,6 +3508,15 @@
                 comment = _com
                 if multiline and _com.strip().endswith(self._tokens[1]):
                     multiline = False # Allow end-of-block in comments
+            elif _po:  # open parenthesis
+                self.paren_depth += 1
+                code_line += _po
+            elif _pc:  # close parenthesis
+                if self.paren_depth > 0:
+                    # we could check for matching parentheses here, but it's
+                    # easier to leave that to python - just check counts
+                    self.paren_depth -= 1
+                code_line += _pc
             elif _blk1: # Start-block keyword (if/for/while/def/try/...)
                 code_line, self.indent_mod = _blk1, -1
                 self.indent += 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.12.8/test/test_configdict.py 
new/bottle-0.12.9/test/test_configdict.py
--- old/bottle-0.12.8/test/test_configdict.py   2014-12-28 17:47:42.000000000 
+0100
+++ new/bottle-0.12.9/test/test_configdict.py   2015-10-24 19:48:40.000000000 
+0200
@@ -75,6 +75,19 @@
         self.assertRaises(TypeError, lambda: setitem(c, 5, 6))
         self.assertRaises(TypeError, lambda: c.load_dict({5:6}))
 
+    def test_issue720(self):
+        """Accept unicode keys."""
+        try:
+            key = unichr(12354)
+        except NameError:
+            key = chr(12354)
+        c = ConfigDict()
+        c.load_dict({key: 'value'})
+        self.assertEqual('value', c[key])
+        c = ConfigDict()
+        c.load_dict({key: {'subkey': 'value'}})
+        self.assertEqual('value', c[key + '.subkey'])
+
 
 if __name__ == '__main__': #pragma: no cover
     unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.12.8/test/test_stpl.py 
new/bottle-0.12.9/test/test_stpl.py
--- old/bottle-0.12.8/test/test_stpl.py 2014-12-28 17:47:42.000000000 +0100
+++ new/bottle-0.12.9/test/test_stpl.py 2015-10-24 19:52:59.000000000 +0200
@@ -375,6 +375,18 @@
         '''
         self.assertRenders(source, result)
 
+    def test_multiline_comprehensions_in_code_line(self):
+        self.assertRenders(source='''
+            % a = [
+            %    (i + 1)
+            %    for i in range(5)
+            %    if i%2 == 0
+            % ]
+            {{a}}
+        ''', result='''
+            [1, 3, 5]
+        ''')
+
 if __name__ == '__main__': #pragma: no cover
     unittest.main()
 


Reply via email to