Activity log for bug #1213387

Date Who What changed Old value New value Message
2013-08-17 14:44:42 Augusto Santos bug added bug
2013-08-17 14:51:50 Augusto Santos description On __Init__.py, on the end of the file, there is a print function that is not compatible with Python 3. While it should, mostly, not be executed, the error is still there: if __name__ == '__main__': import sys soup = BeautifulSoup(sys.stdin) print soup.prettify() BS4 is not compatible with Python 3.3. First there are some problems with print usage (like on the end of __init__.py) if __name__ == '__main__':     import sys     soup = BeautifulSoup(sys.stdin)     print soup.prettify() Tried running 2to3 on it and still got the following error Traceback (most recent call last): File "C:\Users\AntonioAugusto\Google Drive\Migrado Dropbox\Game Searcher - Shell\busca_jogos.py", line 537, in <module> main() File "C:\Users\AntonioAugusto\Google Drive\Migrado Dropbox\Game Searcher - Shell\busca_jogos.py", line 510, in main print(getCotacao()) File "C:\Users\AntonioAugusto\Google Drive\Migrado Dropbox\Game Searcher - Shell\busca_jogos.py", line 40, in getCotacao soup = bs4.BeautifulSoup(page) File "C:\Python33\lib\site-packages\bs4\__init__.py", line 169, in __init__ self.builder.prepare_markup(markup, from_encoding)) File "C:\Python33\lib\site-packages\bs4\builder\_htmlparser.py", line 141, in prepare_markup dammit = UnicodeDammit(markup, try_encodings, is_html=True) File "C:\Python33\lib\site-packages\bs4\dammit.py", line 228, in __init__ self._detectEncoding(markup, is_html) File "C:\Python33\lib\site-packages\bs4\dammit.py", line 397, in _detectEncoding xml_encoding_match = xml_encoding_re.match(xml_data) TypeError: expected string or buffer Running Python 3.3.2 64 on Windows 8 Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AM D64)] on win32
2013-08-17 16:02:06 Leonard Richardson summary Print function on __init__.py not compatible with Python 3 SyntaxError is no longer helpful when running unconverted code on Python 3
2013-10-02 13:48:51 Leonard Richardson beautifulsoup: status New Fix Committed
2015-07-03 15:46:00 Leonard Richardson beautifulsoup: status Fix Committed Fix Released