Skip to content

TypeError: a bytes-like object is required, not 'str' #856

@redstoneleo

Description

@redstoneleo

i@i ~/文档/code/myapp $ /home/i/.local/bin/p4a apk --private $HOME/文档/code/myapp --package=org.example.myapp --name "My application" --version 0.1 -requirements=python2,kivy
[INFO]: This python-for-android revamp is an experimental alpha release!
[INFO]: It should work (mostly), but you may experience missing features or bugs.
/usr/lib/python3.5/re.py:203: FutureWarning: split() requires a non-empty pattern match.
return _compile(pattern, flags).split(string, maxsplit)
[INFO]: Will compile for the following archs: armeabi
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are (16, 17, 18, 19, 20, 21, 22)
[INFO]: Requested API target 16 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK
[INFO]: Got NDK version from $ANDROIDNDKVER
[INFO]: Using Google NDK r12b
[INFO]: Found virtualenv at /usr/local/bin/virtualenv
[INFO]: Found the following toolchain versions: ['4.9']
[INFO]: Picking the latest gcc toolchain, here 4.9
[WARNING]: Missing executable: autoconf is not installed
[WARNING]: Missing executable: automake is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]: No existing dists meet the given requirements!
[INFO]: No dist exists that meets your requirements, so one will be built.
[INFO]: Found a single valid recipe set (this is good)
[INFO]: Trying to find a bootstrap that matches the given recipes.
[INFO]: Found 7 acceptable bootstraps: ['pygame', 'plain', 'plain', 'webview', 'webview', 'sdl2', 'sdl2']
[INFO]: Using the first of these: pygame
[INFO]: pygame bootstrap appears compatible with the required recipes.
[INFO]: Checking this...
[INFO]: Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])
[INFO]: Loaded recipe python2 (depends on ['hostpython2'], conflicts ['python3crystax', 'python3'])
[INFO]: Loaded recipe pyjnius (depends on [('sdl2', 'sdl', 'genericndkbuild'), 'six', ('python2', 'python3crystax')])
[INFO]: Loaded recipe sdl (depends on ['python2', 'pygame_bootstrap_components'], conflicts ['sdl2'])
[INFO]: Loaded recipe pygame (depends on ['python2', 'sdl'], conflicts ['sdl2'])
[INFO]: Loaded recipe android (depends on [('python2', 'python3'), ('pygame', 'sdl2', 'genericndkbuild'), ('python2', 'python3crystax')])
[INFO]: Loaded recipe kivy (depends on [('sdl2', 'pygame'), 'pyjnius', ('python2', 'python3crystax')])
[INFO]: Loaded recipe six (depends on [('python2', 'python3crystax')])
[INFO]: Loaded recipe pygame_bootstrap_components (depends on [])
[INFO]: Loaded recipe kivy (depends on [('sdl2', 'pygame'), 'pyjnius', ('python2', 'python3crystax')])
[INFO]: Loaded recipe pygame (depends on ['python2', 'sdl'], conflicts ['sdl2'])
[INFO]: Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])
[INFO]: Loaded recipe android (depends on [('python2', 'python3'), ('pygame', 'sdl2', 'genericndkbuild'), ('python2', 'python3crystax')])
[INFO]: Loaded recipe python2 (depends on ['hostpython2'], conflicts ['python3crystax', 'python3'])
[INFO]: Loaded recipe pyjnius (depends on [('sdl2', 'sdl', 'genericndkbuild'), 'six', ('python2', 'python3crystax')])
[INFO]: Loaded recipe pygame_bootstrap_components (depends on [])
[INFO]: Loaded recipe six (depends on [('python2', 'python3crystax')])
[INFO]: Loaded recipe sdl (depends on ['python2', 'pygame_bootstrap_components'], conflicts ['sdl2'])
[INFO]: Found a single valid recipe set (this is good)
[INFO]: The selected bootstrap is pygame
[INFO]: # Creating dist with pygame bootstrap
[INFO]: Dist will have name unnamed_dist_6 and recipes ()
[INFO]: -> running cp -r /home/i/.local/lib/pytho...(and 129 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/bootstrap_builds/pygame
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Recipe build order is ['hostpython2', 'pygame_bootstrap_components', 'python2', 'sdl', 'six', 'pygame', 'pyjnius', 'android', 'kivy']
[INFO]: # Downloading recipes
[INFO]: Downloading hostpython2
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 38 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/hostpython2
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: hostpython2 download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading pygame_bootstrap_components
[INFO]: -> running mkdir -p /home/i/.local/share/...(and 55 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/pygame_bootstrap_components
[INFO]: -> running basename https://github.com/ki...(and 53 more)
[INFO]: pygame_bootstrap_components download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading python2
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 34 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/python2
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: python2 download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading sdl
[INFO]: Skipping sdl download as no URL is set
[INFO]: Downloading six
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 30 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/six
[INFO]: -> running basename https://pypi.python.or...(and 40 more)
[INFO]: six download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading pygame
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 33 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/pygame
[INFO]: -> running basename http://pygame.org/ftp/...(and 26 more)
[INFO]: pygame download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading pyjnius
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 34 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/pyjnius
[INFO]: -> running basename https://github.com/kiv...(and 28 more)
[INFO]: pyjnius download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Downloading android
[INFO]: Skipping android download as no URL is set
[INFO]: Downloading kivy
[INFO]: -> running mkdir -p /home/i/.local/share/p...(and 31 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/packages/kivy
[INFO]: -> running basename https://github.com/kiv...(and 25 more)
[INFO]: kivy download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: # Building all recipes for arch armeabi
[INFO]: # Unpacking recipes
[INFO]: Unpacking hostpython2 for armeabi
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/hostpython2/desktop
[INFO]: hostpython2 is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Unpacking pygame_bootstrap_components for armeabi
[INFO]: -> running basename https://github.com/ki...(and 53 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/bootstrap_builds/pygame/jni
[INFO]: pygame_bootstrap_components is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Unpacking python2 for armeabi
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/python2/armeabi
[INFO]: python2 is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Unpacking sdl for armeabi
[INFO]: Skipping sdl unpack as no URL is set
[INFO]: Unpacking six for armeabi
[INFO]: -> running basename https://pypi.python.or...(and 40 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/six-python2/armeabi
[INFO]: six is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Unpacking pygame for armeabi
[INFO]: -> running basename http://pygame.org/ftp/...(and 26 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/pygame/armeabi
[INFO]: pygame is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Unpacking pyjnius for armeabi
[INFO]: -> running basename https://github.com/kiv...(and 28 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/pyjnius-python2-sdl/armeabi
[INFO]: pyjnius is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: -> running rm -rf /home/i/.local/share/py...(and 82 more)
[INFO]: -> running cp -a /home/i/.local/lib/pytho...(and 161 more)
[INFO]: Unpacking kivy for armeabi
[INFO]: -> running basename https://github.com/kiv...(and 25 more)
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/kivy-pygame-python2/armeabi
[INFO]: kivy is already unpacked, skipping
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: # Prebuilding recipes
[INFO]: Prebuilding hostpython2 for armeabi
[INFO]: -> running cp /home/i/.local/lib/python3....(and 163 more)
[INFO]: Prebuilding pygame_bootstrap_components for armeabi
[INFO]: Unpacking pygame bootstrap JNI dir components
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/bootstrap_builds/pygame/jni
[INFO]: sdl dir exists, so it looks like the JNI componentsare already unpacked. Skipping.
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Prebuilding python2 for armeabi
[INFO]: python2 has no prebuild_armeabi, skipping
[INFO]: Applying patches for python2[armeabi]
[INFO]: python2 already patched, skipping
[INFO]: Prebuilding sdl for armeabi
[INFO]: sdl has no prebuild_armeabi, skipping
[INFO]: Prebuilding six for armeabi
[INFO]: six has no prebuild_armeabi, skipping
[INFO]: Prebuilding pygame for armeabi
[INFO]: Applying patches for pygame[armeabi]
[INFO]: pygame already patched, skipping
[INFO]: Prebuilding pyjnius for armeabi
[INFO]: pyjnius has no prebuild_armeabi, skipping
[INFO]: Applying patches for pyjnius[armeabi]
[INFO]: pyjnius already patched, skipping
[INFO]: Prebuilding android for armeabi
[INFO]: android has no prebuild_armeabi, skipping
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/android-pygame-python2-python2/armeabi/android
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Prebuilding kivy for armeabi
[INFO]: kivy has no prebuild_armeabi, skipping
[INFO]: # Building recipes
[INFO]: Building hostpython2 for armeabi
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2
[INFO]: hostpython already exists, skipping build
[INFO]: <- directory context /home/i/文档/code/myapp
[INFO]: Building pygame_bootstrap_components for armeabi
[INFO]: Building python2 for armeabi
[INFO]: -> running cp -a /home/i/.local/share/pyt...(and 150 more)
[INFO]: Copying hostpython binary to targetpython folder
[INFO]: -> running cp /home/i/.local/share/python...(and 167 more)
[INFO]: -> running cp /home/i/.local/share/python...(and 157 more)
[INFO]: Building sdl for armeabi
ccache found, will optimize builds
path is /home/i/文档/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/:/home/i/文档/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:/home/i/文档/android-ndk-r12b:/home/i/文档/android-sdk-linux/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/i/.local/bin/pyqtdeploy
[INFO]: -> directory context /home/i/.local/share/python-for-android/build/bootstrap_builds/pygame/jni
[INFO]: -> running ndk-build V=1
working: /usr/bin/ccache /home/i/文档/android-ndk-r...(and 1291 more) working: [armeabi] Compile thumb : sdl <= SDL_cdrom.c Traceback (most recent call last):
File "/home/i/.local/bin/p4a", line 9, in
load_entry_point('python-for-android==0.4', 'console_scripts', 'p4a')()
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/toolchain.py", line 754, in main
ToolchainCL()
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/toolchain.py", line 343, in init
getattr(self, command_method_name)(unknown)
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/toolchain.py", line 93, in wrapper_func
build_dist_from_args(ctx, dist, dist_args)
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/toolchain.py", line 138, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/build.py", line 561, in build_recipes
recipe.build_arch(arch)
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/recipes/sdl/init.py", line 21, in build_arch
shprint(sh.ndk_build, 'V=1', _env=env, _tail=20, _critical=True)
File "/home/i/.local/lib/python3.5/site-packages/pythonforandroid/logger.py", line 176, in shprint
'\n', ' ').replace(
TypeError: a bytes-like object is required, not 'str'
i@i ~/文档/code/myapp $

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions