Jobs_Applier_AI_Agent icon indicating copy to clipboard operation
Jobs_Applier_AI_Agent copied to clipboard

[BUG]: Error in Resume Generation: Missing Platform Module in Python Script

Open guschain opened this issue 4 months ago • 3 comments

Describe the bug

When attempting to generate and upload a resume, the process fails with a NameError: name 'platform' is not defined. This error occurs in the create_driver_selenium() function, where the platform.system() call is made without importing the platform module. I have tried in Windows and Linux with WSL2 with the same result.

Steps to reproduce

When attempting to generate and upload a resume, the process fails with a NameError: name 'platform' is not defined. This error occurs in the create_driver_selenium() function, where the platform.system() call is made without importing the platform module.

Steps to Reproduce:

Trigger the resume generation process. Observe the error in the logs: name 'platform' is not defined. Expected Behavior: The resume should be generated and uploaded without errors.

Actual Behavior: The resume generation fails due to the missing platform module, resulting in an exception and preventing the resume from being uploaded.

Logs:

2024-10-17 00:32:02.828 | DEBUG    | src.llm.llm_manager:resume_or_cover:615 - Response for resume_or_cover: resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_handle_upload_fields:420 - Uploading resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_handle_upload_fields:425 - Resume path not found or invalid, generating new resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:434 - Starting the process of creating and uploading resume.
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:449 - Generated file path for resume: generated_cv\CV_1729121522.pdf
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:451 - Generating resume for job: Brand Manager - Alzheimer - MBA (m/f/d) at Hays
2024-10-17 00:32:38.027 | ERROR    | src.aihawk_easy_applier:_create_and_upload_resume:480 - Failed to generate resume: name 'platform' is not defined
2024-10-17 00:32:38.028 | ERROR    | src.aihawk_easy_applier:_create_and_upload_resume:482 - Traceback: Traceback (most recent call last):
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\src\aihawk_easy_applier.py", line 452, in _create_and_upload_resume
    resume_pdf_base64 = self.resume_generator_manager.pdf_base64(job_description_text=job.description)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\manager_facade.py", line 81, in pdf_base64
    pdf_base64 = HTML_to_PDF(temp_html_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\utils.py", line 26, in HTML_to_PDF
    driver = create_driver_selenium()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\utils.py", line 14, in create_driver_selenium
    if platform.system() == "Windows":
       ^^^^^^^^
NameError: name 'platform' is not defined

Expected behavior

The resume should be generated and uploaded without errors.

Actual behavior

The resume generation fails due to the missing platform module, resulting in an exception and preventing the resume from being uploaded.

Branch

main

Branch name

No response

Python version

Python 3.11.3 and 3.10.12

LLM Used

ChatGPT

Model used

GPT-4o-Mini

Additional context

No response

guschain avatar Oct 16 '24 23:10 guschain