[issue30588] Missing documentation for codecs.escape_decode

2019-07-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Reading the stackoverflow questions, I am not sure that this function would be 
useful for the author of the question. He just needs to remove b'\\000', this 
is only what we know. There are many ways to do it, and after using 
codecs.escape_decode() you will need to remove b'\000'.

If you want to add a feature similar to the "string-escape" codec in Python 3, 
it is better to provide it officially as a new codec "bytes-escape" (functions 
like codecs.utf_16_le_decode() are internal). But we should discuss its 
behavior taking to account the difference between string literals in Python 2 
and bytes literals in Python 3. For example how to treat non-escaped non-ascii 
bytes (they where acceptable in Python 2, but not in Python 3).

--

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2019-07-14 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

You have a point, the function is not in codecs.__all__. Reading the 
stackoverflow questions, it seems like this is a function that is useful.

--
nosy: +carlbordum

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2019-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I disagree. We can change, rename or remove it because it is not public 
function and never was. But we can not just remove it while it is used in the 
pickle module, and there is no reason to change it as it works pretty good for 
its purpose.

If you want to make it public and maintain it, I suggest first discuss this on 
the Python-Ideas mailing list. You should prove that the benefit of adding it 
is larger than the cost of the maintance.

--

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2019-07-13 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


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

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2019-04-04 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage:  -> needs patch

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2019-04-04 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

We can't change it or remove it, it is public by virtue of its name.  We should 
document it.

Removing or renaming it to be _private requires a PendingDeprecationWarning -> 
DeprecationWarning -> removal cycle.  it is well known and used.

https://stackoverflow.com/questions/14820429/how-do-i-decodestring-escape-in-python3/23151714#23151714

--
nosy: +gregory.p.smith, njs
versions: +Python 3.8 -Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2018-10-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

-1
Internal function means: you can use it on your risk but the function can be 
changed or even removed in any Python release.
I see no point in documenting and making it public.

--
nosy: +asvetlov

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2018-10-06 Thread Paul Hoffman


Paul Hoffman  added the comment:

Bumping this thread a bit. It appears that this "internal" function is being 
talked about out in the real world. I came across it in a recent blog post, saw 
that it wasn't in the official documentation, and went looking here.

I propose that it be documented even if it feels like a tad of a kludge.

--
nosy: +paulehoffman

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Matthieu Dartiailh

Matthieu Dartiailh added the comment:

The issue is that unicode_escape will not properly handle strings mixing
unicode character and escaped character as it assumes latin-1 compatible
characters only. For example, given the literal string 'Δ\nΔ', one
cannot encode using latin-1 and encoding it using utf-8 then using
unicode _escape produces a wrong output: 'Î\x94\nÎ\x94'. However using
codecs.escape_decode(r'Δ\nΔ'.encode('utf-8'))[0].decode('utf-8') gives
the proper output. Internally the Python parser handle this case but I
was unable to find where and this is the closest solution I found. I
guess it may be possible using error handlers but it seems much more
cumbersome.

Best regards

Matthieu

--

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is an internal function kept for compatibility. It is used only for 
decoding pickle protocol 0 data created in Python 2. Look at unicode_escape and 
raw_unicode_escape codecs for doing similar decoding to strings in Python 3.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2017-06-07 Thread Matthieu Dartiailh

New submission from Matthieu Dartiailh:

codecs.escape_decode does not appear in the codecs documentation. This function 
is to my knowledge the only convenient way to process the escaped characters in 
a literal string (actually found here 
https://stackoverflow.com/questions/4020539/process-escape-sequences-in-a-string-in-python).
 It is most useful when implementing a parser for a language extending python 
semantic while retaining python processing of string (cf 
https://github.com/MatthieuDartiailh/enaml).

Is there a reason for that function not being documented ?

--
assignee: docs@python
components: Documentation
messages: 295342
nosy: docs@python, mdartiailh
priority: normal
severity: normal
status: open
title: Missing documentation for codecs.escape_decode
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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