summaryrefslogtreecommitdiffstats
path: root/library/cpp/tld/gen_tld.py
Commit message (Collapse)AuthorAgeFilesLines
* fix gen_tld.py on non-unicode locale encodingsNikita Kozlovskiy2023-06-281-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix gen_tld.py on non-unicode locale encodings In python versions prior to 3.7, as well as when using non-unicode locale encodings, the `gen_tld.py` script fails: ``` ydb/ydb/library/cpp/tld % git rev-parse head 97b1a695d3be4edc08550d3ae7d200f6d9f3d42e ydb/ydb/library/cpp/tld % LC_CTYPE=C ~/.pyenv/versions/3.6.15/bin/python gen_tld.py tlds-alpha-by-domain.txt|md5 Traceback (most recent call last): File "gen_tld.py", line 57, in <module> main() File "gen_tld.py", line 39, in main sys.stdout.write('%s*/\n' % str.rstrip()) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) ``` This pull request fixes this behevaiour by explicit set output encoding to utf-8. To ensure that I do not break anything, I checked the MD5 hash of the generated file before and after making my changes: ``` ydb/ydb/library/cpp/tld % git rev-parse head 97b1a695d3be4edc08550d3ae7d200f6d9f3d42e ydb/ydb/library/cpp/tld % python3 gen_tld.py tlds-alpha-by-domain.txt|md5 564242d355d842db790977df3642a405 ``` After ``` ydb/ydb/library/cpp/tld % git rev-parse head 1096dd7f034c573aabdf3bac2dc4b181a6688c71 ydb/ydb/library/cpp/tld % python3 gen_tld.py tlds-alpha-by-domain.txt|md5 564242d355d842db790977df3642a405 ydb/ydb/library/cpp/tld % LC_CTYPE=C ~/.pyenv/versions/3.6.15/bin/python gen_tld.py tlds-alpha-by-domain.txt|md5 564242d355d842db790977df3642a405 ``` Pull Request resolved: #279
* Port gen_tld to py3svidyuk2022-12-161-12/+12
|
* Restoring authorship annotation for <[email protected]>. Commit ↵abolkhovityanov2022-02-101-56/+56
| | | | 2 of 2.
* Restoring authorship annotation for <[email protected]>. Commit ↵abolkhovityanov2022-02-101-56/+56
| | | | 1 of 2.
* Restoring authorship annotation for Anton Samokhvalov <[email protected]>. ↵Anton Samokhvalov2022-02-101-1/+1
| | | | Commit 2 of 2.
* Restoring authorship annotation for Anton Samokhvalov <[email protected]>. ↵Anton Samokhvalov2022-02-101-1/+1
| | | | Commit 1 of 2.
* intermediate changesDevtools Arcadia2022-02-071-0/+57
ref:cde9a383711a11544ce7e107a78147fb96cc4029