Traceback (most recent call last):
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 399, in
<module>
if not main():
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 391, in main
run_python_file(filename,
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 106, in
run_python_file
exec(compile(source, filename, 'exec', dont_inherit=True),
File "./scripts/replace.py", line 1075, in <module>
main()
File "./scripts/replace.py", line 929, in main
single_summary = i18n.twtranslate(
File
"/data/data/com.termux/files/home/vikaspy/pywikibot/tools/_deprecate.py",
line 404, in wrapper
return obj(*__args, **__kw)
File "/data/data/com.termux/files/home/vikaspy/pywikibot/i18n.py", line
700, in twtranslate
raise pywikibot.exceptions.TranslationError(
pywikibot.exceptions.TranslationError: Unable to load messages package
scripts.i18n for bundle replace-replacing
It can happen due to lack of i18n submodule or files. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18n
CRITICAL: Exiting due to uncaught exception <class
'pywikibot.exceptions.TranslationError'>
$
Hi all,
I'm building a small pywikibot tool[1] which is designed to be installed
via pip (and in turn installs Pywikibot via pip).
The tool uses the page.touch() function which is where I get a
pywikibot.i18n.TranslationError when I run it.
page.touch() gets it's edit summary from i18n.twtranslate(self.site,
'pywikibot-touch') which in turn is defined in /scripts/i18n/pywikibot/.
Unless I'm confused the Error occurs because the pip distribution does not
include the /scripts folder or the i18n submodule.
So my first question is am I just doing something obviously wrong and the
i18n submodule should have been available over pip as well?
If it's not just me then would it not make sense to have any i18n files
necessary to the Pywikibot *library* to also be distributed via the same
pip package? (i18n for scripts is another issue since for scripts you
cannot use pip).
Cheers,
André / Lokal_Profil
[1] https://github.com/lokal-profil/pywikibot-sdc
André Costa | Chief Operating Officer, Wikimedia Sverige |
Andre.Costa(a)wikimedia.se | +46 (0)733-964574
Stöd fri kunskap, bli medlem i Wikimedia Sverige.
Läs mer på blimedlem.wikimedia.se
------
sent from my mobile, all typos are due to autocorrect ;)
Hi lovely pywikibot folks. I'd like to clean up our deprecated code
since we have some that's six years old....
% grep -RIoh "since='[^']\+'" ./* | sort | head -n 5
since='20150206'
since='20150515'
since='20150615'
since='20150617'
since='20150619'
% grep -RIoh "since='[^']\+'" ./* | wc -l
130
What is pywikibot's policy regarding code deprecation? Can we remove
it after a set duration and, if so, what is it?
Thanks! -Damian
Hello,
As you may know, Wikibase currently does not normalize pagenames/filenames
on save (e.g. underscores in the input for properties of datatype Commons
media are allowed). At the same time, Wikidata’s quality constraints
extension
<https://www.mediawiki.org/wiki/Extension:WikibaseQualityConstraints>
triggers a constraint violation after saving, if underscores are used. This
is by design as to long-established
<https://www.wikidata.org/wiki/Template:Constraint:Commons_link> Community
practices. As a result, this inconsistency leaves users with unnecessary
manual work.
We will update Wikibase so that when a new edit is saved via UI or API, and
a pagename/filename is added or changed in that edit, then this
pagename/filename will be normalized on save ("My file_name.jpg" -> "My
file name.jpg").
More generally, the breaking change is that a user of the Wikibase API may
send one data value when saving an edit, and get back a slightly different
(normalized) data value after the edit was made: it is no longer the case
that data values are either saved unmodified or totally rejected (e.g. if a
file doesn’t exist on Commons). Since this guarantee is being removed with
this breaking change announcement, we may introduce further normalizations
in the future and only announce them as significant changes, not breaking
changes.
The change is currently available on test.wikidata.org and
test-commons.wikimedia.org. It will be deployed on Wikidata on or shortly
after September 6th. If you have any questions or feedback, please feel
free to let us know in this ticket
<https://phabricator.wikimedia.org/T251480>.
Cheers,
Lucas Werkmeister
--
Lucas Werkmeister (he/er)
Full Stack Developer
Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
https://wikimedia.de
Imagine a world in which every single human being can freely share in the
sum of all knowledge. Help us to achieve our vision!
https://spenden.wikimedia.de
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.
Whenever I try using the bot it says
"The 'setuptools>=20.2; python_version >= "3.6"' distribution was not found
and i
s required by the application
A package necessary for pywikibot is missing.
Please update required module with:
pip install "setuptools>=20.2"
"
I ran the pip install "setuptools>=20.2" command and it keeps saying this
NB: I have recently run the "pip install -r requirements.txt" too
Since a few hours, running my bot on Wikidata I am getting the following error:
(snip)
File "/home/ae1101/bot/pywikibot/page/__init__.py", line 3900, in __init__
ns = site.item_namespace
File "/home/ae1101/bot/pywikibot/site/_datasite.py", line 91, in
item_namespace
self._item_namespace = self.get_namespace_for_entity_type('item')
File "/home/ae1101/bot/pywikibot/site/_datasite.py", line 80, in
get_namespace_for_entity_type
.format(self, entity_type))
pywikibot.exceptions.EntityTypeUnknownError: DataSite("wikidata",
"wikidata") does not support entity type "item"
CRITICAL: Exiting due to uncaught exception <class
'pywikibot.exceptions.EntityTypeUnknownError'>
Apparently something has changed in the site, but I have no idea what to do...
--
André Engels, andreengels(a)gmail.com
Hello,
I am using my bot to get information on people from linked sites to
Wikidata. I think it's a fun and useful thing to do, but one problem I
find is that I often find myself doing dozens of edits to the same
page in a row, which takes a considerable amount of time, and also
seems to put more pressure on the database than seems necessary.
Because of this my question:
Is it possible with the pywikibot to make multiple changes to Wikidata
(or a similar data site) and have them saved as a single edit? If so,
where in the code can I find it, if not, would it be possible to
create it?
Thanks in advance,
--
André Engels, andreengels(a)gmail.com