问题:发现一个违反意图的制表符

发布于 2024-10-14 06:04:39 字数 2505 浏览 7 评论 0原文

./run-bot
Running bot 22496
Error parsing ./shittybot.yml: YAML::XS::Load Error: The problem:

    found a tab character that violate intendation

was found at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 201
        Config::Any::_load('Config::Any', 'HASH(0x8de4708)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 94
        Config::Any::load_files('Config::Any', 'HASH(0x8de4708)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 104
        Config::JFDI::Source::Loader::_load_files('Config::JFDI::Source::Loader=HASH(0x85e1d48)', 'ARRAY(0x8de4f48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 62
        Config::JFDI::Source::Loader::read('Config::JFDI::Source::Loader=HASH(0x85e1d48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 153
        Config::JFDI::load('Config::JFDI=HASH(0x85e67c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 140
        Config::JFDI::config('Config::JFDI=HASH(0x85e67c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 131
        Config::JFDI::get('Config::JFDI=HASH(0x85e67c0)') called at bot.pl line 32

我该如何解决这个问题?

编辑:我认为我修复了缩进,但现在我收到此错误:

Error parsing ./shittybot.yml: YAML::XS::Load Error: The problem:

    found character that cannot start any token

was found at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 201
        Config::Any::_load('Config::Any', 'HASH(0xa3da738)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 94
        Config::Any::load_files('Config::Any', 'HASH(0xa3da738)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 104
        Config::JFDI::Source::Loader::_load_files('Config::JFDI::Source::Loader=HASH(0x9bd7d48)', 'ARRAY(0xa3daf78)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 62
        Config::JFDI::Source::Loader::read('Config::JFDI::Source::Loader=HASH(0x9bd7d48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 153
        Config::JFDI::load('Config::JFDI=HASH(0x9bdc7c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 140
        Config::JFDI::config('Config::JFDI=HASH(0x9bdc7c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 131
        Config::JFDI::get('Config::JFDI=HASH(0x9bdc7c0)') called at bot.pl line 32
./run-bot
Running bot 22496
Error parsing ./shittybot.yml: YAML::XS::Load Error: The problem:

    found a tab character that violate intendation

was found at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 201
        Config::Any::_load('Config::Any', 'HASH(0x8de4708)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 94
        Config::Any::load_files('Config::Any', 'HASH(0x8de4708)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 104
        Config::JFDI::Source::Loader::_load_files('Config::JFDI::Source::Loader=HASH(0x85e1d48)', 'ARRAY(0x8de4f48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 62
        Config::JFDI::Source::Loader::read('Config::JFDI::Source::Loader=HASH(0x85e1d48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 153
        Config::JFDI::load('Config::JFDI=HASH(0x85e67c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 140
        Config::JFDI::config('Config::JFDI=HASH(0x85e67c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 131
        Config::JFDI::get('Config::JFDI=HASH(0x85e67c0)') called at bot.pl line 32

How do I fix this?

EDIT: I fixed indentation I think, but now I get this error:

Error parsing ./shittybot.yml: YAML::XS::Load Error: The problem:

    found character that cannot start any token

was found at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 201
        Config::Any::_load('Config::Any', 'HASH(0xa3da738)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/Any.pm line 94
        Config::Any::load_files('Config::Any', 'HASH(0xa3da738)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 104
        Config::JFDI::Source::Loader::_load_files('Config::JFDI::Source::Loader=HASH(0x9bd7d48)', 'ARRAY(0xa3daf78)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI/Source/Loader.pm line 62
        Config::JFDI::Source::Loader::read('Config::JFDI::Source::Loader=HASH(0x9bd7d48)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 153
        Config::JFDI::load('Config::JFDI=HASH(0x9bdc7c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 140
        Config::JFDI::config('Config::JFDI=HASH(0x9bdc7c0)') called at /usr/local/lib/perl5/site_perl/5.10.1/Config/JFDI.pm line 131
        Config::JFDI::get('Config::JFDI=HASH(0x9bdc7c0)') called at bot.pl line 32

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

第七度阳光i 2024-10-21 06:04:39
  1. 用制表符替换所有空格
  2. 确保所有内容都正确缩进。
  1. Replace all spaces with tabs
  2. Ensure everything is properly indented.
睫毛溺水了 2024-10-21 06:04:39

使用您的pastebin 文件。

apv@cassidy[421]~/>perl -MYAML::XS=LoadFile -le 'LoadFile(+shift)' S1tuACcg.txt
             YAML::XS::Load Error: The problem:

    found a tab character that violate intendation

was found at document: 1, line: 8, column: 1
while scanning a plain scalar at line: 7, column: 18    
apv@cassidy[422]~/>perl -lne 'print "TAB!" if /\t/' S1tuACcg.txt
TAB!
TAB!
TAB!
apv@cassidy[423]~/>perl -pi -e 's/\t/        /' S1tuACcg.txt
apv@cassidy[424]~/>perl -MYAML::XS=LoadFile -le \
   'LoadFile(+shift) and print "OK!"' S1tuACcg.txt
OK!

我怀疑如果您升级 YAML::XS(我的是 0.34),您会看到我的示例显示的更好的错误反馈。

With your pastebin file.

apv@cassidy[421]~/>perl -MYAML::XS=LoadFile -le 'LoadFile(+shift)' S1tuACcg.txt
             YAML::XS::Load Error: The problem:

    found a tab character that violate intendation

was found at document: 1, line: 8, column: 1
while scanning a plain scalar at line: 7, column: 18    
apv@cassidy[422]~/>perl -lne 'print "TAB!" if /\t/' S1tuACcg.txt
TAB!
TAB!
TAB!
apv@cassidy[423]~/>perl -pi -e 's/\t/        /' S1tuACcg.txt
apv@cassidy[424]~/>perl -MYAML::XS=LoadFile -le \
   'LoadFile(+shift) and print "OK!"' S1tuACcg.txt
OK!

I suspect that if you upgrade your YAML::XS (mine’s 0.34), you’ll see the better error feedback my example shows.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文