[Pywikipedia-bugs] [Maniphest] [Commented On] T344327: pywikibot Site.upload repeats "Invalid CSRF token" and "Sleeping for" infinitely without exiting

2024-05-21 Thread Hoi
Hoi added a comment. > Was ist for 15, 30, 45, 60, 120, 180, 240, 300 seconds or sth else? No. It was `Sleeping for 9.9 seconds...`. My upload script just downloads a file from the upstream (with my custom proxy) and uploads it to Commons directly one by one. Here is the recent

[Pywikipedia-bugs] [Maniphest] [Commented On] T344327: pywikibot Site.upload repeats "Invalid CSRF token" and "Sleeping for" infinitely without exiting

2024-05-21 Thread Xqt
Xqt added a comment. In T344327#9819408 , @Hoi wrote: > In the last a few days, I experienced infinite sleep several times. No invalid CSRF token, just `Sleeping for ...` kept repeating for at least several hours until I terminated it.

[Pywikipedia-bugs] [Maniphest] [Commented On] T344327: pywikibot Site.upload repeats "Invalid CSRF token" and "Sleeping for" infinitely without exiting

2024-05-21 Thread Hoi
Hoi added a comment. In the last a few days, I experienced infinite sleep several times. No invalid CSRF token, just `sleep for ...` kept repeating for at least several hours until I terminated it. TASK DETAIL https://phabricator.wikimedia.org/T344327 EMAIL PREFERENCES https://phabricat

[Pywikipedia-bugs] [Maniphest] [Updated] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread Maintenance_bot
Maintenance_bot removed a project: Patch-For-Review. TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt, Maintenance_bot Cc: binbot, Xqt, Aklapper, pywikibot-bugs-list, Aram, mevo, PotsdamLamb, J

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread gerritbot
gerritbot added a comment. Change #1034543 **merged** by jenkins-bot: [pywikibot/core@master] [doc] Add a hint how to use empty string arguments with PowerShell https://gerrit.wikimedia.org/r/1034543 TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https:

[Pywikipedia-bugs] [Maniphest] [Closed] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread Xqt
Xqt closed this task as "Resolved". TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt Cc: binbot, Xqt, Aklapper, pywikibot-bugs-list, Aram, mevo, Isabelladantes1983, Themindcoder, Adamm71, Jersi

[Pywikipedia-bugs] [Maniphest] [Updated] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread gerritbot
gerritbot added a project: Patch-For-Review. TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt, gerritbot Cc: binbot, Xqt, Aklapper, pywikibot-bugs-list, Aram, mevo, Isabelladantes1983, Themindc

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread gerritbot
gerritbot added a comment. Change #1034543 had a related patch set uploaded (by Xqt; author: Xqt): [pywikibot/core@master] [doc] Add a hint how to use empty string arguments with PowerShell https://gerrit.wikimedia.org/r/1034543 TASK DETAIL https://phabricator.wikimedia.org/T36468

[Pywikipedia-bugs] [Maniphest] [Retitled] T364689: Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt

2024-05-21 Thread Xqt
Xqt renamed this task from "In pywikibot, replace.py script using -regex can't handle null replacements" to "Giving an empty string as second replacement argument in replace.py fails if Powershell is used as command prompt". Xqt triaged this task as "High" priority. Xqt claimed this task. TASK D

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Xqt
Xqt added a comment. In T364689#9817154 , @Aram wrote: > @Xqt, I don't know how you found out I was using PS ... The preleading PS gave me that hint {icon smile-o spin} **`PS`**`C:\Pywikibot> ...` TASK DETAIL https://phabricator

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Aram
Aram added a comment. @Xqt, I don't know how you found out I was using PS, but I must say you're really smart. Now, I got what you got using `""` in `cmd` and escaping using backtick `"`" in `PS`. And thanks for suggesting //template// script, but I was just wanted to use //repla

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Xqt
Xqt added a comment. Using empty strings with PS --- Try the follwing example invoking the Python command shell. With cmd you can use en empty string like `pwb shell foo "" bar -noimport` For PS you have to escape the empty string in this form using th

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Xqt
Xqt added a comment. @Aram: I see, you are using Powershell to invoke the python command. I was able to reproduce the reported behavior with Powershell and it seems that PS ignores empty strings. Please use the `cmd` comand propt and it will work as expected. TASK DETAIL https://phabricat

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Xqt
Xqt added a comment. OK, another try: `pwb shell foo "" bar` The result should be (two comas after foo) `Unknown arguments: foo, , bar` TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt C

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Aram
Aram added a comment. Without escaping: PS C:\Pywikibot> python pwb.py -simulate replace -page:ئانیشک -site:wiktionary:ckb -regex "{{wikipedia}}\n?" "" -summary:"Replace test" ERROR: Incomplete command line pattern replacement pair: ['{{wikipedia}}\\n?'] command.log:

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Xqt
Xqt added a comment. What is the behaviour and the log with Python 3.12 without escaping? TASK DETAIL https://phabricator.wikimedia.org/T364689 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Xqt Cc: binbot, Xqt, Aklapper, pywikibot-bugs-list, Ara

[Pywikipedia-bugs] [Maniphest] [Commented On] T364689: In pywikibot, replace.py script using -regex can't handle null replacements

2024-05-21 Thread Aram
Aram added a comment. @Xqt, I have updated python to the latest version `3.12.3` and tried `-3.12-64` and `-3.10-64` launchers. Both launchers were the same. This is escaping one: PS C:\Pywikibot> python pwb.py -simulate replace -page:ئانیشک -site:wiktionary:ckb -regex "{{wikipedia}}\