| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We need a review of the "string output" interface and a consensus
on the "clean" end-state before starting with the implementation.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9369 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add "auto_encode" argument to publish_string() and
publish_programmatically() to give the user an option to select the
output type (`bytes` or `OutString`) in a way that does not interfere
with the intended encoding of the output
(the problem with the "dummy" output encoding name ``unicode``).
The default will change from ``False`` to ``True`` in Docutils 0.22
New class for `io.StringOutput`: `io.OutString` adds "encoding"
and "errors" attributes to `str`.
Allows storing the "output_encoding" and "output_encoding_error_handler"
settings in a transparent and easy to process way.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9336 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
There are standard `io` and `docutils.io`.
Avoid ambiguity by not using ``from docutils import io``.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9329 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
Value `None` cannot be specified on the command line.
Use ``--input-encoding=""`` go back to Docutil's default behaviur
(use encoding indicated in the file or fallbacks)
if a config file sets "input_encoding" to another value.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9303 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
Up to Python 3.8, __file__ returns a relative path for the main script
specified on the command line. Use `Path.resolve()` to make it absolute before
calling `Path.parents`.
https://docs.python.org/3/whatsnew/3.9.html#other-language-changes
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9277 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
Running standard unittest on the test suite resulted in 89 ImportErrors
because ``import DocutilsTestSupport was used to set up sys.path()
but the module could not be found on the original sys.path().
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9274 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the test suite only worked when the current working
directory was ``docutils/test/`. With this change all relative paths
are calculated explicitly such that the working directory no longer
affects the tests, meaning a less fragile test environment and
greater flexibility to use test runners other than ``alltests.py``.
This is part of the test suite refactoring project.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9236 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
Remove exception for Py3k input encoding handling in 0.18.
Input detection is now always used if the `input_encoding` setting
is not specified.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9110 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9109 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
In future, the removal of BOM marks will be handled by the codec,
leading to different "successful_encoding" values but the same result.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9108 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
Currently, one test fails due to invalid utf-16.
Four tests fail if the locale encoding is a legacy 8-bit encoding due to
character mix-up (mojibake) despite a correct encoding declaration in the
file.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9097 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
The attribute was moved to "io" after the last release.
Backwards compatibility is ensured via `locale_encoding`
in the (deprecated) "utils.error_reporting" module.
Fix HISTORY entries.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9078 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove dead link and outdated footnote about limitations in Python2.
Add link to acceptable values of encoding error handlers.
Harmonise help output.
Use UTF-8 in prose text, error messages, and documentation.
Use 'utf-8' in code or when referring to code.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9077 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
Use `locale.getpreferredencoding(False)` since we dropped support
for older Python versions with side-effects.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9074 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
flake rule F841: local variable 'foo' is assigned to but never used
In test_odt.py, a no-op class definition is removed completely.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9038 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
flake8 rule F401
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
flakei rule E303: too many blank lines (N)
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
flake 8 rule E261
Exceptions for modules sheduled for removal or with
3rd-party origin and for data collections.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flake8 rules
E225: missing whitespace around operator
E226: missing whitespace around arithmetic operator
E228: missing whitespace around modulo operator
Keep ignoring the latter two rules:
PEP8 limits the recommendation to "operators with lowest priority"
"if operators with different priorities are used".
flake8 also flags top level operators.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
Use unicode.assertWarnsRegex() instead of "hand written"
warnings catching.
Use unicode.assertRaises() as context manager
(unless this would mean an additional code line).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9011 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check conformance to our coding policies with flake8.
Fix the following problems:
E111 indentation is not a multiple of four
E114 indentation is not a multiple of four (comment)
E115 expected an indented block (comment)
E116 unexpected indentation (comment)
E117 over-indented
E121 continuation line under-indented for hanging indent
E122 continuation line missing indentation or outdented
E124 closing bracked does not match visual indentaion
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
E131 continuation line unaligned for hanging indent
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
W293 blank line contains whitespace
W391 blank line at end of file
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8993 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update comments
One more generator expression instead of lists.
Fix unbound variable.
Drop duplicate import.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8990 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
Patch by Adam Turner.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove duplicate definitions in language modules.
Import locale_encoding from `docutils.io`
Use decorator for staticmethod
Use True/False over 1/0.
`collections.OrderedDict` no longer required,
all dictionaries are ordered from Python 3.7
Remove obsolete `__cmp__` method
cf. https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons
Use str instead of type('').
Zero-argument ``super()``
Simplify test support module as
"u" prefix isn't used by repr in Python 3.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
SafeString not required in Python 3
ErrorString obsoleted by new function io.error_string().
ErrorOutput and locale_encoding moved to docutils.io.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8937 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
Use "python3" in the shebang line
(cf. PEP 394 -- The "python" Command on Unix-Like Systems).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8927 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8880 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
- Make `frontend.ConfigDeprecationWarning` a subclass of `FutureWarning`
as it is also intended for end users.
https://docs.python.org/3/library/warnings.html#warning-categories
- Update deprecation warning tests.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8879 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
Remove all uses of print as a statement. This includes comments, many of
which are simply removed as noise (they're in version control and can be
re-added later, if necessary).
Signed-off-by: Stephen Finucane <stephen@that.guru>
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8283 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8282 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
deprecated (thanks to hugovk).
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8228 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8164 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8163 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
The heuristics is skipped under Py3k unless decoding with locale encoding
fails.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8098 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7622 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7620 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
Cleanup of the workarounds for Py3k encoding problems.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7525 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7464 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7463 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
Prevent test error under Python 3. Add tests for FileOutput. Document.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7440 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
release)
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7400 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7248 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7217 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
* 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@7037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7036 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|