Bug report #17106

Updated by Richard Duivenvoorde over 6 years ago

Seen in both 2.14 and master 2.1

Open Python Console (in Plugins menu)
Click 'Show Editor' button (little notepad icon)
In the editor widget, above the Untitled-0 tab there is a Save As button (floppy with pencil), which IS enabled, while the Save-button is NOT
Clicking that SaveAs button throws the following exception:

In Master

<pre>

TypeError: join() argument must be str or bytes, not 'QDir'
Traceback (most recent call last):
File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/console/console.py", line 633, in saveAsScriptFile
pathFileName = os.path.join(folder, fileName)
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'QDir'

</pre>

In 2.14

<pre> &lt;ore&gt;
AttributeError: 'QDir' object has no attribute 'endswith'
Traceback (most recent call last):
File "/home/richard/bin/qgis_all/2.14/debug/share/qgis/python/console/console.py", line 668, in saveAsScriptFile
pathFileName = os.path.join(folder, fileName)
File "/usr/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'QDir' object has no attribute 'endswith'

Python version: 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]
QGIS version: 2.14.16-Essen Essen, 7bc1bc4119
</pre>

In 2.14 it is NOT always, so it is apparently depending on some kind of 'starting' directory or so?
2.18 seems to work
Master always throws Exception with me here.

Back