Commons:Village pump/Technical
Village pump/Technical |
Bug reports |
Code review |
Tools |
Tools/Directory |
Idea Lab |
This page is used for technical questions relating to the tools, gadgets, or other technical issues about Commons; it is distinguished from the main Village pump, which handles community-wide discussion of all kinds. The page may also be used to advertise significant discussions taking place elsewhere, such as on the talk page of a Commons policy. Recent sections with no replies for 30 days and sections tagged with {{Section resolved|1=--~~~~}} may be archived; for old discussions, see the archives; recent archives: /Archive/2023/06 /Archive/2023/07.
- Feature or bug reports should be filed on Phabricator (see how to report a bug). Bugs with security implications should be reported differently (see how to report security bugs).
- Have you read the FAQ?
SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days. | |
GeographBot images seemingly not uploading/cropping correctlyEdit
Hi, strange issue here that has happened a few times now - after using the CropTool File:Gas bus in Wolverhampton bus station - geograph.org.uk - 4828426.jpg that was uploaded by User:GeographBot, File:Gas bus in Wolverhampton bus station - geograph.org.uk - 4828426 (cropped).jpg seemingly has uploaded with no summary and no complete indication of it's copyright status. The link to the Geograph page the uncropped image was uploaded from is also broken.
Again, this has happened a few times now, sometimes even on new uploads by GeographBot that I haven't edited. Is there something I've done wrong during the cropping process, or is this an issue with bot uploads? And either case, how can this be quickly rectified without manually having to copy over the information? Hullian111 (talk) 14:38, 26 May 2023 (UTC)
- @Hullian111: The problem is that GeographBot puts all the information about the image in structured data, but CropTool doesn't copy structured data from the source image to the destination. This results in a file whose wikitext just contains a template invoking the structured data, but whose structured data is empty. I don't know of a good solution to this, which is why Category:Images from Geograph Britain and Ireland with broken templates is accumulating cropped images. Pinging Multichill and Danmichaelo who I think are responsible for the two components in question. --bjh21 (talk) 14:47, 25 June 2023 (UTC)
- The solution is to update the croptool. Structured data has been around for about 5 years no, so it's about time that should happen. Multichill (talk) 20:45, 25 June 2023 (UTC)
Tech News: 2023-25Edit
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
Changes later this week
- There is no new MediaWiki version this week.
- There is now a toolbar search popup in the visual editor. You can trigger it by typing
\
or pressingctrl + shift + p
. It can help you quickly access most tools in the editor. [3][4]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 20:06, 19 June 2023 (UTC)
Correctiing coordinates in structured dataEdit
In File:Lake vinen sweden 2023.jpg, I don't seem to manage correcting the wrong coordinates in the structured template. The smartphone stored wrong coordinates in Exif data, I corrected {{Location}} manually, but I don't seem to be able to delete the wrong "coordinates of the point of view" in structured data, resp. to store the corrected data (nothing happens when I hit "Publish changes"). Any ideas? Gestumblindi (talk) 12:36, 20 June 2023 (UTC)
- Apparently, that's normal. See Commons:Village_pump/Technical/Archive/2023/01#Delete_wrong_coordinates_not_working, Commons:Village_pump/Technical/Archive/2023/02#Issues_with_coordinates_in_Structured_data, etc. Enhancing999 (talk) 07:37, 21 June 2023 (UTC)
- @Enhancing999: Thanks for the pointer. The workaround mentioned by El Grafo, temporarily changing the interface language to British English, worked for me, too. But that's not very nice, of course, and apparently, nobody cares for structured data if this is a known bug that has not been fixed for about a year now! Gestumblindi (talk) 16:54, 21 June 2023 (UTC)
intermittent cirrussearch-backend-error when trying to select category in Wikimedia Commons Android app?Edit
Trying to debug issue apps-android-commons #5225 when Commons app is spinning indefinitely and failing to select categories, it seems the underlying issue is that the server returns cirrussearch-backend-error when user tries to search for some category:
2023-06-17 11:24:48,366 [ERROR] [file-logging-thread-1] [OkHttpConnectionFactory$UnsuccessfulResponseInterceptor] : java.io.IOException: {"error":{"code":"cirrussearch-backend-error","info":"We could not complete your search due to a temporary problem. Please try again later.","docref":"See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."},"servedby":"mw1447"}
It happens quite often, but not always (e.g. it happened many dozens of times during whole day on 17 June 2023, but does not happen on 20 June 2023).
Is this a known issue; or can someone offer advice where to ask further? Mnalis (talk) 17:26, 20 June 2023 (UTC)
- For those interested, this latest outage was indeed worldwide server issue, as tracked in https://phabricator.wikimedia.org/T339810 and documented in https://wikitech.wikimedia.org/wiki/Incidents/2023-06-18_search_broken_on_wikidata_and_commons later. I'll assume previous encounters of the error are also likely to be such site-wide issues. Mnalis (talk) 21:25, 21 June 2023 (UTC)
Delete picturesEdit
Hello dear colleagues. Dear user User:CaesarIran, according to the edit I saw from him, some of the photos that were personal works were deleted. It seems that if he continues, there will be no photos left. Dicbrat (talk) 18:25, 20 June 2023 (UTC)
- File:لوگو سازمان منابع طبیعی و آبخیزداری کشور.jpg was deleted for "No permission". See notice on the uploader's talk ppage, at User talk:Nikdokht reza#File source is not properly indicated: File:لوگو سازمان منابع طبیعی و آبخیزداری کشور.jpg. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:23, 25 June 2023 (UTC)
Questions about the exact duplicate (speedy delete) process. {Edit
Here Category:Duplicate Ooligan (talk) 02:45, 21 June 2023 (UTC)
- It is difficult to find the history related to this speedy deletion process for "exact duplicate" files. Some records are deleted in addition to the target/ tagged "Duplicate" file itself.
- Could someone familiar with the details of how this process works, help answer some questions? -- Ooligan (talk) 04:03, 21 June 2023 (UTC)
Best way to upload a single page out of pdf separately?Edit
i want to upload https://commons.wikimedia.org/w/index.php?title=File%3ANTUL-0460304_%E5%BB%A3%E5%B7%9E%E5%B8%82%E7%AB%8B%E9%8A%80%E8%A1%8C%E7%9A%84%E6%96%B0%E4%BD%BF%E5%91%BD.pdf&page=128 as a new file. what's the best approach? best meaning quality as lossless as possible, and filesize as small as possible.
should i upload jpg/png/pdf? how should i extract that single page? any existent tool to do this task automatically (like give the pdf url and the page number -> upload)? RZuo (talk) 13:52, 25 June 2023 (UTC)
- @RZuo: Since it looks like a scanned image, I'd use
pdfimages
(part of Poppler and available in most Linux distributions) to extract the image from the PDF file and upload that. If you haven't gotpdfimages
conveniently available, let me know and I can upload that page. For more general PDF files, ones that aren't simple scanned images, I might use pdftk instead. --bjh21 (talk) 14:37, 25 June 2023 (UTC)- @Bjh21 thx for the info. i'm more interested in the method to accomplish this task. i suppose the following is the approach taken? (sorry i have no knowledge about any jargons.)
- if the image is "embedded" in the pdf, extract the embedded file.
- otherwise, extract the target page in pdf? or convert the target page to image (jpg/png)?
- pdfimages does #1? RZuo (talk) 15:01, 25 June 2023 (UTC)
- For extracting the entire page, you could try to "print" the PDF but with a virtual printer and then specifying the page (range) to be "printed". For example, Windows nowadays has a native Print to PDF feature, which may show up in your list of printers. However, since this concerns a map, I am inclined to try and extract it in an image file format, not a document format. --HyperGaruda (talk) 15:14, 25 June 2023 (UTC)
- @RZuo: Yes,
pdfimages
does the first. And for the second, using something like pdftk or "printing to PDF" is good since it'll preserve the structure of the page (text, graphics, images) where generating an image will flatten all that into pixels. Another approach for case 2 is to use Inkscape to convert to SVG. That might be good if you want to extract a drawing or a logo, but is likely to be bad for anything text-heavy. --bjh21 (talk) 23:28, 25 June 2023 (UTC)
- @Bjh21 thx for the info. i'm more interested in the method to accomplish this task. i suppose the following is the approach taken? (sorry i have no knowledge about any jargons.)
Grand Master of Order of Saint John of Jerusalem: not standard titlesEdit
Hi, dear colleaguas. The question is about the title ot the Grand Master of Order of Saint John of Jerusalem's category. The subcategories included in Category:Grand Master of Order of Saint John of Jerusalem have quite often a not usual title, for example Category:Alfonso de Portugal (GM 12) and not the standard Category:Alfonso de Portugal. Is there some special rule for it? Thank you. MrKeefeJohn (talk) 14:00, 25 June 2023 (UTC)
- @Alaspada: , who created the category given as an example, above. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:37, 25 June 2023 (UTC)
- How is this a technical matter? Anyway: I share your perpexity at the cryptic preffix "(GM 12)" in the cat name and add another issue concerning it: The correct spelling of this Portuguese given name is "Afonso", not "Alfonso". -- Tuválkin ✉ ✇ 19:34, 25 June 2023 (UTC)
- thank you for your answer. @Pigsonthewing: As I can see categorie were created by different users for example Category:Martin_Garzes_(GM_53 @Tuválkin: I asked here because I could not find a better place ;-) If necessary, we can move this discussion somewhere else. MrKeefeJohn (talk) 09:29, 26 June 2023 (UTC)
- Bonjour, puisque vous m'avez notifié je viens répondre qu'il n'y a aucune règle de dénomination des catégories et comme Commons regroupe toutes les langues de Wikipédia dans quelles langues rédiger une catégorie ? Ou alors j'ai raté quelque chose en 2016 quand j'ai créé ces catégories. J'ai à votre disposition plusieurs catégories en plusieurs langues. Dans la catégorie "Auberges of the Langue of France" (français/anglais, si l'on considère auberge comme un mot anglais !) on trouve "Auberge de France (Birgu)" (français), "First Auberge de France (Valletta)" (français/anglais), "Auberge of France (Rhodes)" (français/anglais), "Second Auberge de France (Valletta)" (français/anglais).
Pour "Afonso de Portugal" ou "Alphonse de Portugal", "Alfonse de Portugal" ou encore "Alfonso del Portogallo". Sur la wikipédia en français l'article est sous le nom d'"Alphonse de Portugal (grand maître)", sur la Wikipédia en portugais "Afonso de Portugal, Grão-mestre do Hospital", en anglais "Fernando Afonso of Portugal", en italien "Alfonso del Portogallo (gran maestro)", en allemand "Alfonse de Portugal", en néerlandais "Alfons van Portugal (1135-1207)", etc. Je trouve assez intéressant que Commons fasse suivre un nom dans une langue d'un rang de grand maître comme "Alfonso de Portugal (GM 12)" ou "Martin_Garzes_(GM_53)", cela au moins est international. Cheers - Alaspada (Talk) 16:45, 26 June 2023 (UTC)- Ou seja: Tu inventas nomes marados, e agora a culpa é nossa. Isto tá bonito, tá. -- Tuválkin ✉ ✇ 02:23, 27 June 2023 (UTC)
- My question, by the way in English although I can understand more or less some also French and Portoguese languages, is about the necessity or not to add to the category's name this not standard specification "(M**)". As I can understand this specification is not necessary and it should be removed. About the correct name of category in Commons:Language policy I can read this "Category names should generally be in English, excepting some of proper names, biological taxa and terms which don't have an exact English equivalent". MrKeefeJohn (talk) 07:15, 27 June 2023 (UTC)
- Tuválkin Je n'ai jamais écris que c’était de votre faute. Réveillez-vous, cela fait 8 ans que c'est ainsi et personne n'a trouvé à redire jusqu'à aujourd'hui.
MrKeefeJohn Si je comprends bien le nom devrait être en portugais pour "Afonso de Portugal". Vous faites comme bon vous semble dés l'instant ou on le retrouve dans "ordre de Saint-Jean de Jérusalem". Je vous souhaite bon courage, vous allez en avoir besoin avec toutes les catégories dans l'une ou l'autre langue. Cheers - Alaspada (Talk) 17:34, 27 June 2023 (UTC)
- Tuválkin Je n'ai jamais écris que c’était de votre faute. Réveillez-vous, cela fait 8 ans que c'est ainsi et personne n'a trouvé à redire jusqu'à aujourd'hui.
- My question, by the way in English although I can understand more or less some also French and Portoguese languages, is about the necessity or not to add to the category's name this not standard specification "(M**)". As I can understand this specification is not necessary and it should be removed. About the correct name of category in Commons:Language policy I can read this "Category names should generally be in English, excepting some of proper names, biological taxa and terms which don't have an exact English equivalent". MrKeefeJohn (talk) 07:15, 27 June 2023 (UTC)
- Ou seja: Tu inventas nomes marados, e agora a culpa é nossa. Isto tá bonito, tá. -- Tuválkin ✉ ✇ 02:23, 27 June 2023 (UTC)
- Bonjour, puisque vous m'avez notifié je viens répondre qu'il n'y a aucune règle de dénomination des catégories et comme Commons regroupe toutes les langues de Wikipédia dans quelles langues rédiger une catégorie ? Ou alors j'ai raté quelque chose en 2016 quand j'ai créé ces catégories. J'ai à votre disposition plusieurs catégories en plusieurs langues. Dans la catégorie "Auberges of the Langue of France" (français/anglais, si l'on considère auberge comme un mot anglais !) on trouve "Auberge de France (Birgu)" (français), "First Auberge de France (Valletta)" (français/anglais), "Auberge of France (Rhodes)" (français/anglais), "Second Auberge de France (Valletta)" (français/anglais).
- thank you for your answer. @Pigsonthewing: As I can see categorie were created by different users for example Category:Martin_Garzes_(GM_53 @Tuválkin: I asked here because I could not find a better place ;-) If necessary, we can move this discussion somewhere else. MrKeefeJohn (talk) 09:29, 26 June 2023 (UTC)
- How is this a technical matter? Anyway: I share your perpexity at the cryptic preffix "(GM 12)" in the cat name and add another issue concerning it: The correct spelling of this Portuguese given name is "Afonso", not "Alfonso". -- Tuválkin ✉ ✇ 19:34, 25 June 2023 (UTC)
- It seems that the unusual "_(GM_##)" appended to most subcats of Category:Grand Master of Order of Saint John of Jerusalem are meant as a sort of sorting key, for it seems to be their ordinal number.
- I suggest that this useful function should be kept upon renaming these 71 cats into more conventional synonyms by applying proper wikitext sorting keys, namely by (re)categorizing each of the renamed subcats as either
[[Category:Grand Masters of Order of Saint John of Jerusalem|##]]
(slighly renamed cat) or even[[Category:Grand Masters of Order of Saint John of Jerusalem by succession rank|##]]
(new subcat).
- I can take care of the tech issues of all this cat renaming and concommitant page file recategorizing in a few hours, just give me a greenlight consensus. -- Tuválkin ✉ ✇ 21:30, 27 June 2023 (UTC)
- As usual, cat histories will be kept after renaming, and redirect cats with the old name will remain in place. -- Tuválkin ✉ ✇ 21:37, 27 June 2023 (UTC)
- I give my "greenlight consensus" to remove the unusual "_(GM_##)". One more question is about the correct name of category. One example: Category:Frère Gérard (GM 1) should be Category:Frère Gérard or Category:Blessed Gerard or something else? MrKeefeJohn (talk) 10:07, 28 June 2023 (UTC)
- Further renaming is always possible, of course, but it’s indeed best to do it at once, as much as possible. In that one case and as many others I find, I propose to follow the names used in the English Wikipedia. -- Tuválkin ✉ ✇ 18:55, 28 June 2023 (UTC)
- Ne serait-il pas préférable d'utiliser leurs noms dans leur langue d'origine ? Comme le dit MrKeefeJohn "Category names should generally be in English, excepting some of proper names, biological taxa and terms which don't have an exact English equivalent". (gras de moi) - Alaspada (Talk) 19:30, 28 June 2023 (UTC)
- B.v. rimarki ke mi ne proponis renomi la kategoriojn angllingve, mi ja proponis renomi ilin laŭ la angllingva Vikipedio — kiu kutime uzas tiun saman politikon, kiun vi recitas. Jen ekzemploj:
- Ni havas ordenestron Hermangard d’Asp nomita laŭ ia novlatinigita formo de ĝermansona nometimo, dum la angllingva Vikipedio lin nomas Armengol de Aspa, katalunlingve. Ŝajnas, ke ni ĉiuj konsentas ke ĉilasta nomo estas la plej ĝusta, uzenda okaze de kategorirenomigo en Commons.
- Aliflanke, ordenestron Pietro del Monte la angllingva Vikipedio nomas (kiel artikoltitolon) Pierre de Monte — eĉ ne *Peter Hill aŭ simile. Tian ekzemplon Commons ne sekvu, kaj lasu itallingve la nomon de tiu italo.
- Kontraste, ordenestron Antonio Fluvian de la Riviere, ankaŭ katalunlingvano, havas sian nomon ĝuste indikita nur en la tiulingva Vikipedio: Antoni de Fluvià; aliie svarmas historiaj formoj kunflikitaj el miskompreno ke "fluvià", "fluvian[us]", "de la ripa", kaj "de la rivière" estas iel apartaj familinomoj, unuope envicigendaj, kaj ne ja malsamlingvaj sinonimoj: Ankaŭ ĉikaze, kie la angllingva Vikipedio ne sekvas la cititan politikon, ni ne renomu la kategorion de Commons laŭ ĝi.
- -- Tuválkin ✉ ✇ 20:50, 28 June 2023 (UTC)
- I moved Category:Riccardo Caracciolo (GM 33) to Category:Riccardo Caracciolo as in all languages has the same name MrKeefeJohn (talk) 07:45, 3 July 2023 (UTC)
- Excellent; I plan to follow suit. Some thoughts:
- Meanwhile I added a sort key to all these categories, as discussed, mostly using the numbers in discussion here. This replaces the thitherto A-Z listing with 0-9, but since many names are fuzzy, maybe that's a net gain (existing sort keys were uneven, at best).
- Some of the existing cats don’t have this number on their names, likely those previously created.
- There was a miscategorized cat pertaining to a SJJ officer who was not a GM, and two of these GMs are actually anti-GMs (they sided with the anti-Pope — particle physics is fascinating!), so I added 0.5 to their numeral sorting order.
- There are subcats (created by another user) where the "(GM ##)" identifier has been critically inherited (example); I have been renaming them.
- When the only catname change was the parenthetical numeral chopped off, there’s no need to retain the old cat name as a redirect: the only practical use of these is to allow seamless use of Cat-a-lot and HotCat, but since the only difference is at the end, autocomplete will find the new cat anyway.
- The sorting order used in these cat names is offset by 1 compared to what’s at this source; someone in the knoew should be able to fix this, as needed.
- -- Tuválkin ✉ ✇ 12:52, 3 July 2023 (UTC)
- Excellent; I plan to follow suit. Some thoughts:
- I moved Category:Riccardo Caracciolo (GM 33) to Category:Riccardo Caracciolo as in all languages has the same name MrKeefeJohn (talk) 07:45, 3 July 2023 (UTC)
- B.v. rimarki ke mi ne proponis renomi la kategoriojn angllingve, mi ja proponis renomi ilin laŭ la angllingva Vikipedio — kiu kutime uzas tiun saman politikon, kiun vi recitas. Jen ekzemploj:
- Ne serait-il pas préférable d'utiliser leurs noms dans leur langue d'origine ? Comme le dit MrKeefeJohn "Category names should generally be in English, excepting some of proper names, biological taxa and terms which don't have an exact English equivalent". (gras de moi) - Alaspada (Talk) 19:30, 28 June 2023 (UTC)
- Further renaming is always possible, of course, but it’s indeed best to do it at once, as much as possible. In that one case and as many others I find, I propose to follow the names used in the English Wikipedia. -- Tuválkin ✉ ✇ 18:55, 28 June 2023 (UTC)
- I give my "greenlight consensus" to remove the unusual "_(GM_##)". One more question is about the correct name of category. One example: Category:Frère Gérard (GM 1) should be Category:Frère Gérard or Category:Blessed Gerard or something else? MrKeefeJohn (talk) 10:07, 28 June 2023 (UTC)
- As usual, cat histories will be kept after renaming, and redirect cats with the old name will remain in place. -- Tuválkin ✉ ✇ 21:37, 27 June 2023 (UTC)
Module:Countries does not return some certain names correctlyEdit
Module:Countries does not seem to return some certain names correctly. See Commons:Freedom of panorama/Asia. It generates wrong transclusions like "Commons:Copyright rules by territory/中国" instead of the supposed Commons:Copyright rules by territory/China (and also the same to Myanmar and Palestine). Since Module:TNTExpandByCountries used in this page invokes Module:Countries, I tested {{#invoke:Countries|main|Asia}}
and believe something about it is wrong, but I don't quite understand its code. Any help? --H2NCH2COOH (Talk) 19:21, 25 June 2023 (UTC)
Tech News: 2023-26Edit
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- The Action API modules and Special:LinkSearch will now add a trailing
/
to allprop=extlinks
responses for bare domains. This is part of the work to remove duplication in theexternallinks
database table. [5]
Problems
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 27 June. It will be on non-Wikipedia wikis and some Wikipedias from 28 June. It will be on all wikis from 29 June (calendar).
- The Minerva skin now applies more predefined styles to the
.mbox-text
CSS class. This enables support for mbox templates that use divs instead of tables. Please make sure that the new styles won't affect other templates in your wiki. [8][9] - Gadgets will now load on both desktop and mobile by default. Previously, gadgets loaded only on desktop by default. Changing this default using the
|targets=
parameter is also deprecated and should not be used. You should make gadgets work on mobile or disable them based on the skin (with the|skins=
parameter in MediaWiki:Gadgets-definition) rather than whether the user uses the mobile or the desktop website. Popular gadgets that create errors on mobile will be disabled by developers on the Minerva skin as a temporary solution. [10] - All namespace tabs now have the same browser access key by default. Previously, custom and extension-defined namespaces would have to have their access keys set manually on-wiki, but that is no longer necessary. [11]
- The review form of the Flagged Revisions extension now uses the standardized user interface components. [12]
Future changes
- How media is structured in the parser's HTML output will change in the coming weeks at group2 wikis. This change improves the accessibility of content. You may need to update your site-CSS, or userscripts and gadgets. There are details on what code to check, how to update the code, and where to report any related problems. [13]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 16:16, 26 June 2023 (UTC)
Counties in WA last bullet pointEdit
Hi. I noticed that on e.g. Category:Houses in Whatcom County, Washington, where Yakima, the last one, is not listed, there is a trailing bullet point on the counties of WA template. However, on Category:Transport in Seattle, using the cities of WA template, the same does not happen. Can someone figure out and fix this please? Thanks (also those cities/counties templates all use the same stuff -- shouldn't there be a master template they all use so you can just put each city in as a parameter?) DemonDays64 (talk•contribs•uploads) 19:56, 27 June 2023 (UTC)
- coz "Category:Houses in Yakima County, Washington" doesnt exist. RZuo (talk) 20:13, 27 June 2023 (UTC)
- @RZuo: but I am saying -- on the transport in seattle category, there could be a Yakima entry and it is listed in the Cities template, but while there isn't one there is not the same issue. (please ping on reply) DemonDays64 (talk•contribs•uploads) 20:21, 27 June 2023 (UTC)
- Template:Cities in Washington (state) using hlist is better than the manually inserted dots in Template:Counties of Washington (state). RZuo (talk) 20:28, 27 June 2023 (UTC)
- @RZuo: but I am saying -- on the transport in seattle category, there could be a Yakima entry and it is listed in the Cities template, but while there isn't one there is not the same issue. (please ping on reply) DemonDays64 (talk•contribs•uploads) 20:21, 27 June 2023 (UTC)
Commons API ConnectionError when trying to upload image files with PywikibotEdit
My Pywikibot script was trying to upload a single file to the category Category:Master Frisky, when I got the requests.exceptions.ConnectionError. It will happen every time I try to upload the file, and every time it waits for a given amount of seconds too. The log:
Error log |
---|
Uploading file Master Frisky (1902) front cover.png to Wikimedia Commons from projectfiles/processed_files/1.png...
Sleeping for 7.9 seconds, 2023-06-28 20:16:28
ERROR: An error occurred for uri https://commons.wikimedia.org/w/api.php
ERROR: Traceback (most recent call last):
File "/Users/bobbybumps/Downloads/code_folder/core_stable_2/pywikibot/data/api.py", line 1486, in _http_request
response = http.request(self.site, uri=uri,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobbybumps/Downloads/code_folder/core_stable_2/pywikibot/comms/http.py", line 253, in request
r = fetch(baseuri, headers=headers, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bobbybumps/Downloads/code_folder/core_stable_2/pywikibot/comms/http.py", line 408, in fetch
callback(response)
File "/Users/bobbybumps/Downloads/code_folder/core_stable_2/pywikibot/comms/http.py", line 298, in error_handling_callback
raise response from None
File "/Users/bobbybumps/Downloads/code_folder/core_stable_2/pywikibot/comms/http.py", line 399, in fetch
response = session.request(method, uri,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 502, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError('The write operation timed out'))
WARNING: Waiting 5.0 seconds before retrying. |
Attempted file description |
---|
=={{int:filedesc}}==
{{Information
|description={{en|1=The front cover of ''Master Frisky'' (1902), found on page 1 of scan. No caption provided.}}
|date=1902
|source={{extracted from|Master Frisky (1902).djvu}}
|author={{Creator:Clarence Hawkes}}
}}
=={{int:license-header}}==
{{PD-US-expired}}
[[Category:Front cover of books]]
[[Category:Master Frisky]] |
Python function for file uploading |
---|
def upload_file_to_commons(filename, file_text, file_path, transcription_page_title):
print(f"Uploading file {filename} to Wikimedia Commons from {file_path}...")
summary = f"Uploading \"{filename}\"..."
site = pywikibot.Site("commons", "commons")
print(filename)
print(file_text)
# Create an instance of the FilePage for the scan file
file_page = pywikibot.FilePage(site, filename)
print(file_page)
# Set the file description text
file_page.text = file_text
# Upload the file
if not file_page.exists():
file_page.upload(source=file_path, comment=edit_summary(summary, transcription_page_title), report_success=False)
print_in_green("File uploaded successfully!")
else:
print_in_yellow(f"File {filename} already exists on Wikimedia Commons! Not uploading.")
process_break()
|
- File name: Master Frisky (1902) front cover.png
- File size: 13 MB
What I've tried:
- Switching accounts from GemmaBot to my main account, PseudoSkull.
- Making test edits to text on Wikisource diff and Wikimedia Commons diff.
My script was also able to upload File:Master Frisky (1902).djvu (the scan file) a few days ago.
So I'm completely at a loss as to what the problem could be. Does anyone know what tends to cause this sort of issue? PseudoSkull (talk) 02:02, 29 June 2023 (UTC)
- Comment: I just uploaded two other files that were of significantly lower file size. I'm starting to think the problem here is the size of the file. Trying a chunk upload script. I'll let you know if that works out for the cover image. PseudoSkull (talk) 02:25, 29 June 2023 (UTC)
Resolved!!! Finally.
Modified Python function |
---|
def upload_file_to_commons(filename, file_text, file_path, transcription_page_title):
print(f"Uploading file {filename} to Wikimedia Commons from {file_path}...")
summary = f"Uploading \"{filename}\"..."
site = pywikibot.Site("commons", "commons")
# Create an instance of the FilePage for the scan file
file_page = pywikibot.FilePage(site, filename)
# Set the file description text
file_page.text = file_text
# Upload the file
if not file_page.exists():
greater_than_3mb = is_file_size_greater_than_3mb(file_path)
if greater_than_3mb:
# upload_file_chunks(file_path, filename, transcription_page_title)
print("File size greater than 3 MB. Uploading in chunks...")
chunk_size = convert_to_megabytes(3)
file_page.upload(source=file_path, chunk_size=chunk_size, comment=edit_summary(summary, transcription_page_title), report_success=False)
else:
file_page.upload(source=file_path, comment=edit_summary(summary, transcription_page_title), report_success=False)
print_in_green("File uploaded successfully!")
else:
print_in_yellow(f"File {filename} already exists on Wikimedia Commons! Not uploading.")
process_break()
|
PseudoSkull (talk) 03:45, 29 June 2023 (UTC)
Is anyone else seeing this? (Portrait display of categories in "mobile view")Edit
-
This is how categories look on mobile while the mobile telephone 📱 is in an upright (or "portrait") position.
-
How "Options" look while it looks like this.
First (1st) of all, I'm extremely happy that the latest update for the "mobile view" has synchronised the experience for desktop 🖥️ and mobile 📲 users, for years I have to constantly switch between "Desktop mode" and "Mobile view" to be able to to some rather basic options, this now all appears to be fixed since today. However, despite the latest update fixing basically everything that was wrong with mobile categories for over a decade it did introduce a new issue (at least for me), while in portrait mode I can't see any of the options, is anyone else experiencing this or is there something wrong on my side? I'd prefer to know if others experience this before I'd report it at the Phabricator. --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 16:15, 30 June 2023 (UTC)
Help request with CSSEdit
Hello! Can someone help me align the centers of the elements at the bottom of this page? That is the center of the 2 long columns with that of the 2 buttons with that of the 2 lists below them. I've already done what I could to align them "manually". - Klein Muçi (talk) 19:21, 30 June 2023 (UTC)
Template:Districts of BangladeshEdit
Hello everyone! I started this template copying Template:Districts of West Bengal. But the code seems not to work. I can't find, where I did the mistake as I am not very familiar with the template structure. Can anyone help to resolve the issue? — Meghmollar2017 • Talk • 16:09, 1 July 2023 (UTC)
Request to add Tai Ahom Unicode to CommonsEdit
Tech News: 2023-27Edit
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- As part of the rolling out of the audio links that play on click wishlist proposal, small wikis will now be able to use the inline audio player that is implemented by the Phonos extension. [14]
- From this week all gadgets automatically load on mobile and desktop sites. If you see any problems with gadgets on your wikis, please adjust the gadget options in your gadget definitions file. [15]
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 4 July. It will be on non-Wikipedia wikis and some Wikipedias from 5 July. It will be on all wikis from 6 July (calendar).
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 22:49, 3 July 2023 (UTC)
Can somebody with experience in templates please edit the {{odate}}
to look and function more like the {{autvec}}
template, because they have similar functions and can be used together. --QuickQuokka [talk • contribs] 20:15, 5 July 2023 (UTC)
Please help rotateEdit
This version - does not rotate with bot. --Abc10 (talk) 13:28, 8 July 2023 (UTC)
- use com:croptool. RZuo (talk) 14:07, 8 July 2023 (UTC)
Error from Deletion Notification Bot 2Edit
In this edit, the Deletion Notification Bot 2 made an error of some sort and didn’t created a new section nor did it complete the template. Technical error of some sort. WeatherWriter (talk) 22:32, 9 July 2023 (UTC)
- Looking into it shortly. —Mdaniels5757 (talk • contribs) 00:04, 10 July 2023 (UTC)
- @WeatherWriter Yeah, it looks like your use of the {{Tq}} template broke it. I would fix the bot, but it also broke the tool used to convert speedy nominations to deletion requests, so I think the better solution is just to not use templates inside deletion reasons :). —Mdaniels5757 (talk • contribs) 00:15, 10 July 2023 (UTC)
Tech News: 2023-28Edit
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- The Section-level Image Suggestions feature has been deployed on seven Wikipedias (Portuguese, Russian, Indonesian, Catalan, Hungarian, Finnish and Norwegian Bokmål). The feature recommends images for articles on contributors' watchlists that are a good match for individual sections of those articles.
- Global abuse filters have been enabled on all Wikimedia projects, except English and Japanese Wikipedias (who opted out). This change was made following a global request for comments. [16]
- Special:BlockedExternalDomains is a new tool for administrators to help fight spam. It provides a clearer interface for blocking plain domains (and their subdomains), is more easily searchable, and is faster for the software to process for each edit on the wiki. It does not support regex (for complex cases), nor URL path-matching, nor the MediaWiki:Spam-whitelist, but otherwise it replaces most of the functionalities of the existing MediaWiki:Spam-blacklist. There is a Python script to help migrate all simple domains into this tool, and more feature details, within the tool's documentation. It is available at all wikis except for Meta-wiki, Commons, and Wikidata. [17]
- The WikiEditor extension was updated. It includes some of the most frequently used features of wikitext editing. In the past, many of its messages could only be translated by administrators, but now all regular translators on translatewiki can translate them. Please check the state of WikiEditor localization into your language, and if the "Completion" for your language shows anything less than 100%, please complete the translation. See a more detailed explanation.
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 11 July. It will be on non-Wikipedia wikis and some Wikipedias from 12 July. It will be on all wikis from 13 July (calendar).
- The default protocol of Special:LinkSearch and API counterparts has changed from http to both http and https. [18]
- Special:LinkSearch and its API counterparts will now search for all of the URL provided in the query. It used to be only the first 60 characters. This feature was requested fifteen years ago. [19]
Future changes
- There is an experiment with a ChatGPT plugin. This is to show users where the information is coming from when they read information from Wikipedia. It has been tested by Wikimedia Foundation staff and other Wikimedians. Soon all ChatGPT plugin users can use the Wikipedia plugin. This is the same plugin which was mentioned in Tech News 2023/20. [20]
- There is an ongoing discussion on a proposed Third-party resources policy. The proposal will impact the use of third-party resources in gadgets and userscripts. Based on the ideas received so far, policy includes some of the risks related to user scripts and gadgets loading third-party resources, some best practices and exemption requirements such as code transparency and inspectability. Your feedback and suggestions are warmly welcome until July 17, 2023 on on the policy talk page.
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 19:51, 10 July 2023 (UTC)
Special:Search no longer displays images in a slideshowEdit
More or less as per title. Clicking on an image result in Special:Search takes you directly to that image's page rather than displaying it in a slideshow as it did previously. Category page slideshows still work, as does the equivalent feature in MediaSearch, so surely this can't be intentional behaviour? - Dvaderv2 (talk) 20:14, 10 July 2023 (UTC)
I have now tried this on different machines and browsers and I'm still getting this issue. Moreover, this testing was done without being logged in, so I can rule this out as being an issue specific to my account. --Dvaderv2 (talk) 17:15, 11 July 2023 (UTC)
F2CEdit
It seems that Flickr2Commons has been shut down as I can't upload even a single file. When I try to enter Flickr file ID to the upload tool it only turns to blue but doesn't upload a file! Юрий Д.К 09:57, 11 July 2023 (UTC)
- i confirm the problem. it's stuck at the blue phase.
- the tool was last working at 13:45, 10 July 2023. RZuo (talk) 13:13, 11 July 2023 (UTC)
- use Special:UploadWizard instead. RZuo (talk) 13:14, 11 July 2023 (UTC)
- Already notified @Magnus Manske: as the creator of F2C. --A1Cafel (talk) 15:11, 12 July 2023 (UTC)
- @Magnus Manske: @RZuo: @A1Cafel: Working now, thanks Юрий Д.К 20:12, 12 July 2023 (UTC)
- Already notified @Magnus Manske: as the creator of F2C. --A1Cafel (talk) 15:11, 12 July 2023 (UTC)
Hi, please help with the problem presented in PHAB:T341636.
Apparently, it affects all editors whose languages are RTL.
—מקףHyphen෴ 14:44, 12 July 2023 (UTC)
Determining a file's filetype in wikitextEdit
i'm thinking of adding cats to {{From YouTube}} so that files are automatically separated into images, videos, etc.
what's an easy way to determine filetype?
here's my idea:
- use Module:string2 to extract the extension (substring from the right to the rightmost dot, like .jpg, .webm).
use parserfunction switch to change extension to filetype.
RZuo (talk) 14:48, 12 July 2023 (UTC)
- There’s already such a template, which works exactly the way you described: {{File type en}}. —Tacsipacsi (talk) 09:07, 13 July 2023 (UTC)
- thx a lot. {{File extension}} is a very neat method.--RZuo (talk) 10:36, 13 July 2023 (UTC)
- where can we find a full list of possible extensions and their corresponding filetype?
- does Template:File type en miss out any extension?--RZuo (talk) 10:36, 13 July 2023 (UTC)
- The list of file extensions that can currently be uploaded can be queried from the API: https://commons.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions&format=xml. However, be aware that there can be files on Commons that have extensions which used to be but are no longer allowed. These can be found only by going through all file names on Commons, which would take quite a long time even by using a direct SQL query. —Tacsipacsi (talk) 12:34, 15 July 2023 (UTC)
Motd/2023-07Edit
Could someone fix the width issue in {{Motd/2023-07}}? Thanks, — Racconish 💬 12:56, 15 July 2023 (UTC)
Search / Skip PDFs / FilemimeEdit
While doing searches on Commons, I noticed a 'recent' addition in the form of a link labelled "Skip PDFs", which is slightly easier than adding -pdf to my search string. It has unintended consequences, and I can't find a way to report a bug to the relevant originator. For example, if I enter "deer valley" (with double quotes) in the search box, I get all variations of that. If I then click on the Skip PDFs link, in the search string I then get each double quote mark replaced by ampersand hash 34 semicolon which doesn't produce the intended result. PeterWD (talk) 08:57, 15 July 2023 (UTC)
- Indeed. You might get more help to fix this problem at Commons:Village pump/Technical. -- Asclepias (talk) 15:47, 15 July 2023 (UTC)
- yall need to help pressure some interface sysop to take action for MediaWiki_talk:Searchmenu-new#Skip_pdfs. RZuo (talk) 16:47, 16 July 2023 (UTC)
GalleryDetails doesn't workEdit
MediaWiki talk:Gadget-GalleryDetails.js —מקףHyphen෴ 13:57, 17 July 2023 (UTC)
Tech News: 2023-29Edit
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- We are now serving 1% of all global user traffic from Kubernetes (you can read more technical details). We are planning to increment this percentage regularly. You can follow the progress of this work.
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 18 July. It will be on non-Wikipedia wikis and some Wikipedias from 19 July. It will be on all wikis from 20 July (calendar).
- MediaWiki system messages will now look for available local fallbacks, instead of always using the default fallback defined by software. This means wikis no longer need to override each language on the fallback chain separately. For example, English Wikipedia doesn't have to create
en-ca
anden-gb
subpages with a transclusion of the base pages anymore. This makes it easier to maintain local overrides. [21] - The
action=growthsetmentorstatus
API will be deprecated with the new MediaWiki version. Bots or scripts calling that API should use theaction=growthmanagementorlist
API now. [22]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 23:06, 17 July 2023 (UTC)
UK MonthYear template helpEdit
Morning all, in my infinite wisdom, I made Template:UKBusmonthyear because I thought it would both aid with navigation throughout a year's worth of bus photos and I thought it would be neat to have a counter per month of how many bus photos were taken without having to step into the year category.
However, I've hit a couple of snags. See, I've based the template off of Template:CountyFermanaghmonthyear (which I'm not exactly sure of the origin template), and in doing so, two issues have cropped up which I've tried and now failed to fix:
- The months in the main year category (i.e. Category:Buses in the United Kingdom photographed in 2023) are all out of order, and,
- In the month in the UK category (i.e. Category:July 2023 in the United Kingdom), the Buses category now appears at the top instead of being filed under the alphabetical 'B' subcategories.
Is there any way I can have help fixing this, and in future, what can I do to prevent it? Hullian111 (talk) 08:29, 18 July 2023 (UTC)