https://bugzilla.wikimedia.org/show_bug.cgi?id=68315
Bug ID: 68315
Summary: config default editor on Windows detection fails
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
Steps to reproduce (core):
1. Set up an editor for .txt
2. Run python pwb.py pywikibot/config2.py
Expected results:
The 'editor' config variable should be set to the editor set up for .txt. i.e.
editor='C:\\Path\\to\\editor.exe'
Actual results:
editor=None
pywikibot configuration tries to automatically detect a text editor to use,
using the Windows registry key
Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithProgids
That exists for WinXP and later versions, and documentation can be found here:
http://msdn.microsoft.com/en-us/library/bb166549.aspxhttp://msdn.microsoft.com/en-us/library/bb165967.aspx
As can be seen in that documentation, the key name is relevant, and the key
value is always REG_NONE (zero-length binary value)
However to find the appropriate progid within that key, pywikbot uses
_winreg.EnumValue(key, 1)
As can be seen at
https://docs.python.org/2/library/_winreg.html#_winreg.EnumValue , the '1' in
the second parameter returns "An object that holds the value data, and whose
type depends on the underlying registry type".
Changing it to _winreg.EnumValue(key, 0) causes _winreg to return "A string
that identifies the value name" and suddenly the detection works correctly.
This has existed since the first version in compat/ in 2007
https://git.wikimedia.org/blobdiff/pywikibot%2Fcompat/36a702559c94c0b12f5cc…
However, it doesnt really work as one would expect, since it hooks onto .txt,
rather than .py
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=64468
Bug ID: 64468
Summary: improve diff visualization for Wikibase entities
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: ricordisamoa(a)live.it
Depends on: 39147
Web browser: ---
Mobile Platform: ---
pywikibot.showDiff(oldText, newText) is currently used to compare two wikicode
strings. But what about data items?
We should either:
* use the API to get a diff in structured format (bug 39147), or:
* convert dicts to strings somehow, before sending them to difflib
More ideas are welcome.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69039
Bug ID: 69039
Summary: welcome raises TypeError exception if site is not
configured
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
$ python pwb.py scripts/welcome.py -family:wikidata -lang:wikidata
[NoAct] Betterknower has no contributions.
[NoAct] PAC2 has no contributions.
[Match] Arseny1992 has enough edits to be welcomed.
Traceback (most recent call last):
File "pwb.py", line 157, in <module>
run_python_file(fn, argv, argvu)
File "pwb.py", line 67, in run_python_file
exec(compile(source, filename, "exec"), main_mod.__dict__)
File "scripts/welcome.py", line 966, in <module>
main()
File "scripts/welcome.py", line 955, in main
bot.run()
File "scripts/welcome.py", line 750, in run
% globalvar.defaultSign)
TypeError: unsupported operand type(s) for %: 'NoneType' and 'str'
<type 'exceptions.TypeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
The NoneType is welcome_text = i18n.translate(self.site, netext)
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=70302
Bug ID: 70302
Summary: Get property name from label
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: kikkocristian(a)gmail.com
Web browser: ---
Mobile Platform: ---
IS it possible to add a method to get the property number from its label name
in a given language.
For example
item.getPropertyFromName('en', 'country')
to return 'P17' since the English label of the property P17 is, indeed, country
(see: https://www.wikidata.org/wiki/Property:P17).
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69186
Bug ID: 69186
Summary: Option -redirect in "add" mode does not change outcome
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: category.py
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: CommodoreFabianus(a)gmx.de
Web browser: ---
Mobile Platform: ---
The default behaviour is with scripts/category.py when it's adding a category,
that redirecting pages are skipped, unless "-redirect" is set.
Currently this option doesn't change things because as described in bug #69185
the content of the redirect target is read but not properly handed to the next
stage. Even if that is fixed, the next problem is that it only checks if it's a
redirect on load and not on save, where it's throwing it's hand up.
The fix is simply to change the Page instance to the redirect target if the
option is set.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69185
Bug ID: 69185
Summary: Option -create for category add doesn't create pages
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: category.py
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: CommodoreFabianus(a)gmx.de
Web browser: ---
Mobile Platform: ---
The default behaviour is with scripts/category.py when it's adding a category,
that not existing pages are skipped.
This is due to the fact that when its loading the page and it's empty it
doesn't return the empty string if the option is set. This basically applies
also to "-redirect" and category pages, although there is still a underlying
bug.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=68725
Bug ID: 68725
Summary: import of compat SVN working copy requires internet
connection
Product: Pywikibot
Version: compat (1.0)
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: sebastian.bank(a)uni-leipzig.de
Web browser: ---
Mobile Platform: ---
wikipedia.py retrieves version.getversiondict()["rev"] to set the User-agent
when imported.
https://gerrit.wikimedia.org/r/#/c/86374/ changed version.getversion_svn() to
unconditionally ask github for the git-hash. However, the hash itself isn't
actually used in wikipedia.py (see also
https://bugzilla.wikimedia.org/show_bug.cgi?id=54686).
This undermines e.g. to unpickle previously saved page objects when access to
github.com does not work. It also seems an unpleasant thing, to make such a
roundtrip every time the library is imported, right?
Maybe getversiondict() and the code it dispatches to can get an opt-out (not to
retrieve information by speaking to the network) to be used in the User-agent
case.
>>> import wikipedia
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import wikipedia
File "wikipedia.py", line 6023, in <module>
versionrev=(version.getversiondict()["rev"])
File "pywikibot\version.py", line 58, in getversiondict
(tag, rev, date, hsh) = getversion_svn(_program_dir)
File "pywikibot\version.py", line 151, in getversion_svn
{'Label': rev, 'User-Agent': 'SVN/1.7.5-pywikibot1'})
File "C:\Program Files\Python27\lib\httplib.py", line 995, in request
self._send_request(method, url, body, headers)
File "C:\Program Files\Python27\lib\httplib.py", line 1029, in _send_request
self.endheaders(body)
File "C:\Program Files\Python27\lib\httplib.py", line 991, in endheaders
self._send_output(message_body)
File "C:\Program Files\Python27\lib\httplib.py", line 844, in _send_output
self.send(msg)
File "C:\Program Files\Python27\lib\httplib.py", line 806, in send
self.connect()
File "C:\Program Files\Python27\lib\httplib.py", line 1194, in connect
self.timeout, self.source_address)
File "C:\Program Files\Python27\lib\socket.py", line 553, in
create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno 11004] getaddrinfo failed
Pywikibot: pywikibot-compat (8317312, s11008, 2014/07/27, 11:54:19, ok)
Release version: 1.0b1
Python: 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=67956
Bug ID: 67956
Summary: Intermittent failure of test_fromPage_noitem
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
It first appeared here, on the py2.7 build only
https://travis-ci.org/wikimedia/pywikibot-core/jobs/29067805
And then in the next build it disappeared.
It is back again:
https://travis-ci.org/wikimedia/pywikibot-core/jobs/29843942
This is almost certainly a problem with the utility method
get_test_unconnected_page, which is a rough hack and should be replaced with a
generator, or made more robust.
--
You are receiving this mail because:
You are the assignee for the bug.