You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use python3.8 and pip import you-get, program throw a exception like io error, i see you-get third-party that common.py line(23) is "sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')", I don’t know if this can be executed normally
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val py = Python.getInstance()
val str = py.getModule("test").callAttr("greet")
Log.e("aaa",str.toString())
}
}
test.py:
from you_get import common as you_get
def greet():
url = "https://www.bilibili.com/video/BV1cV411s7c9"
outputDir = r'/sdcard'
you_get.any_download(url, info_only=False, output_dir=outputDir, merge=True)
return "download finish"
Describe your issue
E: FATAL EXCEPTION: main
Process: com.ilab.pythondemo, PID: 2203
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ilab.pythondemo/com.ilab.pythondemo.MainActivity}: com.chaquo.python.PyException: AttributeError: 'LogOutputStream' object has no attribute 'buffer'
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: com.chaquo.python.PyException: AttributeError: 'LogOutputStream' object has no attribute 'buffer'
at <python>.you_get.common.<module>(common.py:23)
at <python>.java.chaquopy.import_override(import.pxi:26)
at <python>.test.<module>(test.py:1)
at <python>.importlib._bootstrap._call_with_frames_removed(<frozen importlib._bootstrap>:219)
at <python>.importlib._bootstrap_external.exec_module(<frozen importlib._bootstrap_external>:783)
at <python>.java.android.importer.exec_module(importer.py:507)
at <python>.java.android.importer.exec_module(importer.py:556)
at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:671)
at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:975)
at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:991)
at <python>.importlib._bootstrap._gcd_import(<frozen importlib._bootstrap>:1014)
at <python>.importlib.import_module(__init__.py:127)
at <python>.chaquopy_java.Java_com_chaquo_python_Python_getModuleNative(chaquopy_java.pyx:155)
at com.chaquo.python.Python.getModuleNative(Native Method)
at com.chaquo.python.Python.getModule(Python.java:84)
at com.ilab.pythondemo.MainActivity.onCreate(MainActivity.kt:13)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
The text was updated successfully, but these errors were encountered:
This issue is fixed in Chaquopy 10.0.1. To upgrade, edit your app's top-level build.gradle file and change the version number of com.chaquo.python:gradle.
i use python3.8 and pip import you-get, program throw a exception like io error, i see you-get third-party that common.py line(23) is "sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')", I don’t know if this can be executed normally
Chaquopy version
9.1.0
Devices or emulators where the issue happens
real device and emulator
Relevant parts of your code
app gradle:
MainActivity.java:
test.py:
Describe your issue
The text was updated successfully, but these errors were encountered: