Replace whole repo with latest content from branch stream-0.14-rhel-8.8.0

This commit is contained in:
Honza Horak 2023-05-15 21:34:32 +02:00 committed by root
parent 8e3dca47d3
commit 83e3fdfe9d
8 changed files with 215 additions and 5 deletions

10
.gitignore vendored
View File

@ -1 +1,9 @@
SOURCES/docutils-0.14.tar.gz
docutils-0.7.tar.gz
/docutils-0.8.tar.gz
/docutils-0.8.1.tar.gz
/docutils-0.9.1.tar.gz
/docutils-0.10.tar.gz
/docutils-0.11.tar.gz
/docutils-0.12.tar.gz
/docutils-0.13.1.tar.gz
/docutils-0.14.tar.gz

View File

@ -0,0 +1 @@
32cefb69ac3dab5b04c4d150776f35419cc4c863 docutils-0.14.tar.gz

View File

@ -0,0 +1,23 @@
diff -up docutils-0.10/docutils/writers/docutils_xml.py.bak docutils-0.10/docutils/writers/docutils_xml.py
--- docutils-0.10/docutils/writers/docutils_xml.py.bak 2012-07-30 20:57:20.000000000 -0700
+++ docutils-0.10/docutils/writers/docutils_xml.py 2012-08-14 07:51:20.389219183 -0700
@@ -11,6 +11,19 @@ http://docutils.sourceforge.net/docs/ref
__docformat__ = 'reStructuredText'
import sys
+
+# Work around broken PyXML and obsolete python stdlib behaviour (The
+# stdlib replaces its own xml module with the unmaintained PyXML if PyXML
+# is installed.) Reverse the order in which xml module and submodules are
+# searched to import stdlib modules if they exist and PyXML modules if they
+# do not exist in the stdlib.
+#
+# See http://sourceforge.net/tracker/index.php?func=detail&aid=3552403&group_id=38414&atid=422030
+# and http://lists.fedoraproject.org/pipermail/python-devel/2012-July/000406.html
+import xml
+if "_xmlplus" in xml.__path__[0]: # PyXML sub-module
+ xml.__path__.reverse() # If both are available, prefer stdlib over PyXML
+
import xml.sax.saxutils
from StringIO import StringIO

View File

@ -0,0 +1,30 @@
Index: docutils-0.9.1/docutils/parsers/rst/directives/misc.py
===================================================================
--- docutils-0.9.1.orig/docutils/parsers/rst/directives/misc.py
+++ docutils-0.9.1/docutils/parsers/rst/directives/misc.py
@@ -10,6 +10,7 @@ import sys
import os.path
import re
import time
+import locale
from docutils import io, nodes, statemachine, utils
from docutils.error_reporting import SafeString, ErrorString
from docutils.parsers.rst import Directive, convert_directive_function
@@ -474,6 +475,17 @@ class Date(Directive):
'a substitution definition.' % self.name)
format = '\n'.join(self.content) or '%Y-%m-%d'
text = time.strftime(format)
+ if sys.version_info< (3, 0):
+ try:
+ text = unicode(text, locale.getpreferredencoding())
+ except UnicodeError:
+ try:
+ text = unicode(text, 'utf-8')
+ except UnicodeError:
+ # Fallback to something that can decode all bytes to
+ # something. Alternative fallback would be to decode
+ # with errors='replace'
+ text = unicode(text, 'latin-1')
return [nodes.Text(text)]

View File

