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

TypeError: expected str, bytes or os.PathLike object, not NoneType #403

Open
justchillbruh opened this issue Mar 3, 2025 · 12 comments
Open

Comments

@justchillbruh
Copy link

Script Mode

  • Native

Process Mode

  • Gradio GUI

Operating System:

  • Windows

Describe the bug
I am having a strange reoccurring issue. I've noticed that the first run of ebook2audiobook works normally, however when I later try a second go, this time with a directory, I get the error below. When I get this error in my CMD, I also get a "Conversion cancelled" message on the GUI, with the files disappearing from the GUI.

After I receive this error, no matter what I try through the GUI, I cannot get it to process a file. Doesn't matter if I change it to a file, change the voice audio file, change the fine tuned models, or the session name. It just comes up with the same error for that file.

Whenever I get this error, the most reliable solution has been to delete the entire folder from my computer, and then do another git pull.

Through past testing, I noticed you can sometimes get it started with a new session through the CLI, cancel it, and then continue the session through the GUI instead. Sometimes it can also work if you close the past instance of ebook2audiobook and reopen it, by either doing Ctrl+C in the terminal window or force closing it, and then change the session name.

Terminal log
(One thing I should also note, this is the latest git pull, not version 25.3.2)

v25.3.2 native mode
IPs available for connection:
['192.168.0.146', '10.2.0.2', '127.0.0.1', '::1']
Note: 0.0.0.0 is not the IP to connect. Instead use an IP above to connect.
* Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Processing eBook file: test_eng.azw3
expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "C:\Users\xxx\Documents\ebook2audiobook\ebook2audiobook\lib\functions.py", line 189, in prepare_dirs
    os.makedirs(session['custom_model_dir'], exist_ok=True)
  File "<frozen os>", line 210, in makedirs
  File "<frozen ntpath>", line 241, in split
TypeError: expected str, bytes or os.PathLike object, not NoneType
Caught DependencyError: expected str, bytes or os.PathLike object, not NoneType
Temporary directory C:\Users\xxx\Documents\ebook2audiobook\ebook2audiobook\tmp\ebook-Test-Conversion\06b0cefade193ba9cb7583b0f16d3841 not removed due to failure.
C:\Users\xxx\Documents\ebook2audiobook\ebook2audiobook\python_env\Lib\site-packages\gradio\components\file.py:113: UserWarning: The `file_types` parameter is ignored when `file_count` is 'directory'.
  warnings.warn(

Here are my settings I've set:

  1. English language
  2. BobOdenkirk voice audio file
  3. XTTS
  4. BobOdenkirk Fine Tuned Model
  5. Test-One session name
  6. m4b output format
  7. GPU processor unit
@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Mar 3, 2025

refresh your webpage. every time you stop gradio socket and restart, you have to refresh your webpage

@justchillbruh
Copy link
Author

justchillbruh commented Mar 3, 2025

I already refresh the web page whenever I stop and restart the service, same issue persists.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Mar 3, 2025

control+c to quit completely the gradio socket. restart ./ebook2audiobook.sh
reload the webpage. it should work. even better, quit the terminal and restart a new one.

@justchillbruh
Copy link
Author

I fully closed all windows, and quit the terminal with control+c. I double-clicked ebook2audiobook.cmd, and waited for the terminal to display "* Running on local URL:". Then I opened up Microsoft Edge, and went to localhost:7860. The Gradio GUI opened up, and I set up a new conversion.

I chose directory, and uploaded 2 epub files. I chose English, chose DermotCrowley for the audio file and fine tuned model. I set the session name to something new, Mass-Conversion-Test-One.

I clicked on the start button. Got the following terminal output, with an error on Gradio saying "Conversion cancelled."

v25.3.2 native mode
IPs available for connection:
['192.168.0.146', '10.2.0.2', '127.0.0.1', '::1']
Note: 0.0.0.0 is not the IP to connect. Instead use an IP above to connect.
* Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
C:\Users\Jesse\Documents\ebook2audiobook\ebook2audiobook\python_env\Lib\site-packages\gradio\components\file.py:113: UserWarning: The `file_types` parameter is ignored when `file_count` is 'directory'.
  warnings.warn(
Processing eBook file: test_eng.azw3
expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "C:\Users\Jesse\Documents\ebook2audiobook\ebook2audiobook\lib\functions.py", line 189, in prepare_dirs
    os.makedirs(session['custom_model_dir'], exist_ok=True)
  File "<frozen os>", line 210, in makedirs
  File "<frozen ntpath>", line 241, in split
TypeError: expected str, bytes or os.PathLike object, not NoneType
Caught DependencyError: expected str, bytes or os.PathLike object, not NoneType
Temporary directory C:\Users\Jesse\Documents\ebook2audiobook\ebook2audiobook\tmp\ebook-Mass-Conversion-Test-One\06b0cefade193ba9cb7583b0f16d3841 not removed due to failure.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Mar 3, 2025

what do you mean by "I set the session name to something new, Mass-Conversion-Test-One" ???
sessions are not modifiable and are uuidv4 type automatically set by eb2ab. also there is no way to change it in gradio mode, and if it's changed in headless mode so it will be ignored. the session is unique and internally managed by eb2ab and should not be changed in any way.
btw, how did you change it from the webpage if it's the case?

@justchillbruh
Copy link
Author

The "Session" field on the Gradio GUI is a text box.

Image

@ROBERT-MCDOWELL
Copy link
Collaborator

this text box is in read mode only, if edge allows to enter something inside so it's a bug from edge or gradio.
this should absolutely not be touched at all.

@justchillbruh
Copy link
Author

It would be a bug for Gradio then, confirmed it is also editable on Firefox.

@justchillbruh
Copy link
Author

Inspect element confirms it's an input container

Image

@ROBERT-MCDOWELL
Copy link
Collaborator

I will check with gradio developers what's happening. for now just leave it untouched with the uuid inside created for your own session. if it's empty, so delete the whole eb2ab folder and clone it again

@ROBERT-MCDOWELL
Copy link
Collaborator

it;'s normal it's an input container, but must be a readonly

@ROBERT-MCDOWELL
Copy link
Collaborator

ok I found the issue, it will be fixed and merge later or tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants