Zachary Ware added the comment:
As far as os.path.dirname is concerned, you have a file named 'ciao.pdf"' in a
directory called '"ciao/come/stai', which is what you're seeing. Since those
are legal names, there's no way for os.path.dirname to know what you actually
want. The solution is to han
New submission from Raffaele Mancuso:
Python 3.4.3 (default, Jun 29 2015, 12:16:01)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> dir = "\"ciao/come/stai/ciao.pdf\""
>>> dir
'"ciao/come/stai/ciao.pdf"'
>>>