@ -0,0 +1,49 @@
Index: docutils-0.8.1/docutils/frontend.py
===================================================================
--- docutils-0.8.1.orig/docutils/frontend.py
+++ docutils-0.8.1/docutils/frontend.py
@@ -33,6 +33,7 @@ import sys
import warnings
import ConfigParser as CP
import codecs
+import locale
import optparse
from optparse import SUPPRESS_HELP
import docutils
@@ -193,7 +194,36 @@ def make_paths_absolute(pathdict, keys,
value = make_one_path_absolute(base_path, value)
pathdict[key] = value
+def _bytes_path_to_unicode(path):
+ '''Change a byte str path segment into unicode
+
+ Note that this is arguably wrong for Unix systems. Unix filesystem paths
+ are bytes that programs interpret as characters. Filesystem paths are in
+ no way guaranteed to be decodable into unicode. So this could traceback
+ if the locale_encoding can't deal with any byte string and it could give
+ wrong values if the locale_encoding does not match the encoding of
+ a single one of the path component's values.
+
+ However, the rest of docutils is turning command line args containing
+ filenames into unicode so switching to unicode is more inline with the
+ strategy taken by the rest of docutils.
+ '''
+ # converting to Unicode (Python 3 does this automatically):
+ if sys.version_info < (3,0):
+ # TODO: make this failsafe and reversible
+ # locale.getpreferredencoding is not to be preferred to getlocale or
+ # getdefaultlocale but it is preferred to hardcoding a value. We end
+ # with latin-1 because it's one of the encodings that is valid for
+ # every byte.
+ encoding = locale_encoding or locale.getpreferredencoding() or 'latin-1'
+ path = unicode(path, encoding)
+ return path
+
def make_one_path_absolute(base_path, path):
+ if isinstance(base_path, unicode) and not isinstance(path, unicode):
+ path = _bytes_path_to_unicode(path)
+ elif isinstance(path, unicode) and not isinstance(base_path, unicode):
+ base_path = _bytes_path_to_unicode(base_path)
return os.path.abspath(os.path.join(base_path, path))
def filter_settings_spec(settings_spec, *exclude, **replace):

37
fix-dict-ordering.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up docutils-0.10/docutils/writers/latex2e/__init__.py.py33 docutils-0.10/docutils/writers/latex2e/__init__.py
--- docutils-0.10/docutils/writers/latex2e/__init__.py.py33 2012-08-07 14:57:41.057751711 -0400
+++ docutils-0.10/docutils/writers/latex2e/__init__.py 2012-08-07 14:57:46.730751705 -0400
@@ -379,7 +379,7 @@ class Babel(object):
def __call__(self):
"""Return the babel call with correct options and settings"""
- languages = self.otherlanguages.keys()
+ languages = sorted(self.otherlanguages.keys())
languages.append(self.language or 'english')
self.setup = [r'\usepackage[%s]{babel}' % ','.join(languages)]
if 'spanish' in languages:
diff -up docutils-0.10/docutils/writers/xetex/__init__.py.py33 docutils-0.10/docutils/writers/xetex/__init__.py
--- docutils-0.10/docutils/writers/xetex/__init__.py.py33 2012-08-07 14:42:22.041753020 -0400
+++ docutils-0.10/docutils/writers/xetex/__init__.py 2012-08-07 14:44:51.983751704 -0400
@@ -117,7 +117,7 @@ class Babel(latex2e.Babel):
r'\setdefaultlanguage{%s}' % self.language]
if self.otherlanguages:
setup.append(r'\setotherlanguages{%s}' %
- ','.join(self.otherlanguages.keys()))
+ ','.join(sorted(self.otherlanguages.keys())))
return '\n'.join(setup)
diff -up docutils-0.10/test/functional/expected/standalone_rst_latex.tex.py33 docutils-0.10/test/functional/expected/standalone_rst_latex.tex
diff -up docutils-0.10/test/functional/expected/standalone_rst_xetex.tex.py33 docutils-0.10/test/functional/expected/standalone_rst_xetex.tex
--- docutils-0.10/test/functional/expected/standalone_rst_xetex.tex.py33 2012-08-07 14:52:09.929751238 -0400
+++ docutils-0.10/test/functional/expected/standalone_rst_xetex.tex 2012-08-07 14:52:30.932751704 -0400
@@ -7,7 +7,7 @@
\usepackage{amsmath}
\usepackage{polyglossia}
\setdefaultlanguage{english}
-\setotherlanguages{german,british,french}
+\setotherlanguages{british,french,german}
\usepackage{color}
\usepackage{float} % float configuration
\floatplacement{figure}{H} % place figures here definitely

66
fix-failing-tests.patch Normal file
View File

@ -0,0 +1,66 @@
From 54f4b07302ce3ced064f7093d86b00c2fe1e81c0 Mon Sep 17 00:00:00 2001
From: Charalampos Stratakis <cstratak@redhat.com>
Date: Thu, 5 May 2016 17:48:26 +0200
Subject: [PATCH] Fix failing tests
---
test/test_parsers/test_rst/test_directives/test_code.py | 6 +++---
test/test_parsers/test_rst/test_directives/test_code_long.py | 2 +-
test/test_parsers/test_rst/test_interpreted.py | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/test_parsers/test_rst/test_directives/test_code.py b/test/test_parsers/test_rst/test_directives/test_code.py
index 219a975..8168357 100644
--- a/test/test_parsers/test_rst/test_directives/test_code.py
+++ b/test/test_parsers/test_rst/test_directives/test_code.py
@@ -107,10 +107,10 @@ totest['code-parsing'] = [
<inline classes="keyword">
print
\n\
- <inline classes="literal string">
+ <inline classes="literal string single">
'hello world'
\n\
- <inline classes="comment">
+ <inline classes="comment single">
# to stdout
"""],
["""\
@@ -155,7 +155,7 @@ totest['code-parsing'] = [
<inline classes="ln">
11 \n\
\n\
- <inline classes="comment">
+ <inline classes="comment single">
# and now for something completely different
\n\
<inline classes="ln">
diff --git a/test/test_parsers/test_rst/test_directives/test_code_long.py b/test/test_parsers/test_rst/test_directives/test_code_long.py
index 6adf631..d2e5dbb 100644
--- a/test/test_parsers/test_rst/test_directives/test_code_long.py
+++ b/test/test_parsers/test_rst/test_directives/test_code_long.py
@@ -60,7 +60,7 @@ totest['code-parsing-long'] = [
<inline classes="ln">
11 \n\
\n\
- <inline classes="comment">
+ <inline classes="comment single">
# and now for something completely different
\n\
<inline classes="ln">
diff --git a/test/test_parsers/test_rst/test_interpreted.py b/test/test_parsers/test_rst/test_interpreted.py
index 7beab09..a9227e2 100755
--- a/test/test_parsers/test_rst/test_interpreted.py
+++ b/test/test_parsers/test_rst/test_interpreted.py
@@ -283,7 +283,7 @@ Python code :python:`print("The end")`.
print
<inline classes="punctuation">
(
- <inline classes="literal string">
+ <inline classes="literal string double">
"The end"
<inline classes="punctuation">
)
--
2.5.5

View File

@ -1,4 +0,0 @@
# exclude XML template (not always valid) from XML validity check:
xml:
ignore:
- /usr/lib/python*/site-packages/docutils/writers/pep_html/template.txt