首页 > 其他分享 >flask db upgrade出现UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in positio

flask db upgrade出现UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in positio

时间:2024-09-23 13:45:19浏览次数:7  
标签:upgrade utf py project api File pycharm byte line

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\pycharm_project\rag-api\api\.venv\Scripts\flask.exe\__main__.py", line 7, in <module>
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\flask\cli.py", line 1105, in main
    cli.main()
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\flask\cli.py", line 386, in decorator
    return ctx.invoke(f, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\flask_migrate\cli.py", line 154, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\flask_migrate\__init__.py", line 111, in wrapped
    f(*args, **kwargs)
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\flask_migrate\__init__.py", line 200, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\alembic\command.py", line 406, in upgrade
    script.run_env()
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\alembic\script\base.py", line 582, in run_env
    util.load_python_file(self.dir, "env.py")
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\pycharm_project\rag-api\api\migrations\env.py", line 112, in <module>
    run_migrations_online()
  File "D:\pycharm_project\rag-api\api\migrations\env.py", line 96, in run_migrations_online
    with connectable.connect() as connection:
         ^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3278, in connect
    return self._connection_cls(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3302, in raw_connection
    return self.pool.connect()
           ^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout
    rec = pool._do_get()
          ^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 179, in _do_get
    with util.safe_reraise():
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 177, in _do_get
    return self._create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__
    self.__connect()
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect
    with util.safe_reraise():
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 146, in __exit__
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 621, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pycharm_project\rag-api\api\.venv\Lib\site-packages\psycopg2\__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 61: invalid continuation byte

标签:upgrade,utf,py,project,api,File,pycharm,byte,line
From: https://www.cnblogs.com/Gimm/p/18426936

相关文章

  • 为何有时出现:Allowed memory size of 134217728 bytes exhausted (tried to allocate
    出现“Allowedmemorysizeof134217728bytesexhausted(triedtoallocate20480bytes)”这样的错误,意味着PHP脚本运行时消耗的内存超过了PHP配置允许的最大内存限制。这个错误通常是因为PHP脚本处理的数据量过大、内存消耗较高的任务或配置不当引起的。以下是几种解决......
  • Java 选 UTF-16 原因
    在Java中使用UTF-16而不是UTF-8主要有以下几个原因:一、历史背景和兼容性考虑Java诞生于上世纪90年代,当时Unicode主要以16位编码为主,UTF-16能更好地与早期的Unicode版本兼容。Java在设计之初选择UTF-16编码可以更方便地处理当时主流的字符集,确保与已有的......
  • 文字的编码方式————不同UTF之间的区别
    1.编码与字体    对于同一个字符,在文件中保存的是他的编码值,这些文字什么形态,是由字符文件决定的。编码值和字体是两个不一样的东西,例如B的编码值是0x42,但是在屏幕上显示出来时,可以有不同形状,如繁体字与简体中文的区别。        什么叫编码?就是一个字符用什......
  • MySQL 中的 UTF-8 与 UTF8MB4:差异解析
    在MySQL数据库中,字符集的选择对于数据的存储和处理至关重要。其中,UTF-8和UTF8MB4是两个常见的字符集选项。那么,它们之间到底有什么区别呢?一、字符集简介UTF-8UTF-8(8-bitUnicodeTransformationFormat)是一种可变长度的字符编码方式,可以表示世界上几乎所有的字符。它使......
  • 助力企业降低成本,ByteHouse打造新一代“弹性”云数仓
    更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群在当今的互联网应用中,业务流量往往具有很大的不确定性。例如,电商平台在“618”“双11”等促销活动期间,访问量会呈爆发式增长,可能是平时的十倍甚至百倍,导致系统无法承载如此高负载而崩溃。这就......
  • 助力企业降低成本,ByteHouse打造新一代“弹性”云数仓
     更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群  在当今的互联网应用中,业务流量往往具有很大的不确定性。 例如,电商平台在“618”“双11”等促销活动期间,访问量会呈爆发式增长,可能是平时的十倍甚至百倍,导致系统无法承载如此......
  • Qwen2模型量化时关于bitsandbytes安装的问题
    Qwen2模型量化时关于bitsandbytes安装的问题问题描述:fromtransformersimportAutoTokenizer,AutoModelForCausalLM,GenerationConfig,BitsAndBytesConfigCUDA_DEVICE="cuda:0"model_name_or_path='/qwen2-1.5b-instruct'Tokenizer=AutoTokenizer.from_pr......
  • 易优eyoucms网站系统报错:unserialize(): Error at offset 0 of 1571 bytes
    遇到“unserialize():Erroratoffset0of1571bytes”这类错误,通常是因为缓存文件损坏或格式不正确。针对EyouCMS1.5.1版本,可以采取以下步骤来解决这个问题:解决方案一:清除缓存文件通过FTP访问服务器:使用FTP客户端(如FileZilla、WinSCP等)连接到服务器。导航到 /data/r......
  • Hadoop(十九)MapReduce OutputFormat 数据压缩
    OutputFormatOutputFormat是MapReduce输出的基类,所有实现MapReduce输出都实现了OutputFormat接口几种常见的OutputFormat实现类:NullOutputFormat、MapFileOutputFormat、TextOutputFormat等自定义OutputFormat应用场景:输出数据到MySQL/HBase/Elasticsearch等存储框架中步......
  • Hadoop(十七)MapReduce 切片机制 InputFormat
    切片与MapTask并行度决定机制MapTask的并行度决定Map阶段的任务处理并发度,进而影响到整个Job的处理速度数据块:Block是HDFS物理上把数据分成一块一块,数据块是HDFS存储数据单位数据切片:数据切片只是在逻辑上对输入进行分片,并不会在磁盘上将其切分成片进行存储,数据切片是MapReduc......