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 upload fileds with uploadfs/pyfilesystem. Added test. #342
Conversation
Python3 has problems with the str <-> bytes. The code needs some upgrade |
@michele-comitini you can import |
OK thanks for the pointer I'll try to fix it.
|
Fixed support for uploadfs=pythonfilesystem. Added compatibility to PY3.
47e254d
to
0c4b25f
Compare
@gi0baro rebased on master. Should work now. |
@niphlod what's the problem with codecov and appveyor?? |
@gi0baro can you check why appveyor and codecov fail? The code does not fail locally |
@michele-comitini seems windows-only related:
Don't know if is really windows-related or just something bad with appveyor. We should wait for @niphlod , maybe he can help. |
I can test at home but rarely appveyor is faulty: its biggest con (slowliness) brings pretty much the greatest pro of being a pristine env equal to a normal host. |
@niphlod did you discover anything? |
nope, sorry, didn't have time. maybe this evening I'll get some ;-( |
@michele-comitini : I can only confirm it's indeed happening and it's not an appveyor problem... investigating |
confirming also that backporting the test and running that test BEFORE the fix still shows the error. @michele-comitini : you're not the one to blame :-P |
aha, pinpointed! @michele-comitini it has to do on how you written the tests... or maybe @gi0baro can shed some light. Fortunately windows is more picky than linux. The fact is that retrieve() returns - correctly - an open handle to the file (so you can fetch its content). IMHO the behaviour is correct, but lesser-skilled newbies are going to leave open handles everywhere (dunno if this means leakage in linux). |
OK many thanks @niphlod! On *nix like systems deleting a file can be done anytime. That is the way temporary files are often dealt with. i.e. as soon as the file has been opened, it is also unlinked, when the stream is closed or the process dies, the stream ceases to exist and no reference is left around on the fs. Cool I didn't know that windows behaved differently so I didn't care of closing the stream! |
Current coverage is
|
@mdipierro @gi0baro The upload code in present pyDAL is uncovered. I made a test to correct a bug that shows with uploadfs=pyfilesystem. This bug affects current web2py too.