WikiApiary AutoFamily

WikiApiary is on the meta interwiki map ([[meta:IWM]]), and is a
useful dataset for the development of pywikibot, e.g. providing
lists of sites which use MediaWiki generator versions, which can
be used to test pywikibot against specific versions.

It will also be the only family registered in pywikibot that is
Semantic MediaWiki, so it may be useful when testing bugs relating
to Semantic MediaWiki.

Bug: 72854
Change-Id: Id5e7ee43e0ccf944f2375918fee7520c7884bf86
Fix tests after improvements in APISite.sametitle

The preloading tests where written before APISite.sametitle
was improved, however they landed after the sametitle change.
As a result, most of the builds broke.

Change-Id: I3381d693fb3d03708bcb0218d0ad95d90f1f8002
[FIX] Upload: Use fake filename in MIME header

The standard MIME request does only support ASCII characters in the
headers. As the value is apparently not interpreted it's replaced by
a dummy value, so Unicode characters in the file page name doesn't cause
pywikibot to receive an API error.

There is RFC2231 which is supported by both Python versions but not by
PHP on which the MediaWiki server rely (see bug: 73662). This does only
fix the uploads as it is unknown how to handle other MIME requests.

Bug: 73661
Change-Id: I5ea92dcf1115b675b56142494d805e75d389b7d4
Merge "[FIX] Upload: Use fake filename in MIME header"
Merge "WikiApiary AutoFamily"
Yahoo search dependency fixup

pagegenerators says that pYsearch is required to use the
YahooSearchPageGenerator, however setup.py is adding 'yahoo'
as the dependency.

Change-Id: Id942557b7a27f14f1d6b483ba112775dcedcfcc0
Remove incorrect 'test_utils' in requirements.txt

test_utils was incorrectly placed into requirements.txt.
In fact that was an implicit local import rather than a
dependency on the external package of the same name.
The local module was removed in b55d584.

Change-Id: I9844196af5914fb3cea44ec27140592de25f0beb
Require flickrapi 1.4.5 for Python 2

flickrapi 1.4.4 installs a logger, which breaks script tests.
flickrapi 1.4.5 and flickrapi 2.x do not have this problem.
Require at least 1.4.5 to avoid this problem, and allow users
to remain on a stable version with less dependencies.

This issue is not relevant to Python 3, as only flickrapi 2.x
will work on Python 3, and setuptools automatically selects it.

Bug: 71454
Change-Id: I58b732a3dae69797fe9bc27067a666c091be2e93
Allow unexpectedSuccess and expectedFailure

Python 3.4, and unittest2 0.8, error on unexpected successes
and warn on expected failure, if those conditions are not handled.

As these are used in pywikibot tests to capture current (usually wrong)
behaviour, and unexpected successes may be due to varying data and even
execution time in the case of script tests, it is not desirable
to fail the build as a consequence.  They need to be investigated
by a human to determine why the behaviour changed.

One way to handle them is to add hooks on the TestCase subclass,
_addUnexpectedSuccess and _addExpectedFailure.  This patch uses
that approach, reporting to stdout 'unexpected success' and
'expected failure', and marks the test as a success.  This closely
resembles the behaviour in Python 2.7, 3.3 and unittest2 0.6.

Change-Id: I8468cb4507414d55f38ec1f73beda311029f4f44
Merge "Require flickrapi 1.4.5 for Python 2"
Merge "Yahoo search dependency fixup"
Fix APISite.search incorrect deprecate_arg used

APISite.search listed 'number' as a deprecated argument
name for the new argument 'limit'.  However 'limit' isn't
a valid argument; 'total' is the valid argument name.

Change-Id: I3ea14e96de1bb87674c42859189c7ff2f791d436
[FIX] Logentries: Use the query's site argument

The 'title' and 'new_title' methods of LogEntry and MoveEntry both don't
use the site used to generate the log entries but the default site
object.

This is a breaking change as LogEntry and LogEntryFactory now require a
site parameter.

Bug: T75723
Change-Id: Ia965ce5c4733f9fef84d58f556dd4b1f5d46fc8b
[WIP] Merge commons_category_redirect.py

- use wikidata to get localized Non-empty_category_redirects
  category with -tiny option.
- Set cooldown days with -delay option
- CategoryRedirectBot becomes a subclass of pywikibot.Bot
- split code into pars

Change-Id: Iaa36e36ee39689e376c181df36784a189b40bc4f
Merge "Allow unexpectedSuccess and expectedFailure"
Add French support to dn_template

Requested and confirmed on IRC and French Wikipedia.
https://fr.wikipedia.org/w/index.php?diff=109292075&oldid=109291315

Change-Id: Ie3ee521600a5169b50ed3187a22097d643fe89ec
Set __signature__ in decorators

PEP 362 introduces __signature__ for functions as a way to alter
function arguments in a decorator in a way that can be reliably
inspected.  It is first implemented in Python 3.3, but not complete
until Python 3.4, which includes inspect.unwrap.  Back ports are
available, and should be used before __signature__ is relied upon.

Sphinx 1.3 on Python 3.4 uses the inspect module to automatically
describe function arguments, allowing documentation to be accurate
even in the presence of decorators.

deprecated_args updates the signature to include the deprecated
arguments, either providing a note in the default value, or
a default of NotImplemented if there is no substitute argument.

Change-Id: I2aeef8c8f31cdb01f18e199834b2f1a8ef8b043c
Permissive Timestamp fromX methods

Several methods of site and page classes return a Timestamp where
previously they returned a string which should be passed to the
Timestamp class to create a Timestamp object.
In order to improve compatibility with old versions of pywikibot,
Timestamp should recognise it is being passed a Timestamp, and not
try to parse it.

Change-Id: Ifb850b3e52c0fb1b84f2da433f50cb142f854591
Merge "Set __signature__ in decorators"
Merge "Permissive Timestamp fromX methods"