Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-bottle for openSUSE:Factory 
checked in at 2026-12-01 17:19:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-bottle (Old)
 and      /work/SRC/openSUSE:Factory/.python-bottle.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-bottle"

Tue Dec  1 17:19:02 2026 rev:34 rq:1401597 version:0.13.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-bottle/python-bottle.changes      
2025-08-12 17:04:34.603265784 +0200
+++ /work/SRC/openSUSE:Factory/.python-bottle.new.1340718/python-bottle.changes 
2026-12-01 17:19:02.944760288 +0100
@@ -1,0 +2,7 @@
+Sun Nov 29 15:08:58 UTC 2026 - BenoĆ®t Monin <[email protected]>
+
+- update to version 0.13.5:
+  * typing: Type hints for pyright
+  * fix: Avoid certain charsets when decoding untrusted input
+
+-------------------------------------------------------------------

Old:
----
  bottle-0.13.4.tar.gz

New:
----
  bottle-0.13.5.tar.gz

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

Other differences:
------------------
++++++ python-bottle.spec ++++++
--- /var/tmp/diff_new_pack.xcdPrN/_old  2026-12-01 17:19:03.759794595 +0100
+++ /var/tmp/diff_new_pack.xcdPrN/_new  2026-12-01 17:19:03.760794637 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-bottle
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -23,7 +23,7 @@
 %endif
 %{?sle15_python_module_pythons}
 Name:           python-bottle
-Version:        0.13.4
+Version:        0.13.5
 Release:        0
 Summary:        WSGI framework for small web applications
 License:        MIT

++++++ bottle-0.13.4.tar.gz -> bottle-0.13.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.13.4/PKG-INFO new/bottle-0.13.5/PKG-INFO
--- old/bottle-0.13.4/PKG-INFO  2025-06-15 12:07:01.923656200 +0200
+++ new/bottle-0.13.5/PKG-INFO  2026-11-28 11:52:49.859814600 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: bottle
-Version: 0.13.4
+Version: 0.13.5
 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.13.4/bottle.egg-info/PKG-INFO 
new/bottle-0.13.5/bottle.egg-info/PKG-INFO
--- old/bottle-0.13.4/bottle.egg-info/PKG-INFO  2025-06-15 12:07:01.000000000 
+0200
+++ new/bottle-0.13.5/bottle.egg-info/PKG-INFO  2026-11-28 11:52:49.842508000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: bottle
-Version: 0.13.4
+Version: 0.13.5
 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.13.4/bottle.py new/bottle-0.13.5/bottle.py
--- old/bottle-0.13.4/bottle.py 2025-06-15 12:06:37.000000000 +0200
+++ new/bottle-0.13.5/bottle.py 2026-11-28 11:52:29.455984800 +0100
@@ -17,7 +17,7 @@
 import sys
 
 __author__ = 'Marcel Hellkamp'
-__version__ = '0.13.4'
+__version__ = '0.13.5'
 __license__ = 'MIT'
 
 ###############################################################################
@@ -69,7 +69,7 @@
 # Imports and Python 2/3 unification ##########################################
 ###############################################################################
 
-import base64, calendar, email.utils, functools, hmac, itertools,\
+import base64, codecs, calendar, email.utils, functools, hmac, itertools,\
        mimetypes, os, re, tempfile, threading, time, warnings, weakref, hashlib
 
 from types import FunctionType
@@ -917,7 +917,8 @@
         skiplist = makelist(skip)
 
         def decorator(callback):
-            if isinstance(callback, basestring): callback = load(callback)
+            if isinstance(callback, basestring):
+                callback = load(callback) # type: Callable
             for rule in makelist(path) or yieldroutes(callback):
                 for verb in makelist(method):
                     verb = verb.upper()
@@ -3068,6 +3069,45 @@
                    for x, y in zip(a, b)) and len(a) == len(b)
 
 
+# fmt: off
+#: Known-good header charsets and some common aliases mapped to their actual 
name
+_KNOWN_CHARSETS = {
+    alias: codecs.lookup(alias).name
+    for alias in (
+        "utf-8", "utf8",
+        "ascii", "us-ascii",
+        "iso8859-1", "iso-8859-1", "latin1", "latin-1",
+    )
+}
+
+#: Python specific charsets that should never be used by valid clients.
+_BAD_CHARSETS = {
+    "unicode-escape", "punycode", "rot-13", "raw-unicode-escape", "hex",
+    "bz2", "palmos", "undefined", "zlib", "base64", "idna", "quopri",
+    "uu", "mbcs", "oem"
+}
+# fmt: on
+
+
+def _safe_charset(charset, fallback=None):
+    """Return the actual name of a given charset or common alias while
+    rejecting problematic or unknown charsets."""
+    if charset == "utf-8":
+        return "utf-8"
+    known = _KNOWN_CHARSETS.get(charset.lower())
+    if known:
+        return known
+    try:
+        info = codecs.lookup(charset)
+        if info.name not in _BAD_CHARSETS:
+            return info.name
+    except LookupError:
+        pass
+    if fallback:
+        return fallback
+    raise LookupError("Invalid or unknown charset: %r" % (charset,))
+
+
 def cookie_encode(data, key, digestmod=None):
     """ Encode and sign a pickle-able object. Return a (byte) string """
     depr(0, 13, "cookie_encode() will be removed soon.",
@@ -3231,7 +3271,7 @@
         mem_limit=2 ** 20,
         memfile_limit=2 ** 18,
         buffer_size=2 ** 16,
-        charset="latin1",
+        charset="utf-8",
     ):
         self.stream = stream
         self.boundary = boundary
@@ -3240,7 +3280,7 @@
         self.memfile_limit = memfile_limit
         self.mem_limit = min(mem_limit, self.disk_limit)
         self.buffer_size = min(buffer_size, self.mem_limit)
-        self.charset = charset
+        self.charset = _safe_charset(charset, "utf-8")
 
         if not boundary:
             raise MultipartError("No boundary.")
@@ -3346,7 +3386,7 @@
 
 
 class _MultipartPart(object):
-    def __init__(self, buffer_size=2 ** 16, memfile_limit=2 ** 18, 
charset="latin1"):
+    def __init__(self, buffer_size=2 ** 16, memfile_limit=2 ** 18, 
charset="utf-8"):
         self.headerlist = []
         self.headers = None
         self.file = False
@@ -3437,9 +3477,9 @@
 
     @property
     def value(self):
-        """ Data decoded with the specified charset """
-
-        return self.raw.decode(self.charset)
+        """Return the entire payload as a decoded text string.
+        Warning, this may consume a lot of memory, check :attr:`size` first."""
+        return self.raw.decode(_safe_charset(self.charset, "utf-8"))
 
     @property
     def raw(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.13.4/test/test_multipart.py 
new/bottle-0.13.5/test/test_multipart.py
--- old/bottle-0.13.4/test/test_multipart.py    2025-02-15 09:34:59.000000000 
+0100
+++ new/bottle-0.13.5/test/test_multipart.py    2026-11-28 11:48:39.512840500 
+0100
@@ -42,7 +42,7 @@
             if part.name != name: continue
             self.assertEqual(part.filename, None)
             self.assertEqual(part.content_type, None)
-            self.assertEqual(part.charset, "utf8")
+            self.assertEqual(part.charset, "utf-8")
             self.assertEqual(part.value, data)
             break
         else:

Reply via email to