summaryrefslogtreecommitdiff
path: root/docutils/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Do not close() sys.stdin, sys.stdout, or sys.stderr. milde2011-07-071-2/+3
| | | | | | | Prevents ``Exception ValueError: I/O operation on closed file.`` with Python 3. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7073 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New sub-module and test suite for error reporting.milde2011-05-191-15/+3
| | | | | | | | * Code to handle encoding/decoding errors when reporting exceptions. * Test and fix error reporting with problematic locale settings. (https://bugs.gentoo.org/show_bug.cgi?id=349101) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use io.ErrorOutput in utils.Reportermilde2011-05-111-18/+8
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7032 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More robust guess of input/output encoding.milde2011-05-041-7/+1
| | | | | | | | The locale encoding is stored as `frontend.locale_encoding` and used in command line parsing and `default_error_encoding` before falling back to "ascii". git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7023 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix typogrubert2011-04-261-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7019 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Workaround for unicode messages in Exception instances with Python < 2.6.milde2011-04-121-0/+15
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7007 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor fixes for Python 3.1milde2011-01-031-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6509 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply patch by Kirill Smelkov to fix [ 3139667 ].milde2010-12-201-3/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6505 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* exclude combining chars from column_width (partial fix for [ 2926161 ])milde2010-11-101-13/+15
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6476 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Handle language codes according to BCP 47 milde2010-09-171-1/+32
| | | | | | | | | | | | | (Best Current Praxis: Tags for Identifying Languages). Normalize language tags: downcase, - to _, optional subtags. E.g. Given "de-AT-1901", look for language modules "de_at_1901", "de_at", "de_1901", and "de" TODO: warn (instead of fail), if no module found. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6423 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fix assertion syntaxmilde2010-08-201-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6394 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* strip whitespace from stylesheet argumentsmilde2010-08-201-5/+7
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6393 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added settings & components instructions to new_documentgoodger2010-08-161-1/+9
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6391 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 2788716 ] reporting problems in included files.milde2010-04-261-5/+14
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6314 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More fixes for reporting issues in included source files.milde2010-04-151-2/+2
| | | | | | | | | The following problems now correctly report the source file name and the line number in this file: admonition without title, section underline too short, no blank line after table, Unexpected section title. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6307 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix py3k problem: sys.stderr expects a unicode string.milde2010-03-221-12/+14
| | | | | | | In Python 3, text output auto-encodes the given string and fails if given an already encoded (i.e. binary) string. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6271 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix failsave filename to Unicode conversion.milde2010-03-161-3/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6266 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 2923723 ] let decode_path() tolerate path == Nonemilde2010-01-081-0/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6216 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* (partially) Fix reporting for problems in included files.milde2009-10-281-0/+5
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6188 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 2781629 ] support non-ASCII chars in file names.milde2009-09-101-5/+31
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6120 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply [ 2834836 ] print info at halt.milde2009-09-031-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@6113 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Convert docutils to Python 3 (at least so that it runs the test suite.)gbrandl2009-04-011-1/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5889 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* docstring fixgoodger2009-02-241-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5877 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Stylesheet handling for html and latex2e writer: milde2008-12-161-6/+13
| | | | | | | | | accept multiple stylesheets, do not rewrite path if stylesheet is to be embedded, load latex packages with \\usepackage; fix custom role handling in latex2e: command definition was missing in output git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5823 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* utils.py: let DependencyList.add() accept multiple file arguments,milde2008-12-091-6/+7
| | | | | | html4css1/__init__.py: use this to register the list of stylesheets git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5812 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* restored get_stylesheet_reference functionality to pre-r5800; spelling & cleanupgoodger2008-12-081-10/+8
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5805 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fully backwards compatible implementation, als fixing the no-stylesheet case.milde2008-12-081-0/+20
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5803 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Enable comma separated list of stylesheets in html4ccs1milde2008-12-061-2/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5800 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare for python 3.0: minimize "types" module where possible (gbrandl).grubert2008-11-301-6/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5738 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Merged abolish-userstring-haskey r5609:5616 to trunk.strank2008-07-281-4/+4
| | | | | | Backwards compatible changes for easier transition to py3.0. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5618 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added named constants, removed magic numbersgoodger2007-04-031-7/+14
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5040 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* moved uniq() to utils.pywiemann2007-03-121-0/+7
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* remove circular importgoodger2007-02-121-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4912 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* use $Id$ instead of $Date$ and $Revision$;wiemann2006-05-211-4/+2
| | | | | | | | collapsed Author and Contact fields; use canonical email addresses for David and Felix; (I have reviewed the diff) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4564 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* docstring correctiongoodger2006-05-091-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4527 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added East Asian double-width character support; thanks to Frank Bennett for ↵goodger2005-12-071-0/+26
| | | | | | inspiration on ``docutils.utils.east_asian_column_width()`` git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4152 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fixed some docstringswiemann2005-06-271-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3592 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* merge trunk/docutils@3525 branches/blais_interrupt_render/docutils@HEAD ↵wiemann2005-06-261-7/+22
| | | | | | trunk/docutils git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3581 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* applied patch to fix broken set_conditions method;wiemann2005-05-291-1/+1
| | | | | | closing https://sourceforge.net/tracker/?func=detail&atid=422030&aid=1210637&group_id=38414 git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3408 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* str(Exception) doesn't work for anything but ASCII Exception texts, sowiemann2005-04-251-1/+1
| | | | | | | | | | | | | | '%s' % exception_instance is unsafe unless exception_instance.args contains only byte strings. The change in alltests.py is a first attempt to catch such cases where a str(Exception) is done with an Exception text which is not necessarily ASCII-only (i.e. with a unicode string in Exception.args), but since most input data (in the totest dicts) is passed in as byte strings, it doesn't catch much. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3253 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* typowiemann2005-04-211-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* clarified warninggoodger2005-04-171-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3227 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* restored utils.Reporter.set_conditions (with deprecation warning) for ↵goodger2005-04-161-0/+12
| | | | | | compatibility git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3223 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* merged reporter-categories branch into trunk: removed ↵goodger2005-04-051-87/+33
| | | | | | docutils.utils.Reporter.categories, docutils.utils.ConditionSet, and all references to them, to simplify error reporting git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3171 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* made issuing debug-system_messages conditionalwiemann2005-03-281-1/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3143 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* moved ``escape2null`` and ``unescape`` functions from ↵goodger2004-11-061-0/+25
| | | | | | docutils/parsers/rst/states.py git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2815 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* setting footnote_references to "superscript" or "brackets" now causeswiemann2004-09-301-0/+15
| | | | | | | footnote-reference-space to be trimmed or not, resp. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2681 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* improved DependencyList.__repr__; whitespacegoodger2004-09-301-8/+9
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2672 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added close() method for DependencyListwiemann2004-09-291-0/+10
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2670 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added get_stylesheet_reference(); added documentation for DependencyList;wiemann2004-09-281-1/+38
| | | | | | | made DependencyList.set_output() clear the list of already added dependencies git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2663 929543f6-e4f2-0310-98a6-ba3bd3dd1d04