Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Python3 and Telepathy #15

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix TypeError related to configparser
ConfigParser's readfp takes a file opened in text mode as argument.
Fixes Error:

 Traceback (most recent call last):
  File "/usr/share/sugar/activities/reflect/reflectwindow.py", line 713, in _choose_activity
    bundle_icons = utils.get_bundle_icons()
  File "/usr/share/sugar/activities/reflect/utils.py", line 156, in get_bundle_icons
    _find_bundles()
  File "/usr/share/sugar/activities/reflect/utils.py", line 141, in _find_bundles
    cp.readfp(fd)
  File "/usr/lib/python3.7/configparser.py", line 762, in readfp
    self.read_file(fp, source=filename)
  File "/usr/lib/python3.7/configparser.py", line 717, in read_file
    self._read(f, source)
  File "/usr/lib/python3.7/configparser.py", line 1030, in _read
    if line.strip().startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Saumya-Mishra9129 committed Aug 11, 2020
commit 867d68af7c9655e73ca8e002e9471a500962ab0b
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ def _find_bundles():
'activity.info'))

for path in info_files:
fd = open(path, 'rb')
fd = open(path, 'r')
cp = ConfigParser()
cp.readfp(fd)
section = 'Activity'