[issue24159] Misleading TypeError when pickling bytes to a file opened as text

2019-11-02 Thread stein-k


Change by stein-k :


--
nosy: +stein-k

___
Python tracker 
<https://bugs.python.org/issue24159>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38567] urllib.parse.unquote_plus raises incorrect errormessage when string parameter is bytes

2019-10-23 Thread stein-k


Change by stein-k :


--
keywords: +patch
pull_requests: +16441
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16903

___
Python tracker 
<https://bugs.python.org/issue38567>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38567] urllib.parse.unquote_plus raises incorrect errormessage when string parameter is bytes

2019-10-23 Thread stein-k


New submission from stein-k :

urllib.parse.unquote_plus(b'abc%20def')
...
TypeError: a bytes-like object is required, not 'str'

--
components: Library (Lib)
messages: 355242
nosy: stein-k
priority: normal
severity: normal
status: open
title: urllib.parse.unquote_plus raises incorrect errormessage when string 
parameter is bytes
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue38567>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-07-08 Thread stein-k


stein-k  added the comment:

I have made the News Entry and created the Pull request as described here: 
https://devguide.python.org/pullrequest/. Should I update the Status and 
Resolution of the issue here, or wait for some kind of confirmation?

--

___
Python tracker 
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-06-17 Thread stein-k


Change by stein-k :


--
pull_requests: +7376
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-21 Thread stein-k

stein-k <karlsen.st...@gmail.com> added the comment:

Patch for tests.

Added test for calling unquote with bytes input and removed Exception raised in 
original test.

--
Added file: 
https://bugs.python.org/file47397/urllib_parse_unquote_handle_bytes_test.patch

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-18 Thread stein-k

stein-k <karlsen.st...@gmail.com> added the comment:

Added a patch containing the fix, is this the proper way or should I create a 
pull request?

--
keywords: +patch
Added file: 
https://bugs.python.org/file47395/urllib_parse_unquote_handle_bytes.patch

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-07 Thread stein-k

stein-k <karlsen.st...@gmail.com> added the comment:

The unquote function does take an encoding argument, but I am more worried 
about unquote_to_to_bytes which just assumes utf-8. (But this might be an 
implementation detail of its intended usage.)

I must agree that a polymorphic implementation would be better. Do you think 
this tracker is the correct place for such a change, or would an enhancement 
proposal be more suited?

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-06 Thread stein-k

stein-k <karlsen.st...@gmail.com> added the comment:

The message is incorrect for the input to the function, and confusing because 
the caller did supply a bytes-like object.

The exception is from an implementation detail, and if the implementation 
changes the exception could as well. 

I suggest the implementation is changed to follow the example of  
urllib.parse.unquote_to_bytes, which encodes its string parameter to bytes if 
it receives a str object.

Alternatively, a check for required type should be implemented and raise a 
TypeError with the correct error-message.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2018-01-05 Thread stein-k

New submission from stein-k <karlsen.st...@gmail.com>:

urllib.parse.unquote(b'abc%20def')
...
TypeError: a bytes-like object is required, not 'str'

--
components: Library (Lib)
messages: 309517
nosy: stein-k
priority: normal
severity: normal
status: open
title: urllib.parse.unquote raises incorrect errormessage when string parameter 
is bytes
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com