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

AttributeError: 'NoneType' object has no attribute 'endswith' #128

Open
Sunwood-ai-labs opened this issue May 6, 2024 · 0 comments
Open

Comments

@Sunwood-ai-labs
Copy link

概要

Zoltraakを使用してMarkdownファイルを処理しようとしたところ、AttributeError: 'NoneType' object has no attribute 'endswith'というエラーが発生した。

再現手順

  1. ターミナルで以下のコマンドを実行する。
    zoltraak "Motokiコーヒー顧客データ分析プロダクトv8" -c dev_streamlit_mini
  2. 魔法術式から領域術式を実行するかの確認メッセージでyと入力する。
  3. エラーが発生する。

エラー文

Traceback (most recent call last):
  File "/usr/local/bin/zoltraak", line 33, in <module>
    sys.exit(load_entry_point('zoltraak', 'console_scripts', 'zoltraak')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/zoltraak/cli.py", line 44, in main
    process_markdown_file(args)                                          # - Markdownファイルを処理する関数を呼び出す
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/zoltraak/cli.py", line 132, in process_markdown_file
    args.compiler + ("" if args.compiler.endswith(".md") else ".md"),
                           ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'
Sunwood-ai-labs added a commit to Sunwood-ai-labs/zoltraak that referenced this issue May 6, 2024
## 概要

`process_markdown_file`関数内で、`args.compiler`が`None`の場合に発生するエラーを修正しました。

## 詳細

以下のステップで修正を行いました:

1. `args.compiler`の値を表示するための`print`文を追加
   - デバッグ目的で、`args.compiler`の値を確認できるようにしました

2. `compiler_path`の設定方法を修正
   - `args.compiler`が`None`または`"None"`の場合は、`compiler_path`を`None`に設定するように変更
   - `args.compiler`が存在し、`.md`で終わる場合はそのまま使用し、そうでない場合は`.md`を追加するように変更

これにより、`args.compiler`が`None`の場合でもエラーが発生しなくなります。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant