Commit Graph

46 Commits

Author SHA1 Message Date
Takeshi KOMIYA
654458b525 Close #8813: Show what extension caused it on errors on event handler
Show the module name of the event handler on the error inside it to let
users know a hint of the error.
2021-02-04 22:35:48 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Jakob Lykke Andersen
ff7545a191 Allow NoUri from 'missing-reference' handlers.
Also extend documentation of 'missing-reference'.
2020-05-17 12:34:33 +02:00
Takeshi KOMIYA
fc523c3ccf A happy new year! 2020-01-01 11:15:42 +09:00
Takeshi KOMIYA
0a1d9e2b49 Migrate to py3 style type annotation: sphinx.errors 2019-12-25 02:02:06 +09:00
James McKinney
2f768cf5a7 Fix #6855: Non-RST translated text should be parsed by the appropriate parser 2019-12-16 01:38:22 +09:00
Takeshi KOMIYA
0d7bc86e7b refactor: move NoUri to sphinx.errors 2019-03-02 16:21:44 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Jon Dufresne
ade973f4e3 Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.

https://docs.python.org/3/library/functions.html#super
2018-12-15 08:35:55 -08:00
Takeshi KOMIYA
6bc357140d Replace all "unicode" type by "str" 2018-12-15 23:57:43 +09:00
Takeshi KOMIYA
3c99d00605 Add sphinx.util.typing:unicode to help mypy-3 migration 2018-11-24 23:19:51 +09:00
Jon Dufresne
710ca3d7c3 Use super() to call parent class's method 2018-11-11 13:07:12 -08:00
Jon Dufresne
9d6deec4ca Fix AttributeError in ExtensionError
In Python 3, the attribute BaseException.message doesn't exist.

$ python3
>>> from sphinx.errors import ExtensionError
>>> e = ExtensionError('foo')
>>> repr(e)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sphinx/sphinx/errors.py", line 65, in __repr__
    return '%s(%r)' % (self.__class__.__name__, self.message)
AttributeError: 'ExtensionError' object has no attribute 'message'
2018-09-09 11:50:56 -07:00
Takeshi KOMIYA
99e6964152 Handle errors on scanning documents (refs: #5114) 2018-07-16 14:56:46 +09:00
Takeshi KOMIYA
3ffde92c54 Add BuildEnvironment.setup() to re-initialize (after unpickle) 2018-05-21 10:36:22 +09:00
Takeshi KOMIYA
9efaf18852 Merge branch '1.7' 2018-03-18 01:21:01 +09:00
Takeshi KOMIYA
70a622b86c Revert "Use typing.TYPE_CHECKING for typehints"
This reverts commit a073e17537.
2018-03-13 23:23:15 +09:00
Takeshi KOMIYA
f8bb40ab30 Merge branch '1.7' 2018-02-18 12:39:07 +09:00
Takeshi KOMIYA
a073e17537 Use typing.TYPE_CHECKING for typehints 2018-02-14 22:57:38 +09:00
Takeshi KOMIYA
3413590edd Merge pull request #4436 from stephenfin/directory-validation
app: Centralize directory validation
2018-01-21 01:02:45 +09:00
Stephen Finucane
3a85b3502f app: Centralize directory validation
This allows us to avoid duplication of code and ensure validation
happens regardless of who's initializing the class. We introduce a new
exception - ApplicationError - to indicate these kinds of issues. This
subclasses SphinxError, meaning we don't need to modify our exception
handling code.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 13:04:29 +00:00
Stephen Finucane
391cd8195b doc: Move sphinx.errors API docs to code
This allows us to do something like 'help(sphinx.errors)' in code. We
reword the exception descriptions per Python stdlib conventions.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-20 12:47:49 +00:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
Takeshi KOMIYA
8f9dd64992 Merge branch 'stable' 2017-03-26 11:52:15 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Takeshi KOMIYA
6fa0262802 Fix mypy violations 2017-02-08 18:38:42 +09:00
Takeshi KOMIYA
83db04ae40 Fix flake8 violation 2017-01-08 01:52:21 +09:00
Takeshi KOMIYA
4153ee0d9d Fix Sphinx crashes on parallel build with an extension which raises unserializable exception 2017-01-08 01:38:45 +09:00
Matthias Geier
f100749300 Derive SphinxParallelError from SphinxError 2016-05-20 13:38:25 +02:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01:00
Georg Brandl
567d52f199 all: update copyright 2015-01-03 21:36:32 +01:00
Georg Brandl
1f23a5c369 Factor out parallel building into a utility class. Better error handling
with traceback of the parallel process saved in the error log.
2014-09-22 16:21:04 +02:00
Georg Brandl
e030031321 Update copyright year. 2014-03-01 08:18:16 +01:00
Georg Brandl
151856819c Copyright update. 2013-01-01 22:13:15 +01:00
Georg Brandl
0e1db6ad90 New year update. 2011-01-04 10:00:51 +01:00
Georg Brandl
baf0087f3a merge with trunk 2010-01-17 18:29:16 +01:00
Georg Brandl
5a9a454631 Added `needs_sphinx config value and Sphinx.require_sphinx` application API function. 2010-01-17 18:24:35 +01:00
Georg Brandl
5d40d8bd63 merge with trunk 2010-01-17 14:24:24 +01:00
Georg Brandl
177e0d19ee Move getting module source to util. 2010-01-13 23:43:43 +01:00
Georg Brandl
43d08313a0 Improve the handling of non-Unicode strings in the configuration:
warn about non-ascii bytestrings, and give nicer messages if unicode errors
occur.
2010-01-12 10:45:38 +00:00
Georg Brandl
f6a56192d1 Happy new year! 2010-01-01 14:09:13 +01:00
Georg Brandl
b1dbe95255 #155: Fix Python 2.4 compatibility: exceptions are old-style classes there. 2009-05-10 21:14:14 +02:00
Georg Brandl
9ed275c868 #109: fix circular import problems by moving exceptions into their own module. 2009-02-24 19:15:39 +01:00