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
Major Fixes #922
Major Fixes #922
Conversation
38a444a
to
30153e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect
2a0c30d
to
491305e
Compare
|
Haven't reviewed 491305e yet but there was a mention of a similar traceback in the mailing list, they're 5 definitions of |
Thanks for suggestion , I am sure Its going to help me in further fixes. |
|
@chimosky @srevinsaju Please Review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I am not good at this collaboration, sockets and channels , but by code review, its a safer methodology you have implemented. So good one!
cfec35e
to
9b05557
Compare
|
Reviewed, thanks. Your commit messages in 7ef6d2e...1e4709a is misleading as you use As an instance, in 7ef6d2e you said; but |
b4bcdce
to
02ddae9
Compare
@chimosky I have done as suggested by you. |
|
Given my research as to the cause of #923 and looking only at efb71f6 it doesn't look like you tested this before writing it (get_bundle_id should always returns a |
Thanks for reviewing. get_bundle_id always returns a str. I agree with you. The way I have done it is wrong. However md5 hash function accepts sequence of bytes. So rest part is correct. |
02ddae9
to
d97fff2
Compare
d97fff2
to
0c0cea4
Compare
|
I think this Pull request can merge now. @quozl @chimosky @JuiP @srevinsaju Please review and suggest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed. Looks good
|
Thanks. Reviewed.
The commit messages are not in style for the Sugar repository;
|
@quozl I agree , if there are 30 calls to set_markup, we should protect them by markup_esacpe_text if there is a probability of getting '&', '>' or '<' sign.
Thanks Yeah configparser will return str, You are correct. |
Use GLib.markup_escape_text() before set_markup. Sometimes there can be characters in label such that markup parser can fail to parse the markup. markup_escape_text escapes text so that the markup parser will parse it. Less than, greater than, ampersand, etc. will be replaced with the corresponding entities. Fixes Warning - main.py:6165): Gtk-WARNING **: 17:56:49.381: Failed to set text '<span foreground=#000000>Antigua & Barbuda</span>' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &
preview_path is a binary file. Binary file was being read as text. Regression introduced by aa18879 ("Port to Python 3"). Similar change in sugarlabs@babf1a5
ByteArray objects must be initialized with bytes objects, not strings. It raises error - "string argument without an encoding" Regression made in sugarlabs@aa18879
ssid is of type <class bytes> A regression in sugarlabs@aa18879#diff-648be2a40679960f79033120a92b1daaR704 We cannot decode a <class str> object. decode() works with <class bytes> only i.e. encoded object
0c0cea4
to
50d0c93
Compare
ssid is of type <class bytes> in Python3, comparison of it with <class str> object results False.
ssid is of type <class bytes> in Python3, comparison of it with <class str> object results false.
https://github.com/sugarlabs/sugar/blob/d59b62a5f1db8c1e1ecb7ccbbcc8b85163290908/extensions/cpsection/modemconfiguration/model.py#L318 already returns a 'str' object, there is no need to decode from 'UTF-8'. Regression in aa18879#diff-faa2d318ce1ef21991d9ca1c6fa958ac Fixes following Erros: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/jarabe/controlpanel/gui.py", line 459, in __select_option_cb self.show_section_view(option) File "/usr/lib/python3/dist-packages/jarabe/controlpanel/gui.py", line 313, in show_section_view self._section_view = view_class(model, File "/usr/share/sugar/extensions/cpsection/modemconfiguration/view.py", line 125, in __init__ self.service_providers = self._model.ServiceProviders() File "/usr/share/sugar/extensions/cpsection/modemconfiguration/model.py", line 279, in __init__ country_code, provider_name, plan_idx = self._get_initial_config() File "/usr/share/sugar/extensions/cpsection/modemconfiguration/model.py", line 332, in _get_initial_config provider_name = provider_name.decode('utf-8') AttributeError: 'str' object has no attribute 'decode'
t is reproduced by choosing Favorites View - Random View from the toolbar in the Home View. Impact is that the favourites view disappears and is empty. Fixes sugarlabs#923 Regression made in aa18879#diff-685d653cc9490267e474dabc5c40b108R249 get_bundle_id always returns a str, encode it md5 hash function accepts sequence of bytes Reported by - Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in> Traceback (most recent call last): File /usr/lib/python3/dist-packages/jarabe/desktop/viewcontainer.py, line 69, in do_size_allocate self._layout.allocate_children(allocation, self._children) File /usr/lib/python3/dist-packages/jarabe/desktop/favoriteslayout.py, line 250, in allocate_children name_hash = hashlib.md5(child.get_bundle_id().decode()) AttributeError: 'str' object has no attribute 'decode'
Use bytes for ssid Dbus.ByteArray takes encoded bytes i.e. <class bytes> as an argument in Python3. Documentation<https://dbus.freedesktop.org/doc/dbus-python/PY3PORT.html> says ' ByteArray objects must be initialized with bytes objects, not unicodes. Use b’’ literals in the constructor.' ConfigParser's get method returns <str> object. Encode str to bytes before using it in ByteArrays. Regression introduced in sugarlabs@aa18879 ("Port to Python 3")
50d0c93
to
7024fc6
Compare
|
@quozl I have made requested changes , Please review. |
|
Thanks. I've cherry-picked and merged some of the patches. Please rebase.
One of the patches was not cherry-picked;
|
Thanks , the intuition behind this is that
reads the preview, and passes the output returned by _read_preview to dbus.ByteArray in
dbus.ByteArray takes bytes data as argument , but in _read_preview
file is opened as 'r' only. @quozl Ping |
|
Sorry for the delay, notification was filed as spam. Thanks, merged as 05b4ca0. |
Fixes #855 . @quozl @srevinsaju Please Review.