-
Notifications
You must be signed in to change notification settings - Fork 37
Package instances can only be used once #14
Comments
… re-read package File contents. Found during work on git-lfs#1074. See also computology/packagecloud-ruby#14 . Signed-off-by: Brett Randall <[email protected]>
Nice catch. I just reproduced this locally. You are absolutely right in that a I'll have a fix up for this shortly. Thanks for the report! |
Hey @javabrett, I just released 'packagecloud-ruby 1.0.3' which should fix this issue. Cheers! |
Thanks for the fix! I suppose in my mind this was between making sure that we always rewind the file, versus pulling-up the creation of all the The downside with rewinding seems to be:
Those might be OK. I just thought if we read the package bytes and created the MIMEs we could make |
Great points, I opened #16 to track. Thanks again! |
If you create a
Package
object:Then attempt to use it twice:
... the second call will fail. I think this is because the file-descriptor has been fully read to EOF, it is not closed/rewound, so the file-contents in the MIME for the second-call will be empty, resulting in:
{"repository":["The specified distro does not support the package you've tried to upload"]}
I'm not sure what the intended lifecycle of a
Package
is, but it seems reasonable to be able to reuse it. That would probably mean pulling-up fromClient
the file read into that class. That would also allow theFile
to be closed in the string/path form, which opens the file.The text was updated successfully, but these errors were encountered: