maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
223 stars 24 forks source link

Updating claim does not load the current timezone in time-datatype properties #182

Closed VojtechDostal closed 5 months ago

VojtechDostal commented 6 months ago

I am using Wikibase-Cli to fix some values of ISNI ID. If the value had been already updated to the version I want, the line should be skipped. However Wikibase-Cli makes changes to the time zone of the reference in P813 property - see example: https://www.wikidata.org/w/index.php?title=Q7396684&diff=2051416968&oldid=2051242385

maxlath commented 6 months ago

Nooooo, the day as come I have to deal with time zones as a developer :sweat_smile: Can you give an example of the command and input that produced that behavior?

VojtechDostal commented 6 months ago

Yeah...sorry for that :). Wikibase-Cli latest version, installed on a Linux server

Command is: nohup wd uc --batch --summary "summary" --no-exit-on-error < ./ISNI-mainstatements.txt &

with the text in ISNI-mainstatements.txt being: Q7396684-630104AB-C197-406D-97C7-A73E305A4998 0000000082051119

maxlath commented 6 months ago

There was a hard-coded timezone=0 >< that should now be fixed in wikibase-cli v17.0.7, can you confirm?

VojtechDostal commented 5 months ago

I updated Wikibase-cli but now I get the following error when I try to run any command:

node:fs:453 return binding.readFileUtf8(path, stringToFlags(options.flag)); ^

Error: ENOENT: no such file or directory, open 'C:\C:\Users\vojte\AppData\Roaming\npm\node_modules\wikibase-cli\package.json' at readFileSync (node:fs:453:20) at readJsonFile (file:///C:/Users/vojte/AppData/Roaming/npm/node_modules/wikibase-cli/lib/json.js:4:21) at file:///C:/Users/vojte/AppData/Roaming/npm/node_modules/wikibase-cli/bin/wb.js:10:13 at ModuleJob.run (node:internal/modules/esm/module_job:218:25) at async ModuleLoader.import (node:internal/modules/esm/loader:329:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:113:12) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'C:\C:\Users\vojte\AppData\Roaming\npm\node_modules\wikibase-cli\package.json' }

This may or may not be related to the update, but I don't know how it happened.

maxlath commented 5 months ago

@VojtechDostal that last but should have been fixed by 7c33cfa, published in v17.0.8

VojtechDostal commented 5 months ago

@maxlath Thank you for your time on this. I successfully updated to 17.0.8, ran the command, and Wikibase-Cli now does not change the timezone of existing statements. This means that this issue now seems to be solved.