ANN: Plumbum v1.1

2012-12-16 Thread Tomer Filiba
Plumbum 1.1 was released, adding Paramiko integration and support for 
subcommands

About
=
Ever wished the wrist-handiness of shell scripts be put into a real programming 
language? Say hello to Plumbum Shell Combinators. Plumbum (Latin for lead, 
which was used to create pipes back in the day) is a small yet feature-rich 
library for shell script-like programs in Python. The motto of the library is 
“Never write shell scripts again”, and thus it attempts to mimic the shell 
syntax (shell combinators) where it makes sense, while keeping it all Pythonic 
and cross-platform.

Apart from shell-like syntax and handy shortcuts, the library provides local 
and remote command execution (over SSH), local and remote file-system paths, 
easy working-directory and environment manipulation, and a programmatic 
Command-Line Interface (CLI) application toolkit.

Documentation and Download
==
http://plumbum.readthedocs.org/en/latest/
http://pypi.python.org/pypi/plumbum
http://plumbum.readthedocs.org/en/latest/changelog.html
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Is there a quick accurate way to test a python install?

2012-12-16 Thread Gene Heskett
On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:

 On 12/15/2012 9:59 PM, Gene Heskett wrote:
  This is 2.6, on ubuntu-10.04.4 LTS
  
  gene@lathe:/usr/lib/python2.6/test$ python -m test.regrtest
 
 That should be the right incantation for 2.6.
 
  test_grammar
  test_grammar skipped -- No module named test_grammar
  test_opcodes
  test_opcodes skipped -- No module named test_opcodes
  test_dict
  test_dict skipped -- No module named test_dict
  test_builtin
 
 You appear to have some of /Lib/test/ present, including
 Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
 know what is normal for an Ubuntu distribution. On Windows, I believe it
 is all or nothing.
/usr/lib/test?
gene@lathe:/usr/lib/python2.6$ locate lib/test
/opt/libreoffice3.5/program/python-core-2.6.1/lib/idlelib/testcode.py
/usr/lib/pymodules/python2.6/launchpadlib/testing
/usr/lib/pymodules/python2.6/launchpadlib/tests
/usr/lib/pymodules/python2.6/launchpadlib/testing/__init__.py
/usr/lib/pymodules/python2.6/launchpadlib/testing/__init__.pyc
/usr/lib/pymodules/python2.6/launchpadlib/testing/helpers.py
/usr/lib/pymodules/python2.6/launchpadlib/testing/helpers.pyc
/usr/lib/pymodules/python2.6/launchpadlib/tests/__init__.py
/usr/lib/pymodules/python2.6/launchpadlib/tests/__init__.pyc
/usr/lib/pymodules/python2.6/launchpadlib/tests/test_launchpad.py
/usr/lib/pymodules/python2.6/launchpadlib/tests/test_launchpad.pyc

There are half a dozen or more branches of the python tree that claim to 
have test things, but the universal answer is:

gene@lathe:/usr/lib/python2.6$ cd /usr/share/pyshared/numpy/lib/tests
gene@lathe:/usr/share/pyshared/numpy/lib/tests$ python -m test -uall
/usr/bin/python: test is a package and cannot be directly executed

I have installed several more python 'likely suspects' but have not changed 
a thing in the results.
 
  ImportError: cannot import name test_timeout
 
 I have no idea why this one gave an exception rather than a skip.


Cheers, Gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
My web page: http://coyoteden.dyndns-free.com:85/gene is up!
Human kind cannot bear very much reality.
-- T. S. Eliot, Four Quartets: Burnt Norton
I was taught to respect my elders, but its getting 
harder and harder to find any...
-- 
http://mail.python.org/mailman/listinfo/python-list


python-daemon

2012-12-16 Thread n8felton
Hello all. Got a question for anyone out there that is willing to help. Looking 
to make a Python Daemon, Google searches lead me to 
http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1) pip 
install python-daemon downloads version 1.6, but the site states that 1.5.5 is 
the latest version. Anyone know why this is? 2) With python-daemon having been 
last uploaded in 2010, is anyone aware if there is a better implementation for 
python daemons, or is this still considered current?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread rurpy
On 12/16/2012 08:26 AM, n8fel...@gmail.com wrote:
 Hello all. Got a question for anyone out there that is willing to
 help. Looking to make a Python Daemon, Google searches lead me to
 http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1)
 pip install python-daemon downloads version 1.6, but the site states
 that 1.5.5 is the latest version. Anyone know why this is? 2) With
 python-daemon having been last uploaded in 2010, is anyone aware if
 there is a better implementation for python daemons, or is this still
 considered current?

The author of the python-daemon package I believe is Ben Finney, 
who sometimes posts here.  Sadly, I think he is a member of a group 
of people here who say they filter out and ignore all messages posted 
from Google Groups (which would include yours and mine).  

If you get no other good answers here, you could try emailing him
directly at ben+pyt...@benfinney.id.au, which is the address on 
a recent post from him.

Or you could repost from other than GG if you don't mind being a 
tool of someone else's political agenda.
-- 
http://mail.python.org/mailman/listinfo/python-list


Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Darrien Glasser
Hey guys, I'm working on a Python rock paper scissors (lizard spock) game, and 
the beginning is complete. After I finished it, I thought, You know what? I 
think I can make this even better, and add a score counter. And so I did.

The problem is that it doesn't seem to actually keep track of score. In fact it 
always keeps the score at 0 for both players. It's fully functional otherwise, 
but it's bothering me that I can't get it to work. 

Currently using Windows Python 32 bit v2.6.8

Download of the code here:

https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

Copy of the code here:

http://pastebin.com/MNdgiuSY

Thanks in advance for your help...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:00 PM, Darrien Glasser
darrienglas...@gmail.com wrote:
 Hey guys, I'm working on a Python rock paper scissors (lizard spock) game, 
 and the beginning is complete. After I finished it, I thought, You know 
 what? I think I can make this even better, and add a score counter. And so I 
 did.

 The problem is that it doesn't seem to actually keep track of score. In fact 
 it always keeps the score at 0 for both players. It's fully functional 
 otherwise, but it's bothering me that I can't get it to work.

 Currently using Windows Python 32 bit v2.6.8

 Download of the code here:

 https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

 Copy of the code here:

 http://pastebin.com/MNdgiuSY

 Thanks in advance for your help...
 --
 http://mail.python.org/mailman/listinfo/python-list

winx = winx + 1
winy = winy + 1

PS. please do not use pastebin.com.
-- 
Kwpolska http://kwpolska.tk
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem with web browser module

2012-12-16 Thread Eric Johansson

On Saturday, December 15, 2012 9:14:25 PM, Terry Reedy wrote:


I believe this worked with Firefox the last time I tested. I just read
the docs. Never tried IE. I believe details partly depend on browser.


thank you Terry. I will try with Firefox  but the main reason I'm using 
IE is simply because nuance has created a module  to make the text 
areas speech recognition friendly. So I will do some more work to find 
out how to make IE do what I needed it to do.


thank you again.


--
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Darrien Glasser
Awesome thanks, and sounds good. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pexpect and buffering

2012-12-16 Thread jim . hefferon
Sorry to reply to my own post, but I believe I have my answer and I want to 
help anyone who might google their way here: I need to change PROMPT and 
PROMPT_CONTINUE to be regular expressions, for instance by escaping the periods.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread rurpy
 Hey guys, I'm working on a Python rock paper scissors (lizard spock)
 game, and the beginning is complete. After I finished it, I thought,
 You know what? I think I can make this even better, and add a score
 counter. And so I did.
 
 The problem is that it doesn't seem to actually keep track of score.
 In fact it always keeps the score at 0 for both players. It's fully
 functional otherwise, but it's bothering me that I can't get it to
 work.
 
 Currently using Windows Python 32 bit v2.6.8
 
 Download of the code here:
 https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
 
 Copy of the code here:
 http://pastebin.com/MNdgiuSY

If you are keeping the score in 'winx 'and 'winy' then you are adding
one to the the values but not saving the results.

I think you want 

  winx = winx + 1

or more concisely,

  winx += 1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
Actually, I was just going to post that it wasn't saving the scores. Great 
timing, I'll try it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread rurpy
On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.

Why?
-- 
http://mail.python.org/mailman/listinfo/python-list


ANNOUNCE: pyparsing 1.5.7/2.0.0

2012-12-16 Thread Paul McGuire
With the release of version 2.0.0/1.5.7, pyparsing has now officially switched 
to Python 3.x support as its default installation environment. Python 2.x users 
can install the latest 1.5.7 release. (If you're using easy_install, do 
easy_install pyparsing==1.5.7.)

I'm taking this opportunity to do some minor API tweaking too, renaming some 
operators and method names that I got wrong earlier (the old operators and 
methods are still there for now for compatibility, but they are deprecated to 
be removed in a future release):

- Added new operator '=', which will eventually replace '' for 
  storing the contents of a Forward(). '=' does not have the same
  operator precedence problems that '' does.

- 'operatorPrecedence' is being renamed 'infixNotation' as a better
  description of what this helper function creates. 'operatorPrecedence'
  is deprecated, and will be dropped entirely in a future release.

Several bug-fixes are included, plus several new examples, *and* an awesome 
example submitted by Luca DellOlio, for parsing ANTLR grammar definitions and 
implementing them with pyparsing objects.

---
Pyparsing wiki: pyparsing.wikispaces.com
SVN checkout: 
  (latest) svn checkout 
https://pyparsing.svn.sourceforge.net/svnroot/pyparsing/trunk pyparsing
  (1.5.x branch) svn checkout 
https://pyparsing.svn.sourceforge.net/svnroot/pyparsing/branches/pyparsing_1.5.x
 pyparsing
  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:25 PM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.

 Why?
 --
 http://mail.python.org/mailman/listinfo/python-list

http://news.ycombinator.com/item?id=2595066 should answer this very question.
-- 
Kwpolska http://kwpolska.tk
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 12:16:34 PM UTC-5, ru...@yahoo.com wrote:
  Hey guys, I'm working on a Python rock paper scissors (lizard spock)
 
  game, and the beginning is complete. After I finished it, I thought,
 
  You know what? I think I can make this even better, and add a score
 
  counter. And so I did.
 
  
 
  The problem is that it doesn't seem to actually keep track of score.
 
  In fact it always keeps the score at 0 for both players. It's fully
 
  functional otherwise, but it's bothering me that I can't get it to
 
  work.
 
  
 
  Currently using Windows Python 32 bit v2.6.8
 
  
 
  Download of the code here:
 
  https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
 
  
 
  Copy of the code here:
 
  http://pastebin.com/MNdgiuSY
 
 
 
 If you are keeping the score in 'winx 'and 'winy' then you are adding
 
 one to the the values but not saving the results.
 
 
 
 I think you want 
 
 
 
   winx = winx + 1
 
 
 
 or more concisely,
 
 
 
   winx += 1

I changed it so that it said winx += 1 etc. and it doesn't seem to save it. I 
also tried pulling the variables from the loop and making them global variables 
at the top.

The latter game me a traceback error when printing out the results. Any ideas?

http://puu.sh/1BCbG

Code Preview/Download

https://www.box.com/s/jiu0259nohx0kae2am57
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:44 PM, tbg darrienglas...@gmail.com wrote:
 I changed it so that it said winx += 1 etc. and it doesn't seem to save it. I 
 also tried pulling the variables from the loop and making them global 
 variables at the top.

 The latter game me a traceback error when printing out the results. Any ideas?

 http://puu.sh/1BCbG

 Code Preview/Download

 https://www.box.com/s/jiu0259nohx0kae2am57
 --
 http://mail.python.org/mailman/listinfo/python-list

Put this on top of your function:

global winx, winy


PS. Why did you put those delays in?  They are useless.
-- 
Kwpolska http://kwpolska.tk
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 12:50:18 PM UTC-5, Kwpolska wrote:
 On Sun, Dec 16, 2012 at 6:44 PM, tbg darrienglas...@gmail.com wrote:
 
  I changed it so that it said winx += 1 etc. and it doesn't seem to save it. 
  I also tried pulling the variables from the loop and making them global 
  variables at the top.
 
 
 
  The latter game me a traceback error when printing out the results. Any 
  ideas?
 
 
 
  http://puu.sh/1BCbG
 
 
 
  Code Preview/Download
 
 
 
  https://www.box.com/s/jiu0259nohx0kae2am57
 
  --
 
  http://mail.python.org/mailman/listinfo/python-list
 
 
 
 Put this on top of your function:
 
 
 
 global winx, winy
 
 
 
 
 
 PS. Why did you put those delays in?  They are useless.
 
 -- 
 
 Kwpolska http://kwpolska.tk
 
 stop html mail  | always bottom-post
 
 www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
 
 GPG KEY: 5EAAEA16

I figured it would be too much for the person playing the game. Getting 
attacked with lines of text and all. Although it is a pain developing with it.

And by the way, works perfectly now. Thanks for your help.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 12:00 PM, Darrien Glasser wrote:
Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, and the beginning is 
complete. After I finished it, I thought, You know what? I think I can 
make this even better, and add a score counter. And so I did.


 The problem is that it doesn't seem to actually keep track of score. 
In fact it always keeps the score at 0 for both players. It's fully 
functional otherwise, but it's bothering me that I can't get it to work.


 Currently using Windows Python 32 bit v2.6.8

 Download of the code here:

 https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

 Copy of the code here:

 http://pastebin.com/MNdgiuSY

 Thanks in advance for your help...


I was actually thinking of making a simple rock paper scissors game so I
went ahead and cobbled it together, using a design with a class and
generally a structured approach.. It keeps the scores, too, and you can
set both players to be AI, or one to be AI, or both to be humans:

https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py

(it needs python3 but can be easily changed to work with python2.x)


 - mitya

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

--
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 1:07:16 PM UTC-5, Mitya Sirenef wrote:
 On 12/16/2012 12:00 PM, Darrien Glasser wrote:
 
  Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, 
  and the beginning is 
 
 complete. After I finished it, I thought, You know what? I think I can 
 
 make this even better, and add a score counter. And so I did.
 
  
 
   The problem is that it doesn't seem to actually keep track of score. 
 
 In fact it always keeps the score at 0 for both players. It's fully 
 
 functional otherwise, but it's bothering me that I can't get it to work.
 
  
 
   Currently using Windows Python 32 bit v2.6.8
 
  
 
   Download of the code here:
 
  
 
   https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
 
  
 
   Copy of the code here:
 
  
 
   http://pastebin.com/MNdgiuSY
 
  
 
   Thanks in advance for your help...
 
 
 
 
 
 I was actually thinking of making a simple rock paper scissors game so I
 
 went ahead and cobbled it together, using a design with a class and
 
 generally a structured approach.. It keeps the scores, too, and you can
 
 set both players to be AI, or one to be AI, or both to be humans:
 
 
 
 https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py
 
 
 
 (it needs python3 but can be easily changed to work with python2.x)
 
 
 
 
 
   - mitya
 
 
 
 -- 
 
 Lark's Tongue Guide to Python: http://lightbird.net/larks/

Well there goes my hopes and dreams of being the first one to do that. Nice job 
by the way.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 01:17 PM, tbg wrote:

On Sunday, December 16, 2012 1:07:16 PM UTC-5, Mitya Sirenef wrote:

On 12/16/2012 12:00 PM, Darrien Glasser wrote:


Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, and 
the beginning is

complete. After I finished it, I thought, You know what? I think I can

make this even better, and add a score counter. And so I did.

  

   The problem is that it doesn't seem to actually keep track of score.

In fact it always keeps the score at 0 for both players. It's fully

functional otherwise, but it's bothering me that I can't get it to work.

  

   Currently using Windows Python 32 bit v2.6.8

  

   Download of the code here:

  

   https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

  

   Copy of the code here:

  

   http://pastebin.com/MNdgiuSY

  

   Thanks in advance for your help...





I was actually thinking of making a simple rock paper scissors game so I

went ahead and cobbled it together, using a design with a class and

generally a structured approach.. It keeps the scores, too, and you can

set both players to be AI, or one to be AI, or both to be humans:



https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py



(it needs python3 but can be easily changed to work with python2.x)





   - mitya



--

Lark's Tongue Guide to Python: http://lightbird.net/larks/

Well there goes my hopes and dreams of being the first one to do that. Nice job 
by the way.


Well you were the first :-)  I just did it to illustrate a modular 
approach, I think a

simple game like that is a great learning opportunity.

I posted an update with some small cleanups just now..

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

--
http://mail.python.org/mailman/listinfo/python-list


Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Ian Kelly
On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska kwpol...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 6:25 PM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.

 Why?

 http://news.ycombinator.com/item?id=2595066 should answer this very question.

That seems to be a problem with a certain class of users that have
adopted Pastebin, not a problem with the site itself.  What do you
hope to accomplish by boycotting Pastebin for actual code pastes?
Even if the site were to cease to exist tomorrow, what is to stop the
hackers from simply switching to dpaste or gist like everybody else?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
Nice, will have to try it out...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a quick accurate way to test a python install?

2012-12-16 Thread Terry Reedy

On 12/16/2012 6:22 AM, Gene Heskett wrote:

On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:



You appear to have some of /Lib/test/ present, including
Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
know what is normal for an Ubuntu distribution. On Windows, I believe it
is all or nothing.



/usr/lib/test?


No. I am on Windows and by /Lib I mean the directory containing 
Python-coded stdlib modules. It is on sys.path. For me, the path entry 
is 'C:\\Programs\\Python33\\lib'. (Windows paths are case indifferent 
for matching.) /test is one of several package subdirectories in /Lib.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


modify image and save with exif data

2012-12-16 Thread jwe . van . dijk
I want to resize an image but retain the exif data
I now have:
import Image

img = Image.open('photo.jpg')
img.thumbnail((800, 800), Image.ANTIALIAS)
img.save('photo800.jpg', 'JPEG')

The saved image photo800.jpg has no exif info anymore.
I would so much like to have it retained in particular the exposure and gps 
data.

I use Python 2.7 with PIL 1.17 on Ubuntu 12.04
For exif reading/writing I use pyexiv2 0.3.2 but apparently you cannot add tags 
to an image that has none; only modifying existing ones seems to work.

Thanks for any helpful suggestions,
Janwillem
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a quick accurate way to test a python install?

2012-12-16 Thread Gene Heskett
On Sunday 16 December 2012 14:55:53 Terry Reedy did opine:

 On 12/16/2012 6:22 AM, Gene Heskett wrote:
  On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:
  You appear to have some of /Lib/test/ present, including
  Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
  know what is normal for an Ubuntu distribution. On Windows, I believe
  it is all or nothing.
  
  /usr/lib/test?
 
 No. I am on Windows and by /Lib I mean the directory containing
 Python-coded stdlib modules. It is on sys.path. For me, the path entry
 is 'C:\\Programs\\Python33\\lib'. (Windows paths are case indifferent
 for matching.) /test is one of several package subdirectories in /Lib.

Nothing even remotely related in the linux /lib tree:

gene@coyote:/$ ls -lR /lib|grep test
-rw-r--r-- 1 root root 6592 2010-07-27 13:58 raid6test.ko
drwxr-xr-x 2 root root  4096 2010-07-27 23:16 tests
/lib/modules/2.6.32-122-rtai/kernel/drivers/mtd/tests:
-rw-r--r-- 1 root root 14752 2010-07-27 13:58 mtd_oobtest.ko
-rw-r--r-- 1 root root 12668 2010-07-27 13:58 mtd_pagetest.ko
-rw-r--r-- 1 root root  7260 2010-07-27 13:58 mtd_readtest.ko
-rw-r--r-- 1 root root 10304 2010-07-27 13:58 mtd_speedtest.ko
-rw-r--r-- 1 root root  8552 2010-07-27 13:58 mtd_stresstest.ko
-rw-r--r-- 1 root root 12220 2010-07-27 13:58 mtd_subpagetest.ko
-rw-r--r-- 1 root root 13336 2010-07-27 13:58 mtd_torturetest.ko
-rw-r--r-- 1 root root  5816 2010-07-27 13:58 rtc-test.ko
-rw-r--r-- 1 root root  6968 2010-07-27 13:58 comedi_test.ko
-rw-r--r-- 1 root root 29556 2010-07-27 13:59 usbtest.ko

I knew there was a certain amount of isolation between the windows version 
and the linux version, but this seems total, so perhaps someone actually 
running linux can chip in here, with suggestions that are valid for the 
linux version?

Cheers, Gene
-- 
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
My web page: http://coyoteden.dyndns-free.com:85/gene is up!
There is no sincerer love than the love of food.
-- George Bernard Shaw
I was taught to respect my elders, but its getting 
harder and harder to find any...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 5:35 AM, Ian Kelly ian.g.ke...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska kwpol...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 6:25 PM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.

 Why?

 http://news.ycombinator.com/item?id=2595066 should answer this very question.

 That seems to be a problem with a certain class of users that have
 adopted Pastebin, not a problem with the site itself.  What do you
 hope to accomplish by boycotting Pastebin for actual code pastes?
 Even if the site were to cease to exist tomorrow, what is to stop the
 hackers from simply switching to dpaste or gist like everybody else?

The comment by genbattle in the above link is an important one, I
think. The last time I used pastebin was for Pike code - does any
competing site have Pike support?

http://pastebin.com/UNTj642Y

I don't understand the idea behind the boycott. Are people worried
about the longevity of linked-to content, in the event that pastebin
should, as you say, cease to exist tomorrow? Or is it that some won't
click a pastebin link in case it's abusive? This isn't the sort of
abuse that can compromise your computer.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 3:59 AM,  ru...@yahoo.com wrote:
 On 12/16/2012 08:26 AM, n8fel...@gmail.com wrote:
 Hello all. Got a question for anyone out there that is willing to
 help. Looking to make a Python Daemon, Google searches lead me to
 http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1)
 pip install python-daemon downloads version 1.6, but the site states
 that 1.5.5 is the latest version. Anyone know why this is? 2) With
 python-daemon having been last uploaded in 2010, is anyone aware if
 there is a better implementation for python daemons, or is this still
 considered current?

 The author of the python-daemon package I believe is Ben Finney,
 who sometimes posts here.  Sadly, I think he is a member of a group
 of people here who say they filter out and ignore all messages posted
 from Google Groups (which would include yours and mine).

 If you get no other good answers here, you could try emailing him
 directly at ben+pyt...@benfinney.id.au, which is the address on
 a recent post from him.

More courteous would be to NOT post an unsolicited email to a poster's
address gleaned (by someone else) from a mailing list, but to look for
contact details in the package itself. I haven't looked, so it may
well be that there are none, but if there's an official contact point
for the package, that would be a very good start.

If your post is swallowed by someone's twit filter, that probably
means that you're doing something twittish. Switching to direct mail
isn't going to win you any friends :) Switching your newsgroup client,
however, will have all the same benefits; so do you want to be a tool
of the anti-Google-Groups propaganda, or of the
anti-anti-Google-Groups propaganda?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread rurpy
On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
[...]
 If your post is swallowed by someone's twit filter, that probably
 means that you're doing something twittish. Switching to direct mail
 isn't going to win you any friends :) Switching your newsgroup client,
 however, will have all the same benefits; so do you want to be a tool
 of the anti-Google-Groups propaganda, or of the
 anti-anti-Google-Groups propaganda?

The contents of a twit filter can be just as good an indication
of a twit reader as a twit poster.

And as was pointed out the last time this subject came up, no,
other clients do not have all the same benefits [as GG].

Rather than continue this twit-for-twat noise I've tried to 
provide something a little more constructive at 

  http://wiki.python.org/moin/GoogleGroupsPython
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread alex23
On Dec 17, 3:32 am, Kwpolska kwpol...@gmail.com wrote:
  PS. please do not use pastebin.com.
 http://news.ycombinator.com/item?id=2595066should answer this very question.

By that argument, you should also be asking people not to use the
internet.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode

2012-12-16 Thread Dave Angel
On 12/16/2012 04:10 PM, Anatoli Hristov wrote:
 Hello guys,

 I'm using Linux CentOS and Python 2.4 with MySQL 5.xx, I get error
 with Unicode I tried many things that I found on the net but none of
 them working.

 If I dont use UTF-8 it inserts the data into the DB  but some French
 char. are not correctly decoded. Could you please help me ?

Thanks for describing your system, and for using plain text in your message.

But the program you supplied is missing quite a bit, starting with the
imports.  And you say nothing at all about the error you get.

You should include a full traceback of whatever error you're getting,
along with information about how you got there.

I don't see any place there which is dealing with unicode, except for
the part which is commented out.  Hard to get an error on those lines.



-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Why Isn't Multiple Inheritance Automatic in Python?

2012-12-16 Thread Nick M . Daly
If you're short on time, the subject's all you need to read.  It seems
like it would always be the right thing to do, when the sub-class
specifically requests it.

It's very unlikely that multiple inheritance would go horribly wrong, as
long as classes adopt class-specific argument naming conventions.
However, ever since bug 1683368 [0] was fixed, it's now impossible to
cleanly create arbitrary inheritance trees.  The only reason I can't
just take anybody's code and plop it into my inheritance tree is because
Python demands that each class specifically opts in to MI though
mechanisms like the following:

1: class Foo(object):
2: def __init__(self, foo_bar, *args, **kwargs):
3: if Foo.__mro__[1] != object:
4: super().__init__(*args, **kwargs)
5: 
6: self.bar = foo_bar

Lines 3 and 4 are required because Foo might fall at the beginning or
the middle of in the inheritance tree: we can't know ahead of time.

From my perspective, it'd be lovely if init methods implicitly accepted
*args and **kwargs while implicitly sending them off to the next class
in the MRO as the first call.  This would make the previous example
semantically equivalent to:

1: class Foo(object):
2: def __init__(self, foo_bar):
3: self.bar = foo_bar

Granted, that's probably too excessive and implicit for most folks to be
comfortable with, even though that's obviously the behavior a user
intends when they write code like:

1: class Baz(Foo, Bar):
2: def __init__(self):
3: super().__init__(foo_bar=1, bar_quote=Give me another!)

Fundamentally, I don't care if Foo or Bar explicitly handle being
composed into the inheritance tree.  They can be composed correctly
(they can do what the user is asking) in most obvious and simple cases,
and it'd be fine by me even if we threw errors in complex situations
(like overlapping argument names in init methods).

So, would it be a good idea to:

1. Undo the fix to bug 1683368, making multiple inheritance easier?

2. Make MI implicit, when subclasses try to use it?

Thanks for your time,
Nick

0: http://bugs.python.org/issue1683368

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 01:07 PM, Mitya Sirenef wrote:

On 12/16/2012 12:00 PM, Darrien  Glasser wrote:
 Hey guys, I'm working on a Python rock paper scissors (lizard spock) 
game, and the beginning is
 complete. After I finished it, I thought, You know what? I think I 
can make this even better, and add a score counter. And so I did.

 
  The problem is that it doesn't seem to actually keep track of 
score. In fact it always keeps the score at 0 for both players. It's 
fully functional otherwise, but it's bothering me that I can't get it to 
work.

 
  Currently using Windows Python 32 bit v2.6.8
 
  Download of the code here:
 
  https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
 
  Copy of the code here:
 
  http://pastebin.com/MNdgiuSY
 
  Thanks in advance for your help...


 I was actually thinking of making a simple rock paper scissors game so I
 went ahead and cobbled it together, using a design with a class and
 generally a structured approach.. It keeps the scores, too, and you can
 set both players to be AI, or one to be AI, or both to be humans:

 https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py

 (it needs python3 but can be easily changed to work with python2.x)


 - mitya



If anyone's interested, I've simplified the code further by making use
of my TextInput utility class; I've also made the game into a tutorial,
it can be found here:

http://lightbird.net/larks/rockpaper.html


The updated full code is really tiny (it requires utils.py which is
linked at the top of tutorial):


import sys
from random import choice as randchoice
from time import sleep

from utils import TextInput

players= 'XY'
ai_players = 'Y'
moves  = rps
wins   = (rp, sr, ps)   # choice on the right side wins
status = %5s %3d %5s %3d moves: %s %s
pause_time = 0.3


class RockPaperScissors(object):
def run(self):
self.textinput = TextInput((r|p|s))
scores = [0, 0]

while True:
choice1, choice2 = (self.get_move(p) for p in players)

if choice1 != choice2:
winplayer = 1 if (choice1+choice2 in wins) else 0
scores[winplayer] += 1

print(status % (players[0], scores[0], players[1], 
scores[1], choice1, choice2))

sleep(pause_time)

def get_move(self, player):
if player in ai_players : return randchoice(moves)
else: return self.textinput.getval()


if __name__ == __main__:
try  : RockPaperScissors().run()
except KeyboardInterrupt : pass


--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

--
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode

2012-12-16 Thread Steven D'Aprano
On Sun, 16 Dec 2012 22:10:37 +0100, Anatoli Hristov wrote:

 If I dont use UTF-8 it inserts the data into the DB  but some French
 char. are not correctly decoded. Could you please help me ?

What happens when you do use UTF-8?

What do you mean, use UTF-8?


To learn about Unicode, start here:

http://www.joelonsoftware.com/articles/Unicode.html

If that helps you solve the problem, excellent. If not, please come back 
with your questions, but first read this:

http://www.sscce.org/

As given, we cannot answer your question easily, or at all, because we 
cannot run your code. It gives indentation errors, you don't tell us what 
modules you're using, and you haven't reduced the example down to the 
critical parts that demonstrate the failure.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 9:18 AM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
[...]
 If your post is swallowed by someone's twit filter, that probably
 means that you're doing something twittish. Switching to direct mail
 isn't going to win you any friends :) Switching your newsgroup client,
 however, will have all the same benefits; so do you want to be a tool
 of the anti-Google-Groups propaganda, or of the
 anti-anti-Google-Groups propaganda?

 The contents of a twit filter can be just as good an indication
 of a twit reader as a twit poster.

 And as was pointed out the last time this subject came up, no,
 other clients do not have all the same benefits [as GG].

 Rather than continue this twit-for-twat noise I've tried to
 provide something a little more constructive at

   http://wiki.python.org/moin/GoogleGroupsPython

All you've said is the exact same things that have already been said,
including that not everyone will see your post if you use Google
Groups. Why use something that unnecessarily restricts your audience,
when non-restrictive posting methods work just fine?

Anyway. This debate isn't going away; I have no strong side in it, I'm
just informing people of the fact that posting from GG will reduce
your potential response sources.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: modify image and save with exif data

2012-12-16 Thread Vincent Vande Vyvre
Le 16/12/12 20:43, jwe.van.d...@gmail.com a écrit :
 I want to resize an image but retain the exif data
 I now have:
 import Image

 img = Image.open('photo.jpg')
 img.thumbnail((800, 800), Image.ANTIALIAS)
 img.save('photo800.jpg', 'JPEG')

 The saved image photo800.jpg has no exif info anymore.
 I would so much like to have it retained in particular the exposure and gps 
 data.

 I use Python 2.7 with PIL 1.17 on Ubuntu 12.04
 For exif reading/writing I use pyexiv2 0.3.2 but apparently you cannot add 
 tags to an image that has none; only modifying existing ones seems to work.

 Thanks for any helpful suggestions,
 Janwillem
Hi,

If a tag is not already set you can create it with pyexiv2.

Example:
--
self.data = pyexiv2.ImageMetadata(img.jpg)
self.data.read()

tag = Exif.Image.ImageWidth
try:
self.data[tag].value = sizes[0]
except:
self.data[tag] = pyexiv2.ExifTag(tag, sizes[0])
---

A more complete example:
http://bazaar.launchpad.net/~vincent-vandevyvre/oqapy/serie-1.0/view/head:/oqapy-1.0/metadata.py



-- 
Vincent V.V.
Oqapy https://launchpad.net/oqapy . Qarte
https://launchpad.net/qarte . PaQager https://launchpad.net/paqager
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Steven D'Aprano
On Mon, 17 Dec 2012 07:13:44 +1100, Chris Angelico wrote:

 On Mon, Dec 17, 2012 at 5:35 AM, Ian Kelly ian.g.ke...@gmail.com
 wrote:
 On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska kwpol...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 6:25 PM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.

 Why?
[...]
 I don't understand the idea behind the boycott. Are people worried about
 the longevity of linked-to content, in the event that pastebin should,
 as you say, cease to exist tomorrow? Or is it that some won't click a
 pastebin link in case it's abusive? This isn't the sort of abuse that
 can compromise your computer.

How do you know? Between javascript and flash, just about any browser 
could be vulnerable to just about any website. You might implicitly trust 
Pastebin, but you can't possibly *know* that the site won't do bad 
things. It wouldn't be the first time that even a reputable website got 
hacked by somebody who used it to deploy malware.

But that's not why I dislike Pastebin. I argue against Pastebin because:

1) Longevity of the content. Your question is going to be around for 
much, much longer than your pastebin. People searching for help will 
click through to the pastebin and find the code is gone. It is really 
frustrating to (say) search for the solution to a problem, and find that 
the answer is given in an expired pastebin.


2) When you ask for help via email, you shouldn't assume that the people 
reading have access to the web. Perhaps they have email access, but all 
or part of the web is blocked to them. Perhaps they are reading email on 
a mobile device and don't mind paying to download a couple of KB of 
email, but draw the line at (potentially) hundreds of KB of a web page 
plus associated images, unnecessary javascript, web bugs, advertisements, 
etc. Or maybe they just don't want the context switch:

I'm reading email right now, I'll click the link later...

Email is a push technology. A pastebin is a pull technology. Whenever you 
require your audience to actively go and get content, you're cutting your 
audience by some fraction.

I am aware that it is irrational and silly, but for me it also has to do 
with a sense of fairness. I'm prepared to spend tens of minutes, or 
sometimes even an hour or more, solving somebody else's problem for no 
benefit except a sense of accomplishment. But ask me to click on a 
pastebin to find out what that question is, and I'm all Why should I 
have to go out of my way to find out what your question is? You're asking 
me to do you a favour, and you're making me work to find out what the 
favour is??? Fuck you!

But maybe that's just me :-)

I'm not saying never use a paste bin. I think it probably makes lots of 
sense to use one in IRC, where it is inappropriate to paste more than a 
line or two of code at once, and the conversation is already ephemeral. 
But in a Usenet or email forum, I think it is almost always inappropriate 
to use paste bins. If your code is too large to paste directly in the 
body of your email, chances are it is too large to expect people to debug 
for you. But you can try adding it as an attachment (.py, not .doc), and 
only if you can't do that for some reason, then maybe a paste bin is 
appropriate.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread rurpy
On 12/16/2012 11:16 PM, Chris Angelico wrote:
 On Mon, Dec 17, 2012 at 9:18 AM,  ru...@yahoo.com wrote:
 On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
[...]
 If your post is swallowed by someone's twit filter, that probably
 means that you're doing something twittish. Switching to direct mail
 isn't going to win you any friends :) Switching your newsgroup client,
 however, will have all the same benefits; so do you want to be a tool
 of the anti-Google-Groups propaganda, or of the
 anti-anti-Google-Groups propaganda?

 The contents of a twit filter can be just as good an indication
 of a twit reader as a twit poster.

 And as was pointed out the last time this subject came up, no,
 other clients do not have all the same benefits [as GG].

 Rather than continue this twit-for-twat noise I've tried to
 provide something a little more constructive at

   http://wiki.python.org/moin/GoogleGroupsPython
 
 All you've said is the exact same things that have already been said,
 including that not everyone will see your post if you use Google
 Groups. Why use something that unnecessarily restricts your audience,
 when non-restrictive posting methods work just fine?

I keep saying them because people like you keep saying (in
effect) that there is no difference in clients (in terms
of usability, convenience, setup effort and other factors
that vary on a person-by-person basis.)  I even wrote that 
above, right in the post you're replying to:
 
   no, other clients do not have all the same benefits

and yet you respond that other posting methods work just fine
Again, that may be true for you and your definition of fine, 
and maybe even for many people but it is not true for everyone,

As you say, all this has been said before and if you need to 
refresh your memory, please see the list archives, the thread, 
Simple Question regarding running .py program around nov 14.

 Anyway. This debate isn't going away; I have no strong side in it, I'm
 just informing people of the fact that posting from GG will reduce
 your potential response sources.

No, that's not what you were just informing people of...
you were also informing us that we are twits for finding 
Google Groups fits our needs better than some other clients.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 6:25 PM,  ru...@yahoo.com wrote:
 No, that's not what you were just informing people of...
 you were also informing us that we are twits for finding
 Google Groups fits our needs better than some other clients.

I didn't say that. The first twit filter I met was when my dad put
*his own* address into it, to avoid downloading the posts he'd sent
(on a modem, that was significant). And that was the most normal thing
to do, twitting yourself :)

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patches LGTM. How about adding a test?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8109] Server-side support for TLS Server Name Indication extension

2012-12-16 Thread danblack

danblack added the comment:

 If it isn't very clear to you, I can still handle it myself, though. Those 
 docs aren't the best.

Not clear enough. Yes I'd appreciate you handling it. Thanks.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8109
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated with clarified comments.

Are the tests fail on non-fixed Python?

--
Added file: http://bugs.python.org/file28329/glob_magic_in_drive_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
dependencies: +Add pure Python operator module

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16651
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16694] Add pure Python operator module

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Patch updated with clarified comments.
 
 Are the tests fail on non-fixed Python?

Yes, they do.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16695] Clarify fnmatch glob docs about the handling of leading .s

2012-12-16 Thread Hynek Schlawack

New submission from Hynek Schlawack:

See issue16664.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 177584
nosy: Sebastian.Kreft, docs@python, hynek, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Clarify fnmatch  glob docs about the handling of leading .s
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14901] Python Windows FAQ is Very Outdated

2012-12-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14901
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16694] Add pure Python operator module

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a functional (and more effective) equivalent of attrgetter:

def attrgetter(attr, *attrs):

Return a callable object that fetches the given attribute(s) from its 
operand.
After f=attrgetter('name'), the call f(r) returns r.name.
After g=attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
After h=attrgetter('name.first', 'name.last'), the call h(r) returns
(r.name.first, r.name.last).

if not attrs:
if not isinstance(attr, str):
raise TypeError('attribute name must be a string')
names = attr.split('.')
def func(obj):
for name in names:
obj = getattr(obj, name)
return obj
return func
else:
getters = tuple(map(attrgetter, (attr,) + attrs))
def func(obj):
return tuple(getter(obj) for getter in getters)
return func

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16664] Test Glob: files starting with .

2012-12-16 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Patch LGTM and will be applied, I have opened issue16695 for the related update 
of the docs.

BTW how did you create the patch? The bugtracker/Rietveld didn't recognize it 
for review and applying it took some effort too.

--
title: [PATCH] Test Glob: files starting with . - Test Glob: files starting 
with .
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16694] Add pure Python operator module

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps Modules/operator.c should be renamed to Modules/_operator.c.

Also note, that error messages in Python an C implementations sometimes differ.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16664] Test Glob: files starting with .

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 028ecc3900f5 by Hynek Schlawack in branch '2.7':
#16664: Add regression tests for glob's behaviour concerning .-entries
http://hg.python.org/cpython/rev/028ecc3900f5

New changeset 29f0c45ce576 by Hynek Schlawack in branch '3.2':
#16664: Add regression tests for glob's behaviour concerning .-entries
http://hg.python.org/cpython/rev/29f0c45ce576

New changeset f646842023b3 by Hynek Schlawack in branch '3.3':
#16664: Add regression tests for glob's behaviour concerning .-entries
http://hg.python.org/cpython/rev/f646842023b3

New changeset 1fb39efcc3dd by Hynek Schlawack in branch 'default':
#16664: Add regression tests for glob's behaviour concerning .-entries
http://hg.python.org/cpython/rev/1fb39efcc3dd

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16664] Test Glob: files starting with .

2012-12-16 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Thank you for your patch and welcome to CPython core development!

Presuming you want to submit more patches in future, please take the time to 
sign a Python contributor agreement: http://www.python.org/psf/contrib/ . 
You'll get a pretty star next to your name in the bug tracker in return. ;)

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-16 Thread Daniel Shahaf

Daniel Shahaf added the comment:

Haven't had a chance to look at the test___all__ -related failures yet.  Still 
planning to do so once I have some time.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16076
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16679] Wrong URL path decoding

2012-12-16 Thread And Clover

And Clover added the comment:

WSGI's usage of ISO-8859-1 for all HTTP-byte-originated strings is very much 
deliberate; we needed a way to preserve the original input bytes whilst still 
using unicode strings, and at the time surrogateescape was not available. The 
result is counter-intuitive but at least it is finally consistent; the 
expectation is that most web authors will be using some kind of web framework 
or input-reading library that will hide away the unpleasant details.

See http://mail.python.org/pipermail/web-sig/2007-December/thread.html#3002 and 
http://mail.python.org/pipermail/web-sig/2010-July/thread.html#4473 for the 
background discussion.

In any case we cannot assume a path is UTF-8 - not every URI is known to have 
come from an IRI so RFC 3987 does not necessarily apply. 
UTF-8-with-Latin1-fallback is also undesirable in itself as it adds ambiguity - 
an ISO-8859-1 byte sequence that by coincidence happens to be a valid UTF-8 
byte sequence will get mangled.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16679
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16669] Docstrings for namedtuple

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 1. Most data attributes cannot have individual docstrings, so I expect the 
 class docstring to list and possibly explain the data attributes. 

But almost all PyStructSequence field have individual docstrings.

 This does not create a second new class and is not a 'trick'.

Thanks for the tip.

 I presume that is why property docstrings are not used much.

Indeed, only 84 of 336 Python implemented properties have docstrings .
However this is even larger percent than for methods (about 8K of 43K).
And 100 of 115 PyStructSequence field have docstrings.

I think Python should have more docstrings, not less.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16669
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4af260a54e05 by Antoine Pitrou in branch '3.2':
Issue #16626: Fix infinite recursion in glob.glob() on Windows when the pattern 
contains a wildcard in the drive or UNC path.
http://hg.python.org/cpython/rev/4af260a54e05

New changeset b90aa7f66e4a by Antoine Pitrou in branch '3.3':
Issue #16626: Fix infinite recursion in glob.glob() on Windows when the pattern 
contains a wildcard in the drive or UNC path.
http://hg.python.org/cpython/rev/b90aa7f66e4a

New changeset bfb39fb93af7 by Antoine Pitrou in branch 'default':
Issue #16626: Fix infinite recursion in glob.glob() on Windows when the pattern 
contains a wildcard in the drive or UNC path.
http://hg.python.org/cpython/rev/bfb39fb93af7

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0935ef48186 by Antoine Pitrou in branch '2.7':
Issue #16626: Fix infinite recursion in glob.glob() on Windows when the pattern 
contains a wildcard in the drive or UNC path.
http://hg.python.org/cpython/rev/b0935ef48186

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16626] Infinite recursion in glob.glob('*:') on Windows

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Patches now committed, thank you !

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16696] BytesWarning in glob.glob

2012-12-16 Thread Antoine Pitrou

New submission from Antoine Pitrou:

This failure appeared on one of the Windows buildbots:

==
ERROR: test_glob_magic_in_drive (test.test_glob.GlobTests)
--
Traceback (most recent call last):
  File C:\buildbot.python.org\3.2.kloth-win64\build\lib\test\test_glob.py, 
line 118, in test_glob_magic_in_drive
eq(glob.glob(b'*:'), [])
  File C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py, line 15, in 
glob
return list(iglob(pathname))
  File C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py, line 44, in 
iglob
for name in glob_in_dir(dirname, basename):
  File C:\buildbot.python.org\3.2.kloth-win64\build\lib\glob.py, line 66, in 
glob0
if basename == '':
BytesWarning: Comparison between bytes and string

--
components: Library (Lib), Windows
messages: 177596
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: BytesWarning in glob.glob
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

See also issue16696.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16661] test_posix.test_getgrouplist fails on some systems - incorrectly comparing getgroups and getgrouplist results

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Apparently this also needs fixing on 2.7 and 3.2, see e.g. 
http://buildbot.python.org/all/builders/AMD64%20Mountain%20Lion%20%5BSB%5D%203.2

--
nosy: +pitrou
status: closed - open
versions: +Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16661
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16597
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16697] argparse kwarg 'choices' documentation

2012-12-16 Thread wim glenn

New submission from wim glenn:

Any object that supports the in operator can be passed as the choices value, so 
dict objects, set objects, custom containers, etc. are all supported.  (from  
http://docs.python.org/dev/library/argparse.html#choices )

Actual behaviour is contradicted by the docs - it seems the container must 
additionally be iterable.  When using a custom container, argparse b0rks on 
trying to iterate through choices.  Using a metavar prevents this, but it still 
breaks on cases where the element is not in the container.  

More details here:  
http://stackoverflow.com/questions/13833566/python-argparse-choices-from-an-infinite-set

--
assignee: docs@python
components: Documentation
messages: 177599
nosy: docs@python, wim.glenn
priority: normal
severity: normal
status: open
title: argparse kwarg 'choices' documentation
type: enhancement
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16697
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16661] test_posix.test_getgrouplist fails on some systems - incorrectly comparing getgroups and getgrouplist results

2012-12-16 Thread Ross Lagerwall

Ross Lagerwall added the comment:

getgrouplist() is new in 3.3. Those failures are from getgroups() failing. I'll 
open a separate issue for that.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16661
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16698] test_posix.test_getgroups fails on some systems

2012-12-16 Thread Ross Lagerwall

New submission from Ross Lagerwall:

test_posix.test_getgroups() fails on some systems:

http://buildbot.python.org/all/builders/AMD64%20Mountain%20Lion%20%5BSB%5D%203.2

This could be related to #16661.

--
components: Tests
messages: 177601
nosy: rosslagerwall
priority: normal
severity: normal
stage: needs patch
status: open
title: test_posix.test_getgroups fails on some systems
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16698
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16697] argparse kwarg 'choices' documentation

2012-12-16 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue issue 16468, which may get closed with either a 
bug fix or a doc fix, depending on the outcome of the overall discussion.

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - argparse only supports iterable choices
type: enhancement - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16697
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16468] argparse only supports iterable choices

2012-12-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +wim.glenn

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16468
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16696] BytesWarning in glob.glob

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It should be if not basename:. No additional tests are possible except those 
which added for issue16626.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16696] BytesWarning in glob.glob

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96f19274de18 by Antoine Pitrou in branch '3.2':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/96f19274de18

New changeset ed8134df30e4 by Antoine Pitrou in branch '3.3':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/ed8134df30e4

New changeset 9e898ee68388 by Antoine Pitrou in branch 'default':
Issue #16696: fix comparison between bytes and string. Also, improve glob tests.
http://hg.python.org/cpython/rev/9e898ee68388

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16696] BytesWarning in glob.glob

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've added some tests for patterns with a trailing slash.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13876] Sporadic failure in test_socket: testRecvmsgEOF

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 391bda06fa65 by Antoine Pitrou in branch '3.3':
Silence sporadic failure in RecvmsgSCTPStreamTest.testRecvmsgEOF (issue #13876) 
- probably not Python-related.
http://hg.python.org/cpython/rev/391bda06fa65

New changeset 2d2d4807a3ed by Antoine Pitrou in branch 'default':
Silence sporadic failure in RecvmsgSCTPStreamTest.testRecvmsgEOF (issue #13876) 
- probably not Python-related.
http://hg.python.org/cpython/rev/2d2d4807a3ed

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13876
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13876] Sporadic failure in test_socket: testRecvmsgEOF

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've now silenced the exception. Leaving this issue open in case someone wants 
to investigate more.

--
resolution:  - fixed
stage: needs patch - committed/rejected
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13876
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15845] Fixing some byte-to-string conversion warnings

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The first bug fixed in issue16696.

--
nosy: +pitrou, serhiy.storchaka
type: enhancement - behavior
versions: +Python 3.2, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15845
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Looks as this is a duplicate of issue13247. And Victor submitted a patch with 
approach similar to me (except that my patch does not raises an exception, but 
returns an unicode for unencodable names).

It looks as longliving design bug and perhaps really be closed as won't fix.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16656
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, os.listdir() should always be called with a unicode argument under 
Windows (which is the natural thing to do in 3.x, anyway). The other issue 
(with print() unable to display some symbols depending on the codepage) is 
unrelated.

--
nosy: +pitrou
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16656
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16699] Mountain Lion buildbot lacks disk space

2012-12-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: pitrou
priority: normal
severity: normal
status: open
title: Mountain Lion buildbot lacks disk space

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16699
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16699] Mountain Lion buildbot lacks disk space

2012-12-16 Thread Antoine Pitrou

New submission from Antoine Pitrou:

==
ERROR: test_large_file_ops (test.test_io.CIOTest)
--
Traceback (most recent call last):
  File 
/Volumes/bay2/buildslave/cpython/3.3.snakebite-mountainlion-amd64/build/Lib/test/test_io.py,
 line 432, in test_large_file_ops
self.large_file_ops(f)
  File 
/Volumes/bay2/buildslave/cpython/3.3.snakebite-mountainlion-amd64/build/Lib/test/test_io.py,
 line 332, in large_file_ops
self.assertEqual(f.write(bxxx), 3)
OSError: [Errno 28] No space left on device

--
assignee:  - trent
keywords: +buildbot
nosy: +trent

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16699
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13247] under Windows, os.path.abspath returns non-ASCII bytes paths as question marks

2012-12-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
components: +Windows
stage: committed/rejected - 
title: os.path.abspath returns unicode paths as question marks - under 
Windows, os.path.abspath returns non-ASCII bytes paths as question marks
type: enhancement - behavior
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13247
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13247] under Windows, os.path.abspath returns non-ASCII bytes paths as question marks

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue16656 where another approach was proposed (unicode names returned 
from Bytes API if result is not encodable). Actually I think now that there is 
no right solution of this issue.

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13247
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16700] Document that bytes OS API can returns unusable results on Windows

2012-12-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some OS functions which returns bytes (os.environb, os.getenvb(), os.getcwdb(), 
os.listdir(), os.readlink(), os.walk(), os.path.abspath(), 
os.path.expanduser(), os.path.expandvars(), os.path.realpath() and may be 
other) can return unusable result on Windows (see for example issue13247 and 
issue16656). The documentation should contains strong warnings about this.

--
assignee: docs@python
components: Documentation, Windows
messages: 177613
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Document that bytes OS API can returns unusable results on Windows
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16700] Document that bytes OS API can returns unusable results on Windows

2012-12-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Matthew Barnett

Matthew Barnett added the comment:

Here are some tests for the issue.

--
Added file: http://bugs.python.org/file28330/issue16688#3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13863] import.c sometimes generates incorrect timestamps on Windows + NTFS

2012-12-16 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's a possible fix for Python 2.7.  Reviews from Windows experts would be 
very much appreciated;  I don't really know what I'm doing here.

I'm still trying to work out how to test this effectively.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13863
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13863] import.c sometimes generates incorrect timestamps on Windows + NTFS

2012-12-16 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file28331/pyc_mtime.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13863
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The second test pass on unpatched Python.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch doesn't apply cleanly.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Matthew Barnett

Matthew Barnett added the comment:

Oops! :-( Now corrected.

--
Added file: http://bugs.python.org/file28332/issue16688#3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Matthew Barnett

Changes by Matthew Barnett pyt...@mrabarnett.plus.com:


Removed file: http://bugs.python.org/file28330/issue16688#3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patches updated to resolve conflicts with recent commits. Some minor test 
errors fixed.

--
Added file: http://bugs.python.org/file28333/glob_dotfiles_2.patch
Added file: http://bugs.python.org/file28334/glob_tests-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___diff -r 2d2d4807a3ed Lib/_pyio.py
--- a/Lib/_pyio.py  Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/_pyio.py  Sun Dec 16 20:53:44 2012 +0200
@@ -346,8 +346,10 @@
 This method has no effect if the file is already closed.
 
 if not self.__closed:
-self.flush()
-self.__closed = True
+try:
+self.flush()
+finally:
+self.__closed = True
 
 def __del__(self):
 Destructor.  Calls close().
@@ -1584,8 +1586,10 @@
 
 def close(self):
 if self.buffer is not None and not self.closed:
-self.flush()
-self.buffer.close()
+try:
+self.flush()
+finally:
+self.buffer.close()
 
 @property
 def closed(self):
@@ -2074,3 +2078,56 @@
 def detach(self):
 # This doesn't make sense on StringIO.
 self._unsupported(detach)
+
+
+class BytesPipeIO(BufferedIOBase):
+
+def __init__(self, maxsize=0):
+self.maxsize = maxsize
+self._queue = BytesIO()
+self._size = 0
+self._offset = 0
+self.mutex = threading.Lock()
+self.not_empty = threading.Condition(self.mutex)
+self.not_full = threading.Condition(self.mutex)
+self.all_tasks_done = threading.Condition(self.mutex)
+self.unfinished_tasks = 0
+
+def readable(self):
+return True
+
+def writable(self):
+return True
+
+def read1(self, n=-1):
+with self.not_empty:
+while not self._queue:
+self.not_empty.wait()
+self._queue.seek(self._offset)
+b = self._queue.read(n)
+self._offset += len(b)
+self.not_full.notify()
+return b
+
+#def readall(self):
+#pass
+
+#def readinto(self, b):
+#pass
+
+def write(self, b):
+with self.not_full:
+if self.maxsize  0:
+while self._size - self._offset = self.maxsize:
+self.not_full.wait()
+if self._offset * 2  self._size + 0x1000:
+self._pack()
+self._queue.seek(self._size)
+self._size += self._queue.write(b)
+self.unfinished_tasks += 1
+self.not_empty.notify()
+
+def _pack(self):
+self._queue = BytesIO(self._queue.read())
+self._size -= self._offset
+self._offset = 0
diff -r 2d2d4807a3ed Lib/codecs.py
--- a/Lib/codecs.py Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/codecs.py Sun Dec 16 20:53:44 2012 +0200
@@ -462,15 +462,8 @@
 # read until we get the required number of characters (if available)
 while True:
 # can the request be satisfied from the character buffer?
-if chars  0:
-if size  0:
-if self.charbuffer:
-break
-elif len(self.charbuffer) = size:
-break
-else:
-if len(self.charbuffer) = chars:
-break
+if chars = 0 and len(self.charbuffer) = chars:
+break
 # we need more data
 if size  0:
 newdata = self.stream.read()
diff -r 2d2d4807a3ed Lib/ftplib.py
--- a/Lib/ftplib.py Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/ftplib.py Sun Dec 16 20:53:44 2012 +0200
@@ -288,21 +288,25 @@
 
 def makeport(self):
 '''Create a new socket and send a PORT command for it.'''
-msg = getaddrinfo returns an empty list
 sock = None
+saved_err = None
 for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, 
socket.AI_PASSIVE):
 af, socktype, proto, canonname, sa = res
 try:
 sock = socket.socket(af, socktype, proto)
 sock.bind(sa)
