This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add encoding to DocFileSuite
Type: enhancement Stage:
Components: Unicode Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: dcjim Nosy List: bjoti, dcjim, quiver, tim.peters
Priority: normal Keywords:

Created on 2004-12-07 16:47 by bjoti, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
doctest-encoding.patch bjoti, 2005-09-13 20:12 Add encoding to DocFileSuite and testfile, so that non-ASCII characters can be used in tests.
doctest.diff quiver, 2006-05-14 17:42 2006-05-14 version
Messages (9)
msg54326 - (view) Author: Bjorn Tillenius (bjoti) Date: 2004-12-07 16:47
If one writes doctests within documentation strings of classes and 
functions, it's possible to use non-ASCII characters since one can 
specify the encoding used in the source file.

But if one wants to combine the documentation and testing, by 
writing a text file, and thus use DocFileSuite, it's not possible to use 
non-ASCII characters in the tests. This is because there's no way 
of specifying which encoding the text file uses. Instead one has to 
\-quote all non-ASCII characters, and that makes the tests harder 
to read IMHO.
msg54327 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-12-15 03:09
Logged In: YES 
user_id=31435

Unassigned myself -- can't make time to work on it.  I'll be 
happy to review a patch (code/tests/docs) if one appears.  I 
approve of the idea <wink>.
msg54328 - (view) Author: Bjorn Tillenius (bjoti) Date: 2004-12-18 14:08
Logged In: YES 
user_id=1032069

Added patch for Tim to review.
msg54329 - (view) Author: Bjorn Tillenius (bjoti) Date: 2004-12-18 18:05
Logged In: YES 
user_id=1032069

Uploaded new patch, which adds the possibility to specify an encoding to 
testfile as well, since I assume this is desirable.
msg54330 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2005-09-13 18:59
Logged In: YES 
user_id=31435

Ed, can you make time to review this patch?  If not, please 
unassign it again.
msg54331 - (view) Author: Bjorn Tillenius (bjoti) Date: 2005-09-13 20:12
Logged In: YES 
user_id=1032069

Attaching new version of the patch that will apply cleanly against latest CVS
msg54332 - (view) Author: Jim Fulton (dcjim) (Python triager) Date: 2005-11-14 22:50
Logged In: YES 
user_id=73023

The patch looks good to me.  I haven't looked at the tests,
but I assume that they are good too.  I will look at them. :)

I'm also going to add PEP 263-style encoding specification.

Thanks!
msg54333 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2006-05-14 17:42
Logged In: YES 
user_id=671362

Updated the patch for the trunk.
Documentation is also included.

If there is no objection, I'll commit it before 2.5 a3 
rolled out.
msg54334 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2006-05-28 17:14
Logged In: YES 
user_id=671362

Thanks Bjorn.
Commited in revision: 46502.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41294
2004-12-07 16:47:53bjoticreate