-
Notifications
You must be signed in to change notification settings - Fork 32
I made it work on windows 7 and support Chinese #3
Conversation
fix a bug of 'get'
Apologies for being a bit unresponsive here, can't seem to dedicate the time to go over the changes, but I expect I will sometime next week. A few questions I have right off the bat is about commit messages in the first ones in the series - why not describe what you intended to change there instead on "1"? Other question is related to first one, why "tabs -> spaces"? I'll take a look at other changes when I'll get a chance. |
Thanks for pointing out my errors. I'm new here, so at the beginning of this, I did something wrong or unreasonable to test something. I'm sorry for these things. |
Just started to merge the stuff and it seem to be easier to just accept "tabs -> spaces" change, so merged it in as well. It's not really "stupid" - 4-spaces seem to be dominant convention indeed, I just hate extra pointless work merging such spacing changes and resolving conflicts they produce, but hopefully no tool will change that back to tabs. I don't quite get why later hunks have something like this though:
Can't pycharm format stuff consistently, so that diff and git-log will show what really changed and not this constant space-juggling? Anyway, easy enough to skip these particular hunks, so guess I'll try to just drop these from non-whitespace commits and merge into purely "code style changes" commits, and suggest you do something similar for the reasons above. |
8e1c2fa changes "skydrive-cli" in the repo root from symlink (I think these are supported on windows now as well, no?) to just a text file (with destination path inside), didn't apply that, would be great if you'd avoid changing that or maybe turn it into a python wrapper which would import "skydrive.cli_tool" relative to it's path and run the cli. My reasoning behind that symlink/wrapper is that |
Hmm, and then there's an introduction of "optz = optz_decode(parser.parse_args())" line, which decodes all CLI arguments to unicode, which can't be right on unixes (e.g. linux) where filesystem path is a bytestring, so if you pass some broken undecipherable bytes, they are valid filename and should never be decoded into anything, as I don't know of a way to to guarantee that a) they will decode b) re-encoding will produce same bytes on python2. I think python3 introduced some tricky system of decoding paths, leaving undecodable bytes in resulting unicode string, so that passing that string to os.* functions is guaranteed to encode it to the same bytes. I've heard that fs-stuff returns unicode on windows or something like that, but really have no clue how it works there, I'm afraid. Anyhow, I haven't really thought much of encodings before, so assume it worked reliably only for ascii on unixes as well, so introduction of at least some encoding-awareness can't be a bad thing, I guess. That said, using chardet looks like a horrible way to work with encodings - it never guarantees to get it right, so imagine trusting it to upload 10k files - it might work for 99% of them, but will then break for some. Guess I'll add an option to "do not detect, always use encoding X", if it's not there. |
2fde2f8 is kinda bad. That eval() should not work if file has quotes inside and can execute whatever random python code from resulting YAML. Good way to go about it is to use something that isn't strictly YAML (I wrote this once to print cyrillic chars in the output, among other things), and given simple output types (json can only contain few basic ones), I'd go with some simple hand-rolled indent-and-print() implementation, can you maybe replace eval with that? |
Disregard the last "can you maybe replace eval with that?" query - as of b33a03d, implemented simple non-yaml (but yaml-like) dumper as follows:
Output should be roughly the same as with YAML but without unicode escapes for non-ascii chars:
I've tested it in utf-8 console with cyrillic (russian), but can you please try with cmd (or powershell, or whatever is currently used there) on windows? Also, it'd be great if you'd be able to check if all the merged stuff in current master branch (in this repo) works. I've squashed some similar and non-descriptive commits (especially early ones), but otherwise tried to preserve metadata during the merge, so that it might be easier for you to map the merged changesets to the original ones. If you'll confirm that it works as expected and I haven't missed anything (always a possibility), I'll be able to close this PR and push the new version to pypi. |
It seems that I made many mistakes, although I can only understand a bit of what you said because of my poor English. I'll try my best to understand all of these latter. But now, it's more important to test current master branch and I'm working on it. You can get my answer latter. |
I found these bugs.
'info' is similar.
|
Thanks for testing. Yeah, fixed the first oversight in 527adb2, changed that option name at the last moment and forgot to update it in the function code. Second issue seem to be legitimate SkyDrive limitation though - note that you're doing |
Hmm, though remembering that '\python' might look like a legitimate "from root" path on windows, guess these slashes can be treated as path separators, same as "/" do. |
As of 0c67096, should be possible to do:
First three lines basically just a simplier and more intuitive way than the previous "mkdir name parent_dir" interface. |
I like this commit ~ |
Thanks a lot for your work on porting and testing! |
Hi mk-fg.
First of all, I want to say thank you for your project.
And now, I made it work on windows 7 and support Chinese. So I want to pull my repo to yours.
My English isn't well. And it's my first time to use python and github. So please let me know if there was anything wrong.
Thanks again.