Changes between Initial Version and Version 1 of Ticket #34891
- Timestamp:
- Oct 5, 2023, 7:11:52 PM (14 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34891
- Property Resolution → needsinfo
- Property Status new → closed
-
Ticket #34891 – Description
initial v1 1 Trying to decode: 1 {{{ #!pycon 2 >>> from django.utils.encoding import force_str 3 >>> from django.utils.http import urlsafe_base64_decode 4 >>> uidb64 = 'PHByb3BlcnR5IG9iamVjdCBhdCAweDAwMDAwMjU1M0ZBNTlEQTA-bvlp6u-9b15d1fd6d30b90e81623812e9bc8d74' 5 >>> result = urlsafe_base64_decode(uidb64) 6 >>> result 7 b'<property object at 0x000002553FA59DA0>n\xf9i\xea\xef\xbdo^]\xd5\xf7zw}\x1b\xf7G\xbc\xd7\xad\xb7\xf3]\x9e\xf5\xb7<w\xbe' 2 8 3 PHByb3BlcnR5IG9iamVjdCBhdCAweDAwMDAwMjU1M0ZBNTlEQTA- 4 bvlp6u-9b15d1fd6d30b90e81623812e9bc8d74 9 >>> force_str(result) 10 Traceback (most recent call last): 11 File "/home/tim/code/django/django/utils/encoding.py", line 70, in force_str 12 s = str(s, encoding, errors) 13 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 40: invalid start byte 5 14 6 force_str(urlsafe_base64_decode(uidb64)) returns:15 During handling of the above exception, another exception occurred: 7 16 8 Field 'id' expected a number but got b'<property object at 0x000002553FA59DA0>'. 9 10 The above exception (invalid literal for int() with base 10: b'<property object at 0x000002553FA59DA0>') was the direct cause of the following exception: 17 Traceback (most recent call last): 18 File "<console>", line 1, in <module> 19 File "/home/tim/code/django/django/utils/encoding.py", line 74, in force_str 20 raise DjangoUnicodeDecodeError(s, *e.args) 21 django.utils.encoding.DjangoUnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 40: invalid start byte. You passed in b'<property object at 0x000002553FA59DA0>n\xf9i\xea\xef\xbdo^]\xd5\xf7zw}\x1b\xf7G\xbc\xd7\xad\xb7\xf3]\x9e\xf5\xb7<w\xbe' (<class 'bytes'>) 22 }}} 11 23 12 24 Code: 13 25 {{{ #!python 14 26 def activate(request, uidb64, token): 15 27 try: … … 27 39 else: 28 40 return HttpResponseBadRequest('Activation link is invalid!') 41 }}}