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 Python 3 #14

Closed
wants to merge 4 commits into from
Closed

Port to Python 3 #14

wants to merge 4 commits into from

Conversation

quozl
Copy link
Contributor

@quozl quozl commented Oct 30, 2018

Rebased from #8.

Review invited from @tonadev and @chimosky.

Merge is planned once all critical components are ready.

@quozl quozl added this to Critical Issues in Port to Python 3 via Six Oct 30, 2018
@quozl quozl moved this from Critical Issues to Pull Requests in Port to Python 3 via Six Oct 30, 2018
@@ -104,6 +104,7 @@ def is_empty(self):
return False
return True


This comment was marked as resolved.

@Aniket21mathur
Copy link
Contributor

I reviewed the code. Was able to built the package locally. What is the next step to take @quozl @pro-panda please guide.

@quozl
Copy link
Contributor Author

quozl commented May 21, 2019

Test it. Remove the Python 2 installation of sugar-datastore, install from the Python 3 source, then start Sugar. D-Bus should start the service. Exercise the Journal. This is what "test running the datastore" means in the tracking issue.

@Aniket21mathur
Copy link
Contributor

Aniket21mathur commented Jul 5, 2019

I used sugar-toolkit-gtk3 @ head , sugar @ head to test the datastore, the datastore.logs file is not formed, and journal do not starts. Might be possible I am not setting up the testing environment correctly.
@pro-panda can you please tell how you tested it?

Thanks!

@quozl
Copy link
Contributor Author

quozl commented Jul 5, 2019 via email

@Aniket21mathur
Copy link
Contributor

Datastore is a D-Bus service. Just run it under a debugger?

Thanks. I am working on using pdb for debugging. Please suggest if there's anything better we can use ?

What exactly do we have to compare and watch through the debugger to ensure the correct working of sugar-datastore?

@quozl
Copy link
Contributor Author

quozl commented Jul 5, 2019 via email

@quozl
Copy link
Contributor Author

quozl commented Jul 7, 2019 via email

@quozl
Copy link
Contributor Author

quozl commented Jul 9, 2019

Tested 774d05f using Write started from home view. Datastore reports a transaction failure;

dbus.exceptions.DBusException: org.freedesktop.DBus.Python.TypeError: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/local/lib/python3.6/dist-packages/carquinyol/datastore.py", line 308, in create
    self._metadata_store.store(uid, props)
  File "/usr/local/lib/python3.6/dist-packages/carquinyol/metadatastore.py", line 24, in store
    self._set_property(uid, key, value, md_path=metadata_path)
  File "/usr/local/lib/python3.6/dist-packages/carquinyol/metadatastore.py", line 51, in _set_property
    f.write(value)
TypeError: write() argument must be str, not dbus.Int32

My guess is the port needs more work.

@quozl
Copy link
Contributor Author

quozl commented Jul 9, 2019

https://dbus.freedesktop.org/doc/dbus-python/PY3PORT.html is a guide for porting D-Bus applications to Python 3.

@Aniket21mathur
Copy link
Contributor

My guess is the port needs more work.

Thanks. I am able to reproduce it, my configuration~

  • Installed toolkit for python2 (HEAD).
  • Using sugar (HEAD).
  • sugar-artwork (HEAD).
  • sugar-datastore python3 branch.

Working to fix it.

@Aniket21mathur
Copy link
Contributor

https://dbus.freedesktop.org/doc/dbus-python/PY3PORT.html is a guide for porting D-Bus applications to Python 3.

Thanks!

@Aniket21mathur
Copy link
Contributor

Replaced by #15

@Aniket21mathur Aniket21mathur mentioned this pull request Jul 10, 2019
@quozl quozl closed this Jul 10, 2019
@quozl quozl deleted the python3 branch July 10, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants