Your message dated Sat, 13 Aug 2016 15:55:14 +0200
with message-id 
<CAOO6c=yTphx00OAO4aEY-2OwJRodBGunVb=oey-powsqqof...@mail.gmail.com>
and subject line 
has caused the Debian Bug report #765469,
regarding python3-tornado: get_secure_cookie get incorrect value by setting 
set_secure_cookie
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
765469: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765469
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python3-tornado
Version: 3.2.2-1
Severity: critical
Justification: breaks unrelated software

Dear Maintainer,

class abc(tornado.web.RequestHandler):
    def get(self):
        (stat, user) = self.check_remember()
        if stat:
           do_action()
        else:
           self.clear_cookie('remember')
           self.render('remember-post.html')

    def post(self):
        username = self.get_body_argument('username'):
        if self.get_body_argument('remember'):
           val = json.dumps({'username': username, 'time': time.time()})
           self.set_secure_cookie('remember', value=val, expires_days=7)

    def check_remember(self):
        try:
            remember_cookie = self.get_secure_cookie('remember', max_age_days=7)
        except ValueError:
            print('try get_cookie')
            return False, ''

        if remember_cookie is None:
            return False, ''

        try:
            remember = json.loads(remember_cookie.decode())
        except ValueError:
            print('try json')
            return False, ''

        ret = (False, '')
        if 'username' in remember and 'time' in remember:
            if time.time() - remember['time'] > 7 * 24 * 60 * 60:
                self.clear_cookie('remember')
                ret = (False, '')
            else:
                username = remember['username']
                val = json.dumps({'username': username, 'time': time.time()})
                self.set_secure_cookie('remember', value=val, expires_days=7)
                ret = (True, username)
        return ret


Always get an Exception ValueError in json.loads  print try json and return

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python3-tornado depends on:
ii  ca-certificates  20140927
ii  python3          3.4.2-1

python3-tornado recommends no packages.

python3-tornado suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
We have Tornado 4.4.1 in unstable now, original bugreport author is not
responding, not reproducible, closing.

-- 
Best regards
 Ondřej Nový

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to