mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix warnings originating from bad regexes
Starting with python 3.6 warnings are issued for invalid escape sequences in regular expressions. This commit corrects all DeprecationWarning's via properly declaring the offending regular expressions as raw strings. Resolves #2095.
This commit is contained in:
parent
fb07f4d513
commit
89b28fd36b
6 changed files with 11 additions and 11 deletions
|
|
@ -712,7 +712,7 @@ Metadata
|
|||
|
||||
The default metadata you want to use for all articles and pages.
|
||||
|
||||
.. data:: FILENAME_METADATA = '(?P<date>\d{4}-\d{2}-\d{2}).*'
|
||||
.. data:: FILENAME_METADATA = r'(?P<date>\d{4}-\d{2}-\d{2}).*'
|
||||
|
||||
The regexp that will be used to extract any metadata from the filename. All
|
||||
named groups that are matched will be set in the metadata object. The
|
||||
|
|
@ -720,7 +720,7 @@ Metadata
|
|||
|
||||
For example, to extract both the date and the slug::
|
||||
|
||||
FILENAME_METADATA = '(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)'
|
||||
FILENAME_METADATA = r'(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)'
|
||||
|
||||
See also ``SLUGIFY_SOURCE``.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue