Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
The close method is defined and flushing and closing a file, so it should not return until that's done. What command are you using to create the temp file? re command to write the file: f=open(fn,'w') ... then create HTML text in a string f.write(html) f.close --

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
I would consider the chance that the disk may be faulty, or the file system is corrupt. Does the problem go away if you write to a different file system or a different disk? It's a relatively new MacBook Pro with a solid state disk. I've not noticed any other disk problems. I did a

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
Or that the filesystem may be full? Of course, that's usually obvious more widely when it happens... Question: is the size of the incomplete file a round number? (Like a multiple of a decent sized power of 2) Also on what OS X file system type does the file being

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
The file system is Mac OS Extended Journaled (default as out of the box). I ran a repair disk .. .while it found and fixed what it called minor problems, it did something. However, the repair did not fix the problem. I just ran the program again and the source is 47,970 bytes and target

Re: Message passing syntax for objects | OOPv2

2013-04-12 Thread Chris Angelico
On Fri, Apr 12, 2013 at 11:57 AM, Mark Janssen dreamingforw...@gmail.com wrote: Further, I will admit that I am not deeply experienced in application or Internet programming Would you listen to someone who is, by his own admission, not experienced as a surgeon, and tries to tell you that your

Re: USBLock : lock/unlock your computer with a USB key

2013-04-12 Thread Ian Kelly
On Thu, Apr 11, 2013 at 9:23 AM, Ethan Furman et...@stoneleaf.us wrote: On 04/11/2013 04:13 AM, Sven wrote: Yes, I had the idea to add bluetooth too, removes the whole plugging and unplugging spiel. I might start work on that, and if anyone else wants to dive in and help, feel free. I will

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Chris Angelico
On Fri, Apr 12, 2013 at 4:25 PM, Rob Schneider rmsc...@gmail.com wrote: The close method is defined and flushing and closing a file, so it should not return until that's done. What command are you using to create the temp file? re command to write the file: f=open(fn,'w') ... then

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Ned Deily
In article 6eeabeb2-e6dd-49fc-bd64-8de539651...@googlegroups.com, Rob Schneider rmsc...@gmail.com wrote: The file system is Mac OS Extended Journaled (default as out of the box). It shows file size 45,056 on both source and target, which is the file size of the flawed target, and is not what

Re: name lookup failure using metaclasses with unittests

2013-04-12 Thread Ulrich Eckhardt
Am 11.04.2013 10:19, schrieb Steven D'Aprano: if sys.version = '3': Use sys.version_info = (3,), otherwise your code breaks when upgrading to Python 10 and greater. ;^) The second question that came up was if there is a way to keep a metaclass defined inside the class or if the only way

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Cameron Simpson
On 11Apr2013 23:32, Rob Schneider rmsc...@gmail.com wrote: | Question: is the size of the incomplete file a round number? (Like | a multiple of a decent sized power of 2) [...] | Source (correct one) is 47,970 bytes. Target after copy of 45,056 | bytes. I've tried changing what gets written

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
On Friday, 12 April 2013 09:26:21 UTC+1, Cameron Simpson wrote: | Question: is the size of the incomplete file a round number? (Like | a multiple of a decent sized power of 2) [...] | Source (correct one) is 47,970 bytes. Target after copy of 45,056 | bytes. I've tried

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Chris Angelico
On Fri, Apr 12, 2013 at 7:18 PM, Rob Schneider rmsc...@gmail.com wrote: f.close Yep, there's the problem! See my previous post for details. Change this to: f.close() and you should be sorted. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Message passing syntax for objects | OOPv2

2013-04-12 Thread Mark Lawrence
On 12/04/2013 02:57, Mark Janssen wrote: [dross snipped] A summary here http://pinterest.com/pin/464293042804330899/ -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence -- http://mail.python.org/mailman/listinfo/python-list

Re: USBLock : lock/unlock your computer with a USB key

2013-04-12 Thread Dylan Evans
On Fri, Apr 12, 2013 at 6:16 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Apr 11, 2013 at 9:23 AM, Ethan Furman et...@stoneleaf.us wrote: On 04/11/2013 04:13 AM, Sven wrote: Yes, I had the idea to add bluetooth too, removes the whole plugging and unplugging spiel. I might start

Re: Message passing syntax for objects | OOPv2

2013-04-12 Thread Ned Batchelder
On 4/11/2013 9:57 PM, Mark Janssen wrote: Okay peeps, I'm re-opening this thread, because despite being hijacked by naysayers, the merit of the underlying idea I think still has not been communicated or perceived adequately. Mark, this proposal is out of place on a Python list, because it

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Rob Schneider
On Friday, 12 April 2013 10:22:21 UTC+1, Chris Angelico wrote: On Fri, Apr 12, 2013 at 7:18 PM, Rob Schneider rmsc...@gmail.com wrote: f.close Yep, there's the problem! See my previous post for details. Change this to: f.close() and you should be sorted. ChrisA

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Mark Lawrence
On 12/04/2013 13:07, Rob Schneider wrote: On Friday, 12 April 2013 10:22:21 UTC+1, Chris Angelico wrote: On Fri, Apr 12, 2013 at 7:18 PM, Rob Schneider rmsc...@gmail.com wrote: f.close Yep, there's the problem! See my previous post for details. Change this to: f.close() and you should

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Someone HEELP ME!! -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode issue with Python v3.3

2013-04-12 Thread Chris Angelico
On Fri, Apr 12, 2013 at 10:50 PM, nagia.rets...@gmail.com wrote: Someone HEELP ME!! http://youtu.be/VxMYwjp8t0o ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Fri, Apr 12, 2013 at 10:50 PM, nagia.rets...@gmail.com wrote: Someone HEELP ME!! http://youtu.be/VxMYwjp8t0o ChrisA Well, instead of being a smartass it would be nice if

Re: Unicode issue with Python v3.3

2013-04-12 Thread Chris Angelico
On Fri, Apr 12, 2013 at 11:18 PM, nagia.rets...@gmail.com wrote: Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Fri, Apr 12, 2013 at 10:50 PM, nagia.rets...@gmail.com wrote: Someone HEELP ME!! http://youtu.be/VxMYwjp8t0o ChrisA

Re: Unicode issue with Python v3.3

2013-04-12 Thread rusi
On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote: Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Fri, Apr 12, 2013 at 10:50 PM,  nagia.rets...@gmail.com wrote: Someone HEELP ME!! http://youtu.be/VxMYwjp8t0o ChrisA Well,

Re: USBLock : lock/unlock your computer with a USB key

2013-04-12 Thread Schneider
On 11.04.2013 22:16, Ian Kelly wrote: On Thu, Apr 11, 2013 at 9:23 AM, Ethan Furman et...@stoneleaf.us wrote: On 04/11/2013 04:13 AM, Sven wrote: Yes, I had the idea to add bluetooth too, removes the whole plugging and unplugging spiel. I might start work on that, and if anyone else wants to

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread someone
On 2013-04-11 19:58, Cousin Stanley wrote: someone wrote: I want to put this table into an appropriate container such that afterwards I want to: 1) Put the data into a mySql-table You might consider using sqlite3 as a database manager since it is batteries included with

Re: Functional vs. Object oriented API

2013-04-12 Thread Roy Smith
In article 51678b94$0$29977$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: - If you have a complicated interface, or data with complicated internal state, the best solution is to use a custom object with methods. - But if your interface is

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread someone
On 2013-04-11 20:44, Cousin Stanley wrote: Cousin Stanley wrote: The stand-alone sqlite interpreter can first be used to create an empty database named some.sql3 and create a table named xdata in that data base sqlite3 some.sql3 '.read xdata_create.sql' This step can

CSV to matrix array

2013-04-12 Thread Ana Dionísio
Hello! I have a CSV file with 20 rows and 12 columns and I need to store it as a matrix. I already created an array with zeros, but I don't know how to fill it with the data from the csv file. I have this script: import numpy from numpy import array from array import * import csv input =

Re: Functional vs. Object oriented API

2013-04-12 Thread Mitya Sirenef
On 04/12/2013 10:19 AM, Roy Smith wrote: As part of our initial interview screen, we give applicants some small coding problems to do. One of the things we see a lot is what you could call Java code smell. This is our clue that the person is really a Java hacker at heart who just dabbles in

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 4:29:51 μ.μ. UTC+3, ο χρήστης rusi έγραψε: On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote: Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Fri, Apr 12, 2013 at 10:50 PM,  nagia.rets...@gmail.com wrote:

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Roy Smith
In article mailman.506.1365751267.3114.python-l...@python.org, Rob Schneider rmsc...@gmail.com wrote: Source (correct one) is 47,970 bytes. Target after copy of 45,056 bytes. I've tried changing what gets written to change the file size. It is usually this sort of difference. The file

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 3:32 AM, Chris Angelico wrote: On Fri, Apr 12, 2013 at 4:25 PM, Rob Schneider rmsc...@gmail.com wrote: The close method is defined and flushing and closing a file, so it should not return until that's done. What command are you using to create the temp file? re command to

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Roy Smith
In article mailman.510.1365755188.3114.python-l...@python.org, Cameron Simpson c...@zip.com.au wrote: 45046 is exactly 11 * 4096. I'd say your I/O is using 4KB blocks, and the last partial block (to make it up to 47970) didn't get written (at the OS level). Yeah, this sounds like a good

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Roy Smith
In article 51674ffc$0$29977$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 11 Apr 2013 19:55:53 +, Neil Cerutti wrote: On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: Thanks. Yes, there is a close function call before the

Re: name lookup failure using metaclasses with unittests

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 3:17 AM, Ulrich Eckhardt wrote: Am 11.04.2013 10:19, schrieb Steven D'Aprano: if sys.version = '3': Use sys.version_info = (3,), otherwise your code breaks when upgrading to Python 10 and greater. ;^) The second question that came up was if there is a way to keep a metaclass

ANN: psutil 0.7.0 released

2013-04-12 Thread Giampaolo Rodolà
Hi there folks, I'm pleased to announce the 0.7.0 release of psutil: http://code.google.com/p/psutil/ This is mainly a bugfix release addressing a couple of high priority issues on Linux and FreeBSD. Complete list of bugfixes and enhancements is here: https://psutil.googlecode.com/hg/HISTORY ===

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Roy Smith
In article mailman.511.1365758300.3114.python-l...@python.org, Rob Schneider rmsc...@gmail.com wrote: f.close Well, there's your problem. You're not calling close. You forgot the ()'s after the function name! -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV to matrix array

2013-04-12 Thread Mark Lawrence
On 12/04/2013 15:22, Ana Dionísio wrote: Hello! I have a CSV file with 20 rows and 12 columns and I need to store it as a matrix. I already created an array with zeros, but I don't know how to fill it with the data from the csv file. I have this script: import numpy from numpy import array

Re: ANN: psutil 0.7.0 released

2013-04-12 Thread Roy Smith
In article mailman.525.1365778885.3114.python-l...@python.org, Giampaolo Rodolà g.rod...@gmail.com wrote: Hi there folks, I'm pleased to announce the 0.7.0 release of psutil: http://code.google.com/p/psutil/ I see a lot of these types of announcements. May I suggest that people add a short

Re: Functional vs. Object oriented API

2013-04-12 Thread David M Chess
Roy Smith r...@panix.com As part of our initial interview screen, we give applicants some small coding problems to do. One of the things we see a lot is what you could call Java code smell. This is our clue that the person is really a Java hacker at heart who just dabbles in Python

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread 88888 Dihedral
Steven D'Aprano於 2013年4月12日星期五UTC+8上午8時06分21秒寫道: On Thu, 11 Apr 2013 19:55:53 +, Neil Cerutti wrote: On 2013-04-11, Rob Schneider rmsc...@gmail.com wrote: Thanks. Yes, there is a close function call before the copy is launched. No other writes. Does Python wait for file close

Re: ANN: psutil 0.7.0 released

2013-04-12 Thread Stefan Behnel
Roy Smith, 12.04.2013 17:33: Giampaolo Rodol� wrote: Hi there folks, I'm pleased to announce the 0.7.0 release of psutil: http://code.google.com/p/psutil/ I see a lot of these types of announcements. May I suggest that people add a short description of what that package is. From the

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread Cousin Stanley
someone wrote: As you can see, on my system I had to use: print row[0] , row[1] instead of: print row[ 'xtime' ] , row[ 'col4' ] I'm not sure exactly why The magic there is setting up the row_factory after the database connection dbc = DBM.connect( 'some.sql3' )

Re: CSV to matrix array

2013-04-12 Thread Ana Dionísio
Hi, thanks for yor answer! ;) Anyone has more suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV to matrix array

2013-04-12 Thread Jean-Michel Pichavant
- Original Message - Hello! I have a CSV file with 20 rows and 12 columns and I need to store it as a matrix. I already created an array with zeros, but I don't know how to fill it with the data from the csv file. I have this script: import numpy from numpy import array from

Re: CSV to matrix array

2013-04-12 Thread Ana Dionísio
That only puts the data in one column, I wanted to separate it. For example: data in csv file: 1 2 3 4 5 7 8 9 10 11 a b c d e I wanted an array where I could pick an element in each position. In the case above if I did print array[0][3] it would pick 4 --

Re: CSV to matrix array

2013-04-12 Thread rusi
On Apr 12, 10:12 pm, Ana Dionísio anadionisio...@gmail.com wrote: Hi, thanks for yor answer! ;) Anyone has more suggestions? My suggestions: 1. Tell us what was lacking in Mark's suggestion (to use loadtxt) 2. Read his postscript (for googlegroup posters). [In case you did not notice your

Re: CSV to matrix array

2013-04-12 Thread Dave Angel
On 04/12/2013 01:29 PM, Ana Dionísio wrote: That only puts the data in one column, I wanted to separate it. For example: data in csv file: 1 2 3 4 5 7 8 9 10 11 a b c d e I wanted an array where I could pick an element in each position. In the case above if I did print array[0][3] it would

Re: Unicode issue with Python v3.3

2013-04-12 Thread Ian Kelly
On Fri, Apr 12, 2013 at 8:36 AM, nagia.rets...@gmail.com wrote: Τη Παρασκευή, 12 Απριλίου 2013 4:29:51 μ.μ. UTC+3, ο χρήστης rusi έγραψε: On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote: Well, instead of being a smartass it would be nice if you could actually help for once.

Re: Unicode issue with Python v3.3

2013-04-12 Thread Roy Smith
In article mailman.533.1365792239.3114.python-l...@python.org, Ian Kelly ian.g.ke...@gmail.com wrote: I would also recommend that in the future you should stop deploying untested code to your production website. Set up a development environment for yourself, make the changes there, and only

Re: im.py: a python communications tool

2013-04-12 Thread Mark Janssen
On Fri, Apr 12, 2013 at 12:46 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Mark Janssen wrote: But you see, there's the critical difference. First of all you're making two errors in your comparison. Firstly, a *person* is saying that she's going to *do something for you*. She's making

Re: im.py: a python communications tool

2013-04-12 Thread Neil Cerutti
On 2013-04-12, Mark Janssen dreamingforw...@gmail.com wrote: Possibily, but don't accept this view of the legal system. Judges can be quite reasonable. They don't want more time taken for bullshit cases and would much prefer for things to be settled (that is what their duty is -- to settle

RE: im.py: a python communications tool

2013-04-12 Thread Prasad, Ramit
Mark Janssen wrote: It doesn't have to say so, if it's not charging any money -- there's no expectation that you're getting anything at all! Of course there is. If Oprah Winfrey stands up and publicly says that she's giving you a car, FOR FREE, no strings attached, and then gives you a

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 9:37:29 μ.μ. UTC+3, ο χρήστης Ian έγραψε: On Fri, Apr 12, 2013 at 8:36 AM, nagia.rets...@gmail.com wrote: Τη Παρασκευή, 12 Απριλίου 2013 4:29:51 μ.μ. UTC+3, ο χρήστης rusi έγραψε: On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote: Well, instead of

SimpleHTTPRequestHandler used with HTTP/1.1 hangs after the second resource on a page.

2013-04-12 Thread Piotr Dobrogost
Hi! I'd like to bring your attention to the question titled Use HTTP/1.1 with SimpleHTTPRequestHandler at http://stackoverflow.com/q/15839718/95735 which reads; When I use HTTP/1.1 with SimpleHTTPRequestHandler, loading a page that pulls in other resources will hang after the second resource.

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread someone
On 04/12/2013 06:58 PM, Cousin Stanley wrote: someone wrote: As you can see, on my system I had to use: print row[0] , row[1] instead of: print row[ 'xtime' ] , row[ 'col4' ] I'm not sure exactly why The magic there is setting up the row_factory after the database connection

RE: newbie question about confusing exception handling in urllib

2013-04-12 Thread Prasad, Ramit
Steven D'Aprano wrote: try: main() except Exception as err: log(err) print(Sorry, an unexpected error has occurred.) print(Please contact support for assistance.) sys.exit(-1) I like the traceback[0] module for logging last exception thrown. See

RE: extract HTML table in a structured format

2013-04-12 Thread Prasad, Ramit
Jabba Laci Hi, I wonder if there is a nice way to extract a whole HTML table and have the result in a nice structured format. What I want is to have the lifetime table at the bottom of this page: http://en.wikipedia.org/wiki/List_of_Ubuntu_releases (then figure out with a script until

RE: im.py: a python communications tool

2013-04-12 Thread Prasad, Ramit
Neil Cerutti wrote: On 2013-04-12, Mark Janssen dreamingforw...@gmail.com wrote: Possibily, but don't accept this view of the legal system. Judges can be quite reasonable. They don't want more time taken for bullshit cases and would much prefer for things to be settled (that is what

Re: SimpleHTTPRequestHandler used with HTTP/1.1 hangs after the second resource on a page.

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 4:46 PM, Piotr Dobrogost wrote: Hi! I'd like to bring your attention to the question titled Use HTTP/1.1 with SimpleHTTPRequestHandler at http://stackoverflow.com/q/15839718/95735 which reads; When I use I find the doc slightly confusing. The SO code uses BaseHTTPServer. The doc

Re: CSV to matrix array

2013-04-12 Thread Javier Miranda
Keep the flattened data array others suggested, and then just split it like this: *(replace `example_data`, `_array`, and `columns`)* example_data = range(15) split_array = lambda _array, colums: \ . . .[_array[i:i + colums] for i in \ . . .xrange(0, len(_array),

Re: CSV to matrix array

2013-04-12 Thread Miki Tebeka
I have a CSV file with 20 rows and 12 columns and I need to store it as a matrix. If you can use pandas, the pandas.read_csv is what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread Cousin Stanley
someone wrote: So SQLite is very good for practicing Yes it is but it is also very good for much more than just practice Check the wikipedia info http://en.wikipedia.org/wiki/Sqlite It is arguably the most widely deployed database engine, as it is

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread someone
On 04/13/2013 01:26 AM, Cousin Stanley wrote: someone wrote: So SQLite is very good for practicing Yes it is but it is also very good for much more than just practice Check the wikipedia info http://en.wikipedia.org/wiki/Sqlite Very interesting...

Re: Unicode issue with Python v3.3

2013-04-12 Thread Cameron Simpson
On 11Apr2013 09:55, Nikos nagia.rets...@gmail.com wrote: | Τη Πέμπτη, 11 Απριλίου 2013 1:45:22 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: | On 10Apr2013 21:50, nagia.rets...@gmail.com nagia.rets...@gmail.com wrote: | | the doctype is coming form the attempt of script metrites.py to open and

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-12 Thread Steven D'Aprano
On Fri, 12 Apr 2013 23:26:05 +, Cousin Stanley wrote: The firefox browser keeps different sqlite database files for various uses Yes, and I *really* wish they wouldn't. It's my number 1 cause of major problems with Firefox. E.g.

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Nobody
On Fri, 12 Apr 2013 00:06:21 +, Steven D'Aprano wrote: The close method is defined and flushing and closing a file, so it should not return until that's done. But note that done in this case means the file system thinks it is done, not *actually* done. Hard drives, especially the

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Chris Angelico
On Sat, Apr 13, 2013 at 12:33 PM, Nobody nob...@nowhere.com wrote: But most of the time, there's no point. If you actually care about what happens in the event of an unclean shutdown, you typically also need to sync the directory, otherwise the file's contents will get sync'd but the file's

[OT] Lying hard drives [was Re: shutil.copyfile is incomplete (truncated)]

2013-04-12 Thread Steven D'Aprano
On Sat, 13 Apr 2013 03:33:29 +0100, Nobody wrote: On Fri, 12 Apr 2013 00:06:21 +, Steven D'Aprano wrote: The close method is defined and flushing and closing a file, so it should not return until that's done. But note that done in this case means the file system thinks it is done,

Re: [OT] Lying hard drives [was Re: shutil.copyfile is incomplete (truncated)]

2013-04-12 Thread Chris Angelico
On Sat, Apr 13, 2013 at 1:17 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 13 Apr 2013 03:33:29 +0100, Nobody wrote: If you want to wait for the data written to be written to the physical disk (in order to obtain specific behaviour with respect to an unclean

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Σάββατο, 13 Απριλίου 2013 4:41:57 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: On 11Apr2013 09:55, Nikos nagia.rets...@gmail.com wrote: | Τη Πέμπτη, 11 Απριλίου 2013 1:45:22 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: | On 10Apr2013 21:50, nagia.rets...@gmail.com

Re: Functional vs. Object oriented API

2013-04-12 Thread 88888 Dihedral
David M Chess於 2013年4月12日星期五UTC+8下午11時37分28秒寫道: Roy Smith r...@panix.com As part of our initial interview screen, we give applicants some small coding problems to do.  One of the things we see a lot is what you could call Java code smell.  This is our clue that the person

[issue4630] IDLE: add cursor noblink option

2013-04-12 Thread Roger Serwy
Roger Serwy added the comment: Attached is an updated version of the patch against the latest 2.7 code. -- nosy: +roger.serwy Added file: http://bugs.python.org/file29787/issue4630_refreshed.patch ___ Python tracker rep...@bugs.python.org

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-12 Thread R. David Murray
R. David Murray added the comment: Well, it is not that it is converting it in the exception, it is that it is converting it in order to do the lookup. It is an interesting question whether or not its value in the exception should be considered a bug. -- nosy: +r.david.murray

[issue13405] Add DTrace probes

2013-04-12 Thread Tadas Barzdžius
Changes by Tadas Barzdžius ret...@gmail.com: -- nosy: +Tadas.Barzdžius ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-12 Thread STINNER Victor
STINNER Victor added the comment: It is an interesting question whether or not its value in the exception should be considered a bug. I consider it as a bug because it is very surprising to have a different key on the error. Attached patch fixes the issue. -- keywords: +patch

[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-12 Thread Federico Schwindt
Federico Schwindt added the comment: Here's a slightly modified version of the patch that should work with python 2 and 3. -- Added file: http://bugs.python.org/file29789/openbsd-kqueue-001.patch ___ Python tracker rep...@bugs.python.org

[issue1298835] Add a vendor-packages directory for system-supplied modules

2013-04-12 Thread Bohuslav Slavek Kabrda
Bohuslav Slavek Kabrda added the comment: I'm strongly +1 on this one. I package Python RPMs for Fedora and I know what mess can come out of installing through both RPM and easy_install/pip. In Fedora, both Perl and Ruby use vendor specific dirs for installing RPM packaged modules and site

[issue900112] cgi.fieldStorage doesn't grok standards env. variables

2013-04-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree with Sentil -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue900112 ___ ___ Python-bugs-list mailing list

[issue16853] add a Selector to the select module

2013-04-12 Thread Charles-François Natali
Charles-François Natali added the comment: If this goes inside the select module, it could probably help issue #17552 (add socket.sendfile()) a bit. Yes, that's exactly the idea. See also the attached patches for telnetlib and multiprocessing (there would probably be other candidates like

[issue17692] Fix test discovery for test_sqlite.py

2013-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 71c4234eb39f by Ezio Melotti in branch '3.3': #17692: test_sqlite now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/71c4234eb39f New changeset 4c73d4785829 by Ezio Melotti in branch 'default': #17692:

[issue17692] Fix test discovery for test_sqlite.py

2013-04-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: - ezio.melotti resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17692

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-12 Thread R. David Murray
R. David Murray added the comment: Sounds fine to me. Is there a reason you are not using 'with assertRaises' in the test? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17702 ___

[issue17688] Wrong signature for richcmpfunc in documentation

2013-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset a263d40d1724 by Andrew Svetlov in branch '3.3': #17688: fix declaration for richcmp example in the docs. http://hg.python.org/cpython/rev/a263d40d1724 New changeset 4c996682d086 by Andrew Svetlov in branch 'default': #17688: fix declaration for

[issue17688] Wrong signature for richcmpfunc in documentation

2013-04-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed. Thanks. -- nosy: +asvetlov resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17688

[issue6696] Profile objects should be documented

2013-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset cd785c9d26c2 by Ezio Melotti in branch '3.3': #6696: add documentation for the Profile objects, and improve profile/cProfile docs. Patch by Tom Pinckney. http://hg.python.org/cpython/rev/cd785c9d26c2 New changeset 81dabc1feb52 by Ezio Melotti in

[issue6696] Profile objects should be documented

2013-04-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: eric.araujo - ezio.melotti resolution: - fixed stage: commit review - committed/rejected status: open - closed type: behavior - enhancement ___ Python tracker

[issue6696] Profile objects should be documented

2013-04-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Cool! Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6696 ___ ___ Python-bugs-list mailing list

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-12 Thread STINNER Victor
STINNER Victor added the comment: Is there a reason you are not using 'with assertRaises' in the test? The test is not testing the exception class, but the first argument of the exception. How do you test that using assertRaises()? Especially to check err.args[0] is missing. --

[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-12 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: A user reported a segfault when using our mxURL extension with Python 2.7.4. Previous Python versions do not show this behavior, so it's new in Python 2.7.4. The extension uses an Py_AtExit() function to clean up among other things a reference to a

[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: After a closer look at recent checkins, I found this checking for the trash can mechanism: 5a2ef447b80d (ticket #13992). This appears to be the cause: 1.20 #define Py_TRASHCAN_SAFE_BEGIN(op) \ 1.21 -if (_PyTrash_delete_nesting

[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I think a solution to the problem would be to check _tstate for NULL and only use it if it is non-NULL - without threads you don't need to keep track of them ;-) -- ___ Python tracker rep...@bugs.python.org

[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: At the time the Py_AtExit functions are called, the thread state is NULL I'd say this is the root cause. It's a bad thing to call Py_DECREF without a thread state. Was it the case in previous versions? -- nosy: +amaury.forgeotdarc

[issue16658] Missing return in HTTPConnection.send()

2013-04-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: Andrew - Please go ahead with commit. I reviewed the patch and it looks good to me as well. It is a bug so it should be backported. Thanks for the patch and a good test, Jeff Knupp. Agree with your reasoning / lack of documentation on send behavior w.r.t to

[issue900112] cgi.fieldStorage doesn't grok standards env. variables

2013-04-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: I am closing this as an Invalid issue. Please bring to discussion at python-dev if someone disagrees. Thank you! -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org

[issue17673] add `copy_from` argument to temporaryfile

2013-04-12 Thread Kyle Roberts
Kyle Roberts added the comment: I'm working on a patch for this. -- nosy: +kyle.roberts ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17673 ___

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-04-12 Thread R. David Murray
R. David Murray added the comment: with self.assertRaises(KeyError) as cm: os.environ[missing] self.assertEqual(cm.excecption.args[0], missing) (I don't know why assertRaises returns itself rather than just returning the exception in the with, but that's the API). --

[issue17700] Update Curses HOWTO for 3.4

2013-04-12 Thread A.M. Kuchling
A.M. Kuchling added the comment: Updated version of the patch: * Correct the errors reported in the review. * Restore 3-space indents. * Mention the LINES and COLS variables. * Add more links to the final section. I believe everything in the howto also applies to 3.3; it would be fine if you

[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

2013-04-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 12.04.2013 16:00, Amaury Forgeot d'Arc wrote: Amaury Forgeot d'Arc added the comment: At the time the Py_AtExit functions are called, the thread state is NULL I'd say this is the root cause. It's a bad thing to call Py_DECREF without a thread

[issue17697] Incorrect stacktrace from pdb

2013-04-12 Thread Xavier de Gaye
Xavier de Gaye added the comment: The call to set_trace() installs a local trace function on all the frames of the stack, including on the oldest frame, i.e. the module level frame. This causes the invocation of frame_settrace() in frameobject.c and the module frame f_lineno is evaluated by

[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2013-04-12 Thread R. David Murray
R. David Murray added the comment: It may be problematic, but it is also consistent with the way the shell works in general. (Try the same things with PATH.) -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

  1   2   >