Skip to content
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

Unsupported locale on Android #602

Closed
machawk1 opened this issue Jan 15, 2019 · 2 comments · Fixed by #619
Closed

Unsupported locale on Android #602

machawk1 opened this issue Jan 15, 2019 · 2 comments · Fixed by #619
Labels

Comments

@machawk1
Copy link
Member

machawk1 commented Jan 15, 2019

I am attempting to run ipwb on Android 8.1.0 via Termux and am running into an issue relating to unsupported locale (related: #21, #333, #332, #214, #99). I have started the ipfs daemon and pulled the latest ipwb source from GitHub (13eb385).

Upon running ipwb index ipwb/samples/warcs/5mementos.warc | ipwb replay, I get the error in the attached screenshot:

A potential caveat: I am running Python 3.7.2 (#51) via the installation command pkg install python then installing from the locally pulled repo source via pip install . instead of from pypi.

I plan on looking into this further, but please attempt to replicate this issue then comment if needed.

@machawk1 machawk1 added the bug label Jan 15, 2019
@machawk1
Copy link
Member Author

I tried a few different locales. The basis of these was the supporting listing provided by locale.locale_alias. These did not work but were listed:

  • en_US.ISO8895-1
  • english_us
  • en_us
  • en_US.utf8
  • en_US

Setting the locale via locale.setlocale(locale.LOC_TIME, '') (what is current done with an empty string second argument in lieu of a system-provided locale) returns C.UTF-8 but I am unsure if this has the intended effect that we need in setting the locale.

@machawk1
Copy link
Member Author

machawk1 commented Jul 11, 2019

Re-tested with latest master 63433f3 and fresh Termux.

  • install ipfs 0.4.21, python 3.7.4, and git 2.22.0 via pkg install
  • install clang 8.0.0 via pkg install, required for pycryptodome module used in ipwb
  • git clone https://github.com/oduwsdl/ipwb; cd ipwb; pip install -r requirements.txt; pip install .
  • ipfs init; ipfs daemon &
  • ipwb index samples/warcs/5mementos.warc
Traceback (most recent call last):os.warc: 1/8
  File "/data/data/com.termux/files/usr/bin/ipwb", line 11, in <module>
    load_entry_point('ipwb==0.2019.6.14.1328', 'console_scripts', 'ipwb')()
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/__main__.py", line 18, in main
    args = checkArgs(sys.argv)
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/__main__.py", line 166, in checkArgs
    results.func(results)
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/__main__.py", line 33, in checkArgs_index
    debug=args.debug)
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/indexer.py", line 173, in indexFileAt
    warcFileFullPath, **encryptionAndCompressionSetting)
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/indexer.py", line 290, in getCDXJLinesFromFile
    record.rec_headers.get_header('WARC-Date'))
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/util.py", line 159, in iso8601ToDigits14
    setLocale()
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/ipwb/util.py", line 139, in setLocale
    locale.setlocale(locale.LC_TIME, newLocale)
  File "/data/data/com.termux/files/usr/lib/python3.7/locale.py", line 604, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

This was a bit easier to replicate once setting up my authorized_keys and sshing into an Android device instead of using an on-screen keyboard.

EDIT: sshd via Termux uses port 8022 by default, so ssh -p 8022 (ip) from desktop after running sshd in Termux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant