Sublime Forum

Printing an endless nightmare

#1

Occasionally when using a computer (especially development) you get yourself into a nightmare situation through no fault of your own. I call it ‘down the rabbit hole’. It’s where you want to do something simple but it turns out to be far more complicated than you think… not a problem. However even the complicated solution has three weird issues that all seem simple on the surface but turn out also to be complicated. So you end up spending several hours or days sorting out something that should be extremely simple.

OK, so this is about printing in Sublime. I downloaded a plugin called ‘Print as HTML’. It had worked the first time I used it. However today it miraculously does nothing. I therefore investigate only for there to be these errors:

Guessed lexer from ST2 syntax setting: <pygments.lexers.PhpLexer> Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 550, in run_ return self.run(edit, **args) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/PrintToHTML.py", line 75, in run css, texts = convert_to_html(filename, texts, syntax, encoding, options, style) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/PrintToHTML.py", line 229, in convert_to_html html = pygments.highlight(text[1], lexer, formatter) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/__init__.py", line 86, in highlight return format(lex(code, lexer), formatter, outfile) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/__init__.py", line 66, in format formatter.format(tokens, realoutfile) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/formatter.py", line 91, in format outfile = codecs.lookup(self.encoding)[3](outfile) LookupError: unknown encoding: UTF-8 with BOM reloading /Users/USERNAME/Sites/property_harvester_new/Harvester/harvest_photo_from_website.php Guessed lexer from ST2 syntax setting: <pygments.lexers.PhpLexer> Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 550, in run_ return self.run(edit, **args) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/PrintToHTML.py", line 75, in run css, texts = convert_to_html(filename, texts, syntax, encoding, options, style) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/PrintToHTML.py", line 229, in convert_to_html html = pygments.highlight(text[1], lexer, formatter) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/__init__.py", line 86, in highlight return format(lex(code, lexer), formatter, outfile) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/__init__.py", line 66, in format formatter.format(tokens, realoutfile) File "/Users/USERNAME/Library/Application Support/Sublime Text 3/Packages/Print to HTML/pygments/formatter.py", line 91, in format outfile = codecs.lookup(self.encoding)[3](outfile) LookupError: unknown encoding: UTF-8 with BOM reloading /Users/USERNAME/Sites/property_harvester_new/Harvester/harvest_photo_from_website.php reloading Packages/User/Package Control.sublime-settings error: Package Control

I try reloading my file as UTF-8 and other character encodings. The same problem remains. OK so again, fair enough this is a third party solution (to something that should be easy… printing from a text editor… OK fair enough Sublime design team decided not to implement this). So I give up trying to fix this plugin.

I then load another plugin called Simple Print Function. Now I get an error dialog about XCode. I mean wow. All I wanted to do was print. I should be thankful for Sublime Editor and the attempt of the designers at designing the plugins, however I instead feel awful… as I’m ‘down the rabbit hole’.

OK so not really technical support so I’ve been naughty posting here. However I’m feeling really frustrated that something ‘easy’ has turned into an absolute nightmare. Screenshot it is then :frowning: Has anyone else ever experienced these nightmare moments and how do you get past them? Do you give up or do you keep hunting for a solution wasting many hours? Or do you try and do the ethical thing and go through the pain of reporting a bug report that may never be fixed… a bug report that always feels like criticism even when you’re spending your precious time doing the ethical thing to report a bug. I really hate these moments. Usually I do submit bug reports. Today however I’m feeling at a low… that technological low where you wish transistors and the silicon chip had never been invented because they often cause more hassle than anything else. I feel they cause more stress than the stress they allegedly cure.

0 Likes