[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread utkarsh


utkarsh  added the comment:

@thatiparthy These were the most logical changes, standard error messages, 
which were already there in the existing code, I just edited them as mentioned 
here. What part of your "work" do you think i copied?
Sent this PR to get familiar to the process mostly, i will close it if you feel 
insecure. No need to be rude.
thanks.

--

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

@utk You could have taken some other easy issue from 
https://bugs.python.org/issue?status=1&@sort=-activity&@columns=id%2Cactivity%2Ctitle%2Ccreator%2Cstatus&@dispname=Easy%20issues&@startwith=0&@group=priority&keywords=6&@action=search&@filter=&@pagesize=50
 instead of copy pasting my work.

--

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread utkarsh


Change by utkarsh :


--
nosy: +utk
nosy_count: 8.0 -> 9.0
pull_requests: +20329
pull_request: https://github.com/python/cpython/pull/21170

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Change by Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
:


--
keywords: +patch
pull_requests: +20323
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/21165

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread Walter Dörwald

Walter Dörwald  added the comment:

UnicodeEncodeError and UnicodeDecodeError are used to report un(en|de)codedable 
ranges in the source object, so it wouldn't make sense to use them for errors 
that have nothing to do with problems in the source object. Their constructor 
requires 5 arguments (encoding, object, start, end, reason), not just a simple 
message: e.g. UnicodeEncodeError("utf-8", "foo", 17, 23, "bad string").

But for reporting e.g. missing BOMs at the start it would be useful to use (0,  
0) as the offending range.

--
nosy: +doerwalter

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi,

IMO this can be mark as an easy issue.

@thatiparthy please, go ahead

--
nosy: +eamanu

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

This looks like an easy task. Shall I create a PR?

--
nosy: +thatiparthy

___
Python tracker 

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



[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread Antoine Pitrou


New submission from Antoine Pitrou :

A number of codecs raise bare UnicodeError, rather than 
Unicode{Decode,Encode}Error. Example:

  File 
"/home/antoine/miniconda3/envs/pyarrow/lib/python3.7/encodings/utf_16.py", line 
67, in _buffer_decode
raise UnicodeError("UTF-16 stream does not start with BOM")

A more complete list can be found here:
https://gist.github.com/pitrou/60594b28d8e47edcdb97d9b15d5f9866

--
components: Library (Lib)
keywords: easy
messages: 372367
nosy: benjamin.peterson, ezio.melotti, lemburg, pitrou, serhiy.storchaka, 
vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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