-
Notifications
You must be signed in to change notification settings - Fork 860
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
Python 3.3 Compatibility! #5
Comments
Are you planning to do the migration? |
I probably won't have time myself. Would very much appreciate it if you |
Hi there, I have almost done. After porting, I have 3 errors and 1 failure from tests (2 errors are related to electrum popen, so I think it is something stupid...). However, due to the distinction between strings and bytes introduced by python 3, it seems to be difficult to merge the two versions to be compliant both for versions 2 and 3. I could esplicitly skip individual changes if python version is 3, but the overall result would be far from maintainable. Any suggestions? Please consider that I am a python newbie. |
Hmm. I recall that was actually the big issue that I ran into when trying |
Basically, most of the code does not care about the fact that an object is a string or a 'bytes'. In addition to that, I have noticed subtle different behaviours in
whereas
I have found most of the problems with serialize / deserialize (I still have some issues but I can see the end), which work both with strings and bytes (they are also recursive, which made it hard to make it work), so I can not say if a string comes from the fact that is a "binary" string or it is a "real" string. Many parts of the code speculate about the type of the object: this is a problem because All in all, I have made changes so that there could be no "binary" strings but only "real" strings or "bytes", then I have hammered all the points where a "binary" string would have worked, but this has produced scattered changes. Maybe I could finish with the porting, then we see the differences and we might be lucky enough to isolate the -hopefully- small pieces of code that need to be different for the two versions. Do you think that the tests included in the project have a good code coverage? I have based my work on their outcome... |
Meanwhile, I have completed the tests. I as mentioned above, I have two failing tests due to popen invocation, the other ones are clear. |
Hi there, the porting is complete. Now it would be important to merge the two version. I will work on it, but any suggestion / help would be really appreciated. |
I would say the best approach would be to have all of the methods that |
Pull requested. |
Hi vbuterin, any news about my pull request? Regards |
Just integrated. All tests pass on python2, python3 and pypy. Thanks guys! |
Great! Now I would say that this issue can be closed. |
Sure. Email at [email protected] would be best. |
this can be closed? |
I tried to get the ethereum genesis block creator [https://raw.githubusercontent.com/ethereum/genesis_block_generator/master/mk_genesis_block.py] to work with python3. it kept throwing Exceptions because the calls to json.load() in bci.py were expecting strings, not bytes. |
Python 3.4.3 ? I want to use this library with a python app I'm developing. So i tested this script in python2.7 ... all sweet however I'm developing on python3 (3.4.3) ... and well I ran into this...
During handling of the above exception, another exception occurred: Traceback (most recent call last):
So couple questions... Should I 'back-port' my entire app to python2.7 so that i can use this library... or... Is this something people are working on to resolve? Thanks |
Hm, what a coincidence! I was just now running in this same issue at nearly the exact same time! If anyone has a fix for Python 3.4 that'd be great! I'm just an amateur at best myself, so I've been tinkering around and wondering how to get it to work. I'm just glad that it's not just me me, but rather a compatibility issue. |
Thanks so much MiWCryptoCurrency. Your fix was pretty straight forward and easy to implement. I see simcity4242's is a bit more elegant and savvy. I'm still quite new and unfamiliar with Git and haven't learned how I would go about merging someone else's pull request or have git control the pybitcoin module. Is there a quick primer or somewhere I should look to become more familiar with ways to utilize git when you are dealing with packages and modules such as these on your project? Almost all Bitcoin related projects are still being developed and have new features or fixes such as this one coming daily and I'm sure there is a better method rather than going in and just updating / changing things manually. |
https://stackoverflow.com/questions/6022302/pull-requests-from-other-forks-into-my-fork has a rich set of answers on applying PR to a fork. Start by cloning this repo and applying simcity's PR. It could work something like this if you wanted to have a git repo as a library in python. There is probably a better way to do this with virtualenv so you can have pip version and git, someone else may wish to comment. |
No news about Python3 compatibility? |
The library is python3.4 compliant on this fork. |
Still getting this message:
|
The title says it all.
The text was updated successfully, but these errors were encountered: