Python OS symlink and .json.gz files
Question: I am creating a symlink with Python. First, I check if the file exists and
then create the symlink.

    
    
    import os
    project = 'test'
    
    if os.path.isfile("../../project/json/nodes1.json.gz"):
        os.symlink("../../project/json/nodes1.json.gz","../simulations/"+project+"/nodes1.json.gz")
    

However, when I ran a script that required this symlink, it failed. On
inspection with finder I get `The operation can’t be completed because the
original item for “nodes1.json.gz” can’t be found.`

I am sure I have the right paths and it is correctly setting the symlink. Is
there an issue with using `.gz` files?


Answer: Unless you specify the `dir_fd` argument to the
[`os.symlink()`](https://docs.python.org/3/library/os.html#os.symlink)
function, you need to specify the absolute path for both `src` and `dst`
argument.

