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

Fix issues in Python3/PyQt5.5 #2576

Merged
merged 2 commits into from
Aug 2, 2015
Merged

Fix issues in Python3/PyQt5.5 #2576

merged 2 commits into from
Aug 2, 2015

Conversation

cy18
Copy link
Contributor

@cy18 cy18 commented Jul 31, 2015

Fixes #2573


Fix issue that codes like QByteArray().fromHex(str(state)) raise Type Error in Python3/PyQt5.5

A Type Error is raised when codes like QByteArray().fromHex(str(state)) are called.

It seems the error is because in python3, str(state) will return an string while the QByteArray().fromHex expect an hex array.
I search the whole project of spyder and modifed codes like QByteArray().fromHex(str(state)) to QByteArray().fromHex(str(state).encode('utf-8')). The encode method of string will return a byte array in python3 and a string in python2.

I'm not familiar with PyQt and the source code of spyder. Feel free to reject my pull request if you have a better solution for this issue.

@goanpeca goanpeca added this to the v3.0 milestone Jul 31, 2015
@goanpeca
Copy link
Member

@cy18 thanks for working on this :-)

@stonebig can you check with this PR if your problem is solved?

@@ -93,14 +93,14 @@ def clear_breakpoint(filename, lineno):
class EditorConfigPage(PluginConfigPage):
def get_name(self):
return _("Editor")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, first comment: please revert all this blank space changes :-) This makes merging other PRs really, really hard.

@ccordoba12
Copy link
Member

@stonebig, could you test this PR? It should solve issue #2573.

@ccordoba12 ccordoba12 changed the title Fix issue that codes like QByteArray().fromHex(str(state)) raise Type… Fix QByteArray() issue in Python3/PyQt5 Jul 31, 2015
@cy18
Copy link
Contributor Author

cy18 commented Jul 31, 2015

I have reverted the changes about spaces.

if event.delta() < 0:
self.zoom_out.emit()
elif event.delta() > 0:
self.zoom_in.emit()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? I say it because it's not related to QByteArray

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's another bug related to PyQt5.5 . I fixed it and created a new pull request. I don't know why it is shown here.
Should I create a new branch for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry, let's consolidate all PyQt5.5 issues here

@ccordoba12 ccordoba12 changed the title Fix QByteArray() issue in Python3/PyQt5 Fix issues in Python3/PyQt5.5 Aug 1, 2015
@ccordoba12
Copy link
Member

Thanks for your work @cy18! I'm going to merge this so we can release our first beta of Spyder 3.0 ;-)

Please open new PRs if you find more issues with PyQt5.5

ccordoba12 added a commit that referenced this pull request Aug 2, 2015
Fix issues in Python3/PyQt5.5
@ccordoba12 ccordoba12 merged commit bf369d9 into spyder-ide:master Aug 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants