[issue6972] zipfile.ZipFile overwrites files outside destination path

2012-04-07 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: I'll update my patch to work on the current 3.x head later tonight. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6972

Creating a very simple revision system for photos in python

2011-03-11 Thread Thomas W
I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are quite different. Has anybody done something like this or have any thoughts about

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Thomas W
On 11 Mar, 17:23, Tim Golden m...@timgolden.me.uk wrote: On 11/03/2011 16:05, Chris Hulan wrote: On Mar 11, 9:56 am, Thomas Wthomas.weh...@gmail.com  wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: It's just a test. Finishing the patch completely slipped my mind. I'll work on it later tonight. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8005

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: I'm still reasonably new to the codebase, but I'm certainly going to try to fix the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8005

[issue6972] zipfile.ZipFile overwrites files outside destination path

2009-10-01 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Even if we can't fix things for this release, presumably it's not too late to fix things for 2.7, right? Yes, there certainly are cases where you might want to have creative usage of symlinks and stored paths to allow overwriting existing files

[issue6972] zipfile.ZipFile overwrites files outside destination path

2009-09-29 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Uploading patch. This actually should fix my theoretical symlink bug since realpath() properly follows symlinks. The only thing that I haven't been able to test is the behavior of realpath() on case-insensitive operating systems. This should do

[issue7008] str.title() misbehaves with apostrophes

2009-09-28 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: If correct handling of apostrophe's and quotation marks, keeping the string length unchanged, and only changing desired letters from lower to uppercase with no other side-effects is the criterion we want, then what I suggested (toupper() the first

[issue6972] zipfile.ZipFile overwrites files outside destination path

2009-09-28 Thread Thomas W. Barr
Changes by Thomas W. Barr t...@rice.edu: -- nosy: +twb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6972 ___ ___ Python-bugs-list mailing list

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-31 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Patch uploaded to rietveld: http://codereview.appspot.com/96202/show -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6606

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: The Sniffer.sniff routine doesn't set the doublequote property at all right now. I'm working on a patch to see if I can add this functionality. -- nosy: +twb type: behavior - feature request ___ Python

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Test for this issue. -- keywords: +patch Added file: http://bugs.python.org/file14610/test_csv.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6606

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Patch for the issue. Looks for extraneous quote inside the quotes by the delimiters. -- Added file: http://bugs.python.org/file14611/csv.py.diff ___ Python tracker rep...@bugs.python.org http

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: The documentation doesn't actually say what parameters are sniffed, so technically, that doesn't need to be changed. Should this be added? -- ___ Python tracker rep...@bugs.python.org http

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Changes by Thomas W. Barr t...@rice.edu: Removed file: http://bugs.python.org/file14611/csv.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6606

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-30 Thread Thomas W. Barr
Thomas W. Barr t...@rice.edu added the comment: Reformatted line in patch. -- Added file: http://bugs.python.org/file14612/csv.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6606

Start multiple listening servers in one file

2009-01-16 Thread Thomas W
I`m working on a django-project where I`m using the awsome pyftpdlib for ftpserver-functionality. I also have a simple worker deamon running in the background, but not listening to any port. How can I start all of these processes on one file? Tried using subprocess and popen but that resulted in

pyxml package not working? No xml.dom.ext.reader module available after install.

2007-10-10 Thread Thomas W
I've tried to install the pyxml-package, available at http://pyxml.sourceforge.net/, both from source and using some hack on the win32-binary package available for python2.4, but without luck. After install the module xml.dom.ext.reader is not available, eventhough the folder, __init__py and

Re: pyxml package not working? No xml.dom.ext.reader module available after install.

2007-10-10 Thread Thomas W
On 10 Okt, 11:13, Stefan Behnel [EMAIL PROTECTED] wrote: Thomas W wrote: I've tried to install the pyxml-package, available athttp://pyxml.sourceforge.net/, both from source and using some hack on the win32-binary package available for python2.4, but without luck. After install

Virtual filesystem in python ( Fuse or WebDav ? )

2007-10-09 Thread Thomas W
I want to create a virtual filesystem based on a relational database. It might run as a server on a different machine, but it has to be available like a normal filesystem, either shared using SAMBA or windows filesharing or thru something else like WebDav. The idea is that I scan a local

Dynamic/runtime code introspection/compilation

2006-11-28 Thread Thomas W
Maybe a stupid subject, but this is what I want to do : I got some python code stored in a string: somecode = from somemodule import ISomeInterface class Foo(ISomeInterface): param1 = ... param2 = and I want to compile that code so that I can use the Foo-class and check what

Re: Dynamic/runtime code introspection/compilation

2006-11-28 Thread Thomas W
Great !!! That works like charm. Thanks alot. Thomas Leo Kislov wrote: Thomas W wrote: Maybe a stupid subject, but this is what I want to do : I got some python code stored in a string: somecode = from somemodule import ISomeInterface class Foo(ISomeInterface

Unicode/ascii encoding nightmare

2006-11-06 Thread Thomas W
I'm getting really annoyed with python in regards to unicode/ascii-encoding problems. The string below is the encoding of the norwegian word fødselsdag. s = 'f\xc3\x83\xc2\xb8dselsdag' I stored the string as fødselsdag but somewhere in my code it got translated into the mess above and I cannot

Re: Unicode/ascii encoding nightmare

2006-11-06 Thread Thomas W
pointed out. Anyway, thanks for all your replies. I think I can get this thing up and running with a bit more code tinkering. And I'll read up on some unicode-docs as well. :-) Thanks again. Thomas John Machin wrote: Thomas W wrote: I'm getting really annoyed with python in regards

Tutorial on setuptools

2006-10-24 Thread Thomas W
I'm might just be dumb, but I cannot get the hang of usting setuptools based on the docs at http://peak.telecommunity.com/DevCenter/setuptools. Is there a simple example available showing how to pack a few modules, a few scripts, some resources files ( images ) and list a few dependencies ? I've

The status of Python and SOAP?

2006-10-24 Thread Thomas W
I'm going to give a presentation of python to my co-workers at a very pro-microsoft workplace. Almost everything we need is currently supported by the standard distro + the win32all package, but we also need support for SOAP. I've tried SOAPpy ( didn't get it to compile, needed a library from a

Read Picasa metadata using Python?

2006-08-17 Thread Thomas W
I know this is slightly off-topic, but since Python is hot at Google and several key members from the python community works there, I was hoping to get some help on this subject. I want to create a small app that reads my Picasa-metadata related to a specified image and uploads my image and

Py2Exe and sys.argv : The Lost Arguments

2006-08-17 Thread Thomas W
I've created a simple script like so : import sys import wx app = wx.PySimpleApp() dlg = wx.MessageDialog(None, %s % sys.argv, 'A Message Box', wx.YES_NO | wx.ICON_QUESTION) retCode = dlg.ShowModal() app.MainLoop() If I run this on the command line like python testcmd.py path-to/somefile.ext

Find similar images using python

2006-03-29 Thread Thomas W
How can I use python to find images that looks quite similar? Thought I'd scale the images down to 32x32 and convert it to use a standard palette of 256 colors then compare the result pixel for pixel etc, but it seems as if this would take a very long time to do when processing lots of images.

Using gettext to provide different language-version of a script

2005-11-22 Thread Thomas W
I'm trying to wrap my head around the docs at python.org related to the gettext-module, but I'm having some problem getting it to work. Is there any really simple, step-by-step on how to use this module available? This is my script so far : import gettext gettext.install('test2', '.', unicode=1)

Writing Win32 shell extensions in python?

2005-11-08 Thread Thomas W
Well, is it possible to write Win32 shell extension in python? I want to create a virtual folder ( like gmailfs ) to serve files from a http-server ( and no, I cannot use webdav ) so that users can access them like normal files in Windows Explorer. Any hints or info about this would be highly

Py2Exe produced binary shows terminal screen on execution

2005-11-02 Thread Thomas W
I've produced a binary version of a python-script using Py2Exe and when run on WinXP it shows a terminal window for a brief moment then the window disappears. How can I avoid this? I want the script to run without being visible at all. Thanks in advance, Thomas --

Construct raw strings?

2005-09-07 Thread Thomas W
I got a stupid problem; on my WinXP-box I want to scan the filesystem and enter a path to scan like this : path_to_scan = 'd:\test_images' This is used in a larger context and joined like real_path_after_scanning = os.path.join(path_to_scan, somepart, 'foo', 'bar', filename) Using

WSGI-server in the standard distro?

2005-08-07 Thread Thomas W
Will there be a WSGI-server like BaseHTTPServer etc in the standard distro? I think that would increase the adoptation of the WSGI-standard. A new web-framework for python pops up every other week and more and more support WSGI. Why not focus on getting an optimized, production-grade fully

cx_freeze error : LookupError: no codec search functions registered: can't find encoding

2005-06-09 Thread Thomas W
I get this error when I try to run a freezed exe on my ubuntu 5.04 running Python 2.4 : LookupError: no codec search functions registered: can't find encoding I've tried to use --include-modules encodings,codecs when freezing without luck. Any hints? Regards, Thomas --

Re: cx_freeze error : LookupError: no codec search functions registered:can't find encoding

2005-06-09 Thread Thomas W
Ok, I'll post my findings here since there are allready several questions about this topic on the net allready : The solution was to do an explicit import in my module, like so : from encodings import ascii from encodings import idna This solved the problem, at least in my case. Regards,

NSLU2 and python - a love story ?

2005-06-01 Thread Thomas W
Has anybody done any work using Python on the Linksys NSLU2[1][2]? I'm especially interested in stuff related to compiling additional modules, like PIL. There are allready a bunch of stuff available in the current replacement-firmware, but PIL seems to be missing. If you haven't heard about the

Monitoring a USB-drive / Card-reader using python?

2005-06-01 Thread Thomas W
I want to monitor a given USB-device, like a Memory Card-reader, and when a memory card is inserted I want to move the data on the card to a different location on the filesystem ( or do something else with the files). Does anybody know how to do this ( on Linux and/or windows ) or if it's even

Re: NSLU2 and python - a love story ?

2005-06-01 Thread Thomas W
Well, AFAIK people are running web-sites using apache, php and mysql on it and with ok performance. I'm not saying this would replace a real server, but for normal home-use with not too much traffic it seems to do the job. It's a fact that Linksys uses a somewhat modified version of linux on the

Parsing text into dates?

2005-05-16 Thread Thomas W
I'm developing a web-application where the user sometimes has to enter dates in plain text, allthough a format may be provided to give clues. On the server side this piece of text has to be parsed into a datetime python-object. Does anybody have any pointers on this? Besides the actual parsing,

Speed of the different python-based HTTP-servers

2005-05-12 Thread Thomas W
I'm thinking of switching from my Twisted-HTTP-server-project to CherryPy or Snakelets etc etc. The project involves alot of database-access using SQLObject and SQLite ( perhaps MySQL and PostgreSQL in the future ) and some heavy IO-stuff ( scanning of local filesystem to extract meta information

Serving binary data from a cgi-script

2005-05-11 Thread Thomas W
Hi, I'm having some problems serving binary data in a simple CGI-script. I'm setting content-type ( application/octet-stream ), content-length and Content-disposition and I think these are correct, but the size of the served file/data is different than the source. The read and write the data I'm

Downloading all files older than 3 hours from a ftp-server.

2005-03-15 Thread Thomas W
I need to download all files older than 3 hours from a ftp-server. What's the easiest way to this? I've looked into the standard ftplib, but it seems like the only way to go is to parse the ftp.retrlines('LIST') command and that seems to be very easy to mess up. any hints? Best regards, Thomas