-
Notifications
You must be signed in to change notification settings - Fork 19
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
utf-8 codec error #5
Comments
Got almost the same issue on the recent version.
Both servers targets at p4transfer config file is set to none charset, What i've managed to find out, is that file which causes the error is The file itself on target server local filesystem (as well as at source server) is in "unknown-8bit" encoding
For sure, as a very dirty solution, we can change the file/or re-encode it, however this is not permitted way since we're not owning the code and can't predict any consequences of such change. Can we just force to Here is all attempts of file opening, only one is a binary:
According to https://python-notes.curiousefficiency.org/en/latest/python3/text_file_processing.html#the-binary-option looks like Binary option is only the reliable way to not corrupt the data. Why do the encoding/decoding is still in-place? it's something that could lead to data corruption. Any thoughts? |
This is solved my issue
|
@rcowham would you mind to comment on that? |
Hmmm. Looks OK as a workaround. I wonder if it is better to allow an extra locale setting to be specified? |
Not sure, that it can provide a reliable solution for keeping data consistent while encoding, since we never sure what exact encoding clients are using until it's not aligned for all developers, which is i believe a rare case. Most common, when several teams using their own approach for encoding settings. |
As well for some cases it could can be a good idea to allow restrict (make it configurable) of processsing text+k at all, this will eliminate such kind of issues at all. I believe some of cases (for some setups) not requires to update values of rcs tags while migration. |
We are seeing below issue with some changes during the migration. We can proceed with the migration by excluding the paths n yaml file but this is the third time we got this error. Any idea what is this about and how to resolve this?
root@dc2-p4-gl-05:/scm/p4transfer # tail -20 log-P4Transfer-20210510090851.log
'rev': 1,
'time': datetime.datetime(2017, 7, 25, 7, 14, 59),
'type': 'text+kx',
'user': 'amirl'}]}]
2021-05-10 09:16:41,946:P4Transfer:DEBUG: src('sync', '//hmallesh_test_transfer/...@=219564')
2021-05-10 09:16:52,093:P4Transfer:DEBUG: src[]
2021-05-10 09:16:53,552:P4Transfer:ERROR: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte
Traceback (most recent call last):
File "P4Transfer.py", line 2149, in replicate
num_changes = self.replicate_changes()
File "P4Transfer.py", line 1965, in replicate_changes
fileRevs, branchRevs = self.source.getChange(change['change'])
File "P4Transfer.py", line 1114, in getChange
chRev.updateDigest()
File "P4Transfer.py", line 524, in updateDigest
self.fileSize, self.digest = getKTextDigest(self.fixedLocalFile)
File "P4Transfer.py", line 425, in getKTextDigest
contents = contents.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte
2021-05-10 09:16:53,552:P4Transfer:INFO: Sleeping on error for 60 minutes
root@dc2-p4-gl-05:/scm/p4transfer #
The text was updated successfully, but these errors were encountered: