diagnose fails (path too long for Windows)

Bug #1737121 reported by Al Hazred
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
Fix Released
Undecided
Unassigned

Bug Description

>>> from bs4.diagnose import diagnose
>>> f=open("some_file.htm", "r", encoding="utf-8")
>>> diagnose(f.read())
Diagnostic running on Beautiful Soup 4.6.0
Python version 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
Found lxml version 3.7.3.0
Found html5lib version 1.0.1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python36\lib\site-packages\bs4\diagnose.py", line 59, in diagnose
    elif os.path.exists(data):
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python36\lib\genericpath.py", line 19, in exists
    os.stat(path)
ValueError: stat: path too long for Windows

Diagnose tries to open a file with the full content of my file as filename. This does not work on windows.

description: updated
Revision history for this message
Leonard Richardson (leonardr) wrote :

Fixed in revision 453.

Changed in beautifulsoup:
status: New → Fix Committed
Changed in beautifulsoup:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.