-except socket.error as msg:
+except OSError as err:
+saved_err = err
 if sock:
 sock.close()
 sock = None
 continue
 break
 if not sock:
-raise socket.error(msg)
+if saved_err is not None:
+raise saved_err from None
+else:
+raise OSError(getaddrinfo returns an empty list)
 sock.listen(1)
 port = sock.getsockname()[1] # Get proper port
 host = self.sock.getsockname()[0] # Get proper host
diff -r 2d2d4807a3ed Lib/glob.py
--- a/Lib/glob.py  

[issue16688] Backreferences make case-insensitive regex fail on non-ASCII strings.

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

Matthew, can you please submit a contributor form?

http://python.org/psf/contrib/contrib-form/
http://python.org/psf/contrib/

--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patches updated. Unrelated changes removed.

--
Added file: http://bugs.python.org/file28335/glob_dotfiles_2.patch
Added file: http://bugs.python.org/file28336/glob_tests-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___diff -r 2d2d4807a3ed Lib/glob.py
--- a/Lib/glob.py   Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/glob.py   Sun Dec 16 21:10:24 2012 +0200
@@ -57,8 +57,8 @@
 names = os.listdir(dirname)
 except os.error:
 return []
-if pattern[0] != '.':
-names = [x for x in names if x[0] != '.']
+if not _ishidden(pattern):
+names = [x for x in names if not _ishidden(x)]
 return fnmatch.filter(names, pattern)
 
 def glob0(dirname, basename):
@@ -82,3 +82,6 @@
 else:
 match = magic_check.search(s)
 return match is not None
+
+def _ishidden(path):
+return path[0] in ('.', b'.'[0])
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28333/glob_dotfiles_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28334/glob_tests-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13863] import.c sometimes generates incorrect timestamps on Windows + NTFS

2012-12-16 Thread Mark Dickinson

Mark Dickinson added the comment:

Updated patch, with a test.

--
Added file: http://bugs.python.org/file28337/pyc_mtime2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13863
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yet one attempt.

--
Added file: http://bugs.python.org/file28338/glob_dotfiles_2.patch
Added file: http://bugs.python.org/file28339/glob_tests-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___diff -r 2d2d4807a3ed Lib/glob.py
--- a/Lib/glob.py   Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/glob.py   Sun Dec 16 21:12:42 2012 +0200
@@ -57,8 +57,8 @@
 names = os.listdir(dirname)
 except os.error:
 return []
-if pattern[0] != '.':
-names = [x for x in names if x[0] != '.']
+if not _ishidden(pattern):
+names = [x for x in names if not _ishidden(x)]
 return fnmatch.filter(names, pattern)
 
 def glob0(dirname, basename):
@@ -82,3 +82,6 @@
 else:
 match = magic_check.search(s)
 return match is not None
+
+def _ishidden(path):
+return path[0] in ('.', b'.'[0])
diff -r 2d2d4807a3ed Lib/test/test_glob.py
--- a/Lib/test/test_glob.py Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/test/test_glob.py Sun Dec 16 21:12:42 2012 +0200
@@ -31,7 +31,8 @@
 self.mktemp('a', 'bcd', 'efg', 'ha')
 if can_symlink():
 os.symlink(self.norm('broken'), self.norm('sym1'))
-os.symlink(self.norm('broken'), self.norm('sym2'))
+os.symlink('broken', self.norm('sym2'))
+os.symlink(os.path.join('a', 'bcd'), self.norm('sym3'))
 
 def tearDown(self):
 shutil.rmtree(self.tempdir)
@@ -44,10 +45,16 @@
 p = os.path.join(self.tempdir, pattern)
 res = glob.glob(p)
 self.assertEqual(list(glob.iglob(p)), res)
+bres = [os.fsencode(x) for x in res]
+self.assertEqual(glob.glob(os.fsencode(p)), bres)
+self.assertEqual(list(glob.iglob(os.fsencode(p))), bres)
 return res
 
 def assertSequencesEqual_noorder(self, l1, l2):
+l1 = list(l1)
+l2 = list(l2)
 self.assertEqual(set(l1), set(l2))
+self.assertEqual(sorted(l1), sorted(l2))
 
 def test_glob_literal(self):
 eq = self.assertSequencesEqual_noorder
@@ -58,13 +65,23 @@
 
 # test return types are unicode, but only if os.listdir
 # returns unicode filenames
-uniset = set([str])
-tmp = os.listdir('.')
-if set(type(x) for x in tmp) == uniset:
+uniset = {str}
+tmp = os.listdir(os.curdir)
+if {type(x) for x in tmp} == uniset:
 u1 = glob.glob('*')
-u2 = glob.glob('./*')
-self.assertEqual(set(type(r) for r in u1), uniset)
-self.assertEqual(set(type(r) for r in u2), uniset)
+u2 = glob.glob(os.path.join(os.curdir, '*'))
+self.assertEqual({type(r) for r in u1}, uniset)
+self.assertEqual({type(r) for r in u2}, uniset)
+
+# test return types are bytes, but only if os.listdir
+# returns bytes filenames
+bytset = {bytes}
+tmp = os.listdir(os.fsencode(os.curdir))
+if {type(x) for x in tmp} == bytset:
+u1 = glob.glob(b'*')
+u2 = glob.glob(os.path.join(os.fsencode(os.curdir), b'*'))
+self.assertEqual({type(r) for r in u1}, bytset)
+self.assertEqual({type(r) for r in u2}, bytset)
 
 def test_glob_one_directory(self):
 eq = self.assertSequencesEqual_noorder
@@ -111,6 +128,9 @@
   {self.norm('aaa'), self.norm('aab')},
   {self.norm('aaa') + os.sep, self.norm('aab') + os.sep},
   ])
+eq = self.assertSequencesEqual_noorder
+eq(self.glob('a*', ''), [os.path.join(self.tempdir, x, '')
+ for x in ['a', 'aaa', 'aab']])
 
 def test_glob_bytes_directory_with_trailing_slash(self):
 # Same as test_glob_directory_with_trailing_slash, but with a
@@ -128,9 +148,20 @@
   ])
 
 @skip_unless_symlink
+def test_glob_symlinks(self):
+eq = self.assertSequencesEqual_noorder
+eq(self.glob('sym3'), [self.norm('sym3')])
+eq(self.glob('sym3', '*'), [self.norm('sym3', 'EF'),
+self.norm('sym3', 'efg')])
+eq(self.glob('sym3', ''), [os.path.join(self.norm('sym3'), '')])
+eq(self.glob('*', '*F'), [self.norm('aaa', 'zzzF'),
+self.norm('aab', 'F'), self.norm('sym3', 'EF')])
+
+@skip_unless_symlink
 def test_glob_broken_symlinks(self):
 eq = self.assertSequencesEqual_noorder
-eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])
+eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2'),
+   self.norm('sym3')])
 eq(self.glob('sym1'), [self.norm('sym1')])
 eq(self.glob('sym2'), [self.norm('sym2')])
 
diff -r b0935ef48186 Lib/test/test_glob.py
--- a/Lib/test/test_glob.py Sun Dec 16 13:55:47 

[issue16700] Document that bytes OS API can returns unusable results on Windows

2012-12-16 Thread STINNER Victor

STINNER Victor added the comment:

I don't remember il the deprecation of bytes filename is documented.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28335/glob_dotfiles_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28336/glob_tests-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16694] Add pure Python operator module

2012-12-16 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16694
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15783] decimal: Support None default values in the C accelerator module

2012-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 907d71668d3c by Stefan Krah in branch '3.3':
Issue #15783: Support None default values in the Context() constructor.
http://hg.python.org/cpython/rev/907d71668d3c

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >