-
Notifications
You must be signed in to change notification settings - Fork 150
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
downloading text files with utf-8 encoding #135
Comments
I'm not able to reproduce this using Using the default download example, just modified to point to the test file works ok. from artifactory import ArtifactoryPath path = ArtifactoryPath(
"http://sampleaf/artifactory/testrepo-local/testfile.txt"
)
with path.open() as fd:
with open("testfile.txt", "wb") as out:
out.write(fd.read()) @Schleissheimer569, after uploading the file to Artifactory, if you download it through the browser does it maintain the correct encoding? |
If i download the file through the browser it works correctly. I used the default download example, too. I used |
I had a different issue which @Schleissheimer569 solution solved. File "C:\Python38\lib\site-packages\urllib3\response.py", line 440, in read
data = self._fp.read()
File "C:\Python38\lib\http\client.py", line 467, in read
s = self._safe_read(self.length)
File "C:\Python38\lib\http\client.py", line 608, in _safe_read
data = self.fp.read(amt)
File "C:\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
OverflowError: Python int too large to convert to C long Implementing Schleissheimer569 's workaround solved it. |
Probably, we could add these functions to our library, why not. It looks useful. Could someone create a PR with these changes? I think we also should to add ability to customize |
I have same issue as topic starter. Python 3.7.9 // dohq-artifactory==0.7.468 // Artifactory from Jfrog Cloud |
What's more interesting: if I rename file.yaml file to smth like file.rpt everything become working. |
Downloading an text file with utf-8 encoding from Artifactory doesn’t work correctly.
If I try it with an example file with the following content:
the downloaded file contains some strange symbols instead of the content which it should contain.
Content of downloaded file:
As workaround I added in artifactory.py this function to the class _ArtifactoryAccessor
and this function to the class ArtifactoryPath.
Now I use
instead of
to download the file and it works fine for me.
The text was updated successfully, but these errors were encountered: