Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Golden Newsgroups: comp.lang.python Subject: Re: creating zipfile with symlinks Date: Fri, 4 Mar 2016 11:12:04 +0000 Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de uVunJUoUowvm4bw9fc78Aw1QFFjyisrmsG8Gqpv2NJ2Q== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'expected.': 0.09; 'targets': 0.09; 'themselves,': 0.09; 'python': 0.10; '"zipfile"': 0.16; 'cleaner': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'googling': 0.16; 'message- id:@timgolden.me.uk': 0.16; 'module:': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'tjg': 0.16; 'zipfile': 0.16; 'wrote:': 0.16; 'creates': 0.18; 'solution.': 0.18; 'windows': 0.20; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'opposed': 0.27; 'larry': 0.29; 'anyone': 0.32; 'url:python': 0.33; 'surprised': 0.33; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'wanted': 0.37; 'files': 0.38; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'url:3': 0.60; 'charset:windows-1252': 0.62; 'from:addr:mail': 0.70; 'url:11': 0.72; 'url:wordpress': 0.79; 'url:23': 0.93 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104027 On 04/03/2016 11:03, crankypuss wrote: > Larry Martell wrote: > >> I have a script that creates zip files of dirs containing symlinks. I >> was surprised to find that the zipfiles have zipped the targets of the >> links as opposed to the links themselves, which is what I wanted and >> expected. Googling I found this: >> >> https://doeidoei.wordpress.com/2010/11/23/compressing-files-with-python-symlink-trouble/ >> >> Which I don't love as a solution. Anyone know a cleaner way to get >> zipfile to zip the links? > > I don't even know what "zipfile" is, is that a Windows command? It's a Python module: https://docs.python.org/3.5/library/zipfile.html TJG