Re: [Windows 7, Python 2.6] Can't write to a directory made w/ os.makedirs

2012-01-01 Thread Tim Golden

On 31/12/2011 22:13, OlyDLG wrote:
 Hi!  I'm working on a script utilizing os.makedirs to make directories
 to which I'm then trying to write files created by exe's spawned w/
 subprocess.call; I'm developing in Stani's Python Editor, debugging
 using Winpdb.  I've gotten to the point where
 subprocess.Popen._execute_child is raising a WindowsError(5,'Access is
 denied') exception.  I've tried: setting the mode in the makedirs
 call; using os.chmod(dir, stat.S_IWRITE); and even setting a
 breakpoint before the subprocess.call and unsetting the read-only
 attribute of the pertinent directory tree using the Windows directory
 Properties dialog--which doesn't take, if that's a clue--all to no
 avail.

Whatever you're trying to do, resetting the read-only bit
on the Windows directory is not the answer. It has, bizarrely,
nothing to do with the read/write-ness of a directory; rather,
it reflects the system-ness of a folder.

There's no general answer I can see to give, without
knowing what the security is on your folders or what
other thing might impede your processes from writing
files in them. Is it definite that the ERROR_ACCESS_DENIED
is in fact the result of attempting to write a file into
one of the newly-created directories?

Can you do something like this (adapt for your own environment):

code
import os, sys
import subprocess

os.makedirs (c:/temp/a/b/c)

with open (c:/temp/a/b/c/test1.txt, w):
  pass

subprocess.call ([
  sys.executable,
  -c,
  open ('c:/temp/a/b/c/test2.txt', 'w').close ()
])

/code

ie can the Python process creating the directories,
and a subprocess called from it create a simple file?

Depending on where you are in the filesystem, it may indeed
be necessary to be running as administrator. But don't try
to crack every security nut with an elevated sledgehammer.


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


Re: Can't write to a directory made w/ os.makedirs

2012-01-01 Thread David Goldsmith
On Jan 1, 1:37 am, Tim Golden m...@timgolden.me.uk wrote:
 On 31/12/2011 22:13, OlyDLG wrote:
   Hi!  I'm working on a script utilizing os.makedirs to make directories
   to which I'm then trying to write files created by exe's spawned w/
   subprocess.call; I'm developing in Stani's Python Editor, debugging
   using Winpdb.  I've gotten to the point where
   subprocess.Popen._execute_child is raising a WindowsError(5,'Access is
   denied') exception.  I've tried: setting the mode in the makedirs
   call; using os.chmod(dir, stat.S_IWRITE); and even setting a
   breakpoint before the subprocess.call and unsetting the read-only
   attribute of the pertinent directory tree using the Windows directory
   Properties dialog--which doesn't take, if that's a clue--all to no
   avail.

 Whatever you're trying to do, resetting the read-only bit
 on the Windows directory is not the answer. It has, bizarrely,
 nothing to do with the read/write-ness of a directory; rather,
 it reflects the system-ness of a folder.

 There's no general answer I can see to give, without
 knowing what the security is on your folders or what
 other thing might impede your processes from writing
 files in them. Is it definite that the ERROR_ACCESS_DENIED
 is in fact the result of attempting to write a file into
 one of the newly-created directories?

 Can you do something like this (adapt for your own environment):

 code
 import os, sys
 import subprocess

 os.makedirs (c:/temp/a/b/c)

 with open (c:/temp/a/b/c/test1.txt, w):
    pass

 subprocess.call ([
    sys.executable,
    -c,
    open ('c:/temp/a/b/c/test2.txt', 'w').close ()
 ])

 /code

 ie can the Python process creating the directories,

Yes.

 and a subprocess called from it create a simple file?

No.

 Depending on where you are in the filesystem, it may indeed
 be necessary to be running as administrator. But don't try
 to crack every security nut with an elevated sledgehammer.

If you mean running as admin., those were my sentiments exactly.  So,
there isn't something specific I should be doing to assure that my
subproceses can write to directories?

 TJG

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


Creating a binary only python distribution of a C extension module and including some additional python and c files in it

2012-01-01 Thread akhilesh singhania
Hi,

I have a extension module in C which I want to distribute in binary
format, ideally an rpm. Additionally, I want to include some python
files (examples on how to use the extension module) and source for a
library the module dynamically links to (c,h, and make files).

How do I specify the example python file in setup.py so that it will
be included in the rpm?

If I specify it as scripts, I get the following error:

$ python setup.py bdist --format=rpm

 running build_scripts
 creating build/scripts-2.6
 error: file 'foo.py' does not exist
 error: Bad exit status from /var/tmp/rpm-tmp.yjws9x (%build)
If I specify it as data_files, I get the following error:

$ python setup.py bdist --format=rpm

 error: Installed (but unpackaged) file(s) found:
/usr/foo.pyc
/usr/foo.pyo
If I specify it as py_modules, I do not get errors but it is not
included in the resulting rpm.

Specifying it as a script works if I use

$ python setup.py bdist --format=gztar
Additionally, can I control the hierarchy of how the files are laid
out in the rpm?

Currently, I am specifying the c,h,make files as data_files and they
get placed in /usr, which is not desirable.

Regards,
akhi
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pickling instances of metaclass generated classes

2012-01-01 Thread Peter Otten
lars van gemerden wrote:

 import pickle
 import sys

 class MetaClass(type):
 pass

 class M(object):
 def __init__(self, module):
 self.__module = module
 def __getattr__(self, name):
 print creating class, name
 class_ = MetaClass(name, (), {__module__: self.__module})
 setattr(self, name, class_)
 return class_

 sys.modules[m] = M(m)
 import m
 c = m.x
 s = pickle.dumps(c)
 print repr(s)
 d = pickle.loads(s)

 assert c is d

 sys.modules[m] = M(m)
 e = pickle.loads(s)

 assert c is not e

 The official way is probably what Robert mentioned, via the copy_reg
 module, but I didn't get it to work.
 
 I will look further into this. does sys.modules[m] = M(m) create
 a new module?

Assigning to sys.modules[modulename] can put arbitrary objects into the 
module cache, in this case an M instance. To drive the point home:

 import sys
 sys.modules[x] = 42
 import x
 x
42
 sys.modules[x] = spam
 import x
 x
'spam'

 Cheers, Lars
 
 PS: I get an error when posting this to the usenet group

Sorry, that seems to happen when I post via gmane and don't manually clear 
the follow-up that my newsreader helpfully (knode) inserts. I've not yet 
found a permanent fix, but if that was the problem you should be able to 
answer this post.

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


Re: Can't write to a directory made w/ os.makedirs

2012-01-01 Thread Tim Golden

On 01/01/2012 12:05, David Goldsmith wrote:
 ie can the Python process creating the directories,

 Yes.

 and a subprocess called from it create a simple file?

 No.

 Depending on where you are in the filesystem, it may indeed
 be necessary to be running as administrator. But don't try
 to crack every security nut with an elevated sledgehammer.

 If you mean running as admin., those were my sentiments exactly.  So,
 there isn't something specific I should be doing to assure that my
 subproceses can write to directories?


In the general case, no. By default, a subprocess will have
the same security context as its parent. The exception is
where the parent (the Python processing invoking subprocess.call
in this example) is already impersonating a different user;
in that case, the subprocess will inherit its grandparent's
context.

But unless you're doing something very deliberate here then
I doubt if that's biting you.

Can I ask: are you absolutely certain that the processes
you're calling are doing what you think they are and failing
where you think they're failing?

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


Re: .format vs. %

2012-01-01 Thread Miki Tebeka
  s = {0} {1} {2} {3}
  s.format(1, 2, 3, 4)
 '1 2 3 4'
Or even
In [4]: fmt = '{0} {1} {2} {3}'.format
In [5]: print(fmt(1, 2, 3, 4))
1 2 3 4

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


Spamming PyPI with stupid packages

2012-01-01 Thread Matt Chaput
Someone seems to be spamming PyPI by uploading multiple stupid packages. Not 
sure if it's some form of advertising spam or just idiocy.

Don't know if we should care though... maybe policing uploads is worse than 
cluttering PyPI's disk space and RSS feed with dumb 1 KB packages.

 girlfriend 1.0.1  10  A really simple module that allow everyone to 
 do import girlfriend
 girlfriends 1.0   4   Girl Friends
 car 1.0   2   Car, a depended simple module that allow everyone to do 
 import girlfriend
 house 1.0 2   House, a depended simple module that allow everyone to 
 do import girlfriend
 money 1.0 2   Money, a depended simple module that allow everyone to 
 do import girlfriend
 workhard 1.0  2   Keep working hard, a depended simple module that allow 
 everyone to do import girlfriend


Matt




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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Robert Kern

On 1/1/12 10:18 PM, Matt Chaput wrote:

Someone seems to be spamming PyPI by uploading multiple stupid packages. Not 
sure if it's some form of advertising spam or just idiocy.

Don't know if we should care though... maybe policing uploads is worse than 
cluttering PyPI's disk space and RSS feed with dumb 1 KB packages.


girlfriend 1.0.110  A really simple module that allow everyone to do 
import girlfriend
girlfriends 1.0 4   Girl Friends
car 1.0 2   Car, a depended simple module that allow everyone to do import 
girlfriend
house 1.0   2   House, a depended simple module that allow everyone to do 
import girlfriend
money 1.0   2   Money, a depended simple module that allow everyone to do 
import girlfriend
workhard 1.02   Keep working hard, a depended simple module that allow everyone 
to do import girlfriend


I'm betting on a joke, like antigravity only significantly less funny and more 
sexist. The author is a legitimate Python programmer, and the links go to his 
blog where he talks about Python stuff.


  https://bitbucket.org/felinx

You can tell him that you don't appreciate his abuse of PyPI here if you like:

  http://feilong.me/2012/01/python-import-girlfriend

--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Alexander Kapps
Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I 
cannot resists.



allow everyone to do import girlfriend



I'm betting on a joke, like antigravity only significantly less
funny and more sexist.


Absolutely not funny. I hope that someday people will understand 
that sexism is just another form of racism.


I was about to write a really harsh reply, but cooled down before I 
got a chance to hit the Send button.


Felinx Lee: Do apologize and rename your package/module or I'm going 
to make a racist comment against Chinese people.

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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Devin Jeanpierre
 Absolutely not funny. I hope that someday people will understand that sexism
 is just another form of racism.

One can understand that sexism is a terrible thing, and at the same
time make sexist jokes.

 Felinx Lee: Do apologize and rename your package/module or I'm going to make
 a racist comment against Chinese people.

This is a joke, right? Making some kind of racist remark about Chinese
people wouldn't help anything at all, and it's hypocritical given your
stance on sexist jokes. It's one thing to make a joke, to make people
laugh, and inadvertently hurt someone's feelings. It's much worse to
make a malicious comment to try to hurt someone deliberately.

On a slightly different note, PyPI uploads are in fact already
policed. See http://holdenweb.blogspot.com/2011/07/childish-behavior.html
for an example

Coincidentally, it also involved a joke that the PyPI maintainers
found in poor taste. It's also a good example, if you read deeper into
the history of the name and project, of how overzealous policing of
these jokes can drive people away from your community, just as
underzealous policing can. Please be less angry and more careful, and
appreciate that, most likely, nobody here is operating under evil
intentions. They are just operating under what you might call poor
taste.

-- Devin

On Sun, Jan 1, 2012 at 6:24 PM, Alexander Kapps alex.ka...@web.de wrote:
 Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I cannot
 resists.


 allow everyone to do import girlfriend


 I'm betting on a joke, like antigravity only significantly less
 funny and more sexist.


 Absolutely not funny. I hope that someday people will understand that sexism
 is just another form of racism.

 I was about to write a really harsh reply, but cooled down before I got a
 chance to hit the Send button.

 Felinx Lee: Do apologize and rename your package/module or I'm going to make
 a racist comment against Chinese people.
 --
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Lie Ryan

On 01/02/2012 09:33 AM, Robert Kern wrote:

On 1/1/12 10:18 PM, Matt Chaput wrote:

Someone seems to be spamming PyPI by uploading multiple stupid
packages. Not sure if it's some form of advertising spam or just idiocy.

Don't know if we should care though... maybe policing uploads is worse
than cluttering PyPI's disk space and RSS feed with dumb 1 KB packages.


girlfriend 1.0.1 10 A really simple module that allow everyone to do
import girlfriend
girlfriends 1.0 4 Girl Friends
car 1.0 2 Car, a depended simple module that allow everyone to do
import girlfriend
house 1.0 2 House, a depended simple module that allow everyone to do
import girlfriend
money 1.0 2 Money, a depended simple module that allow everyone to do
import girlfriend
workhard 1.0 2 Keep working hard, a depended simple module that allow
everyone to do import girlfriend


I'm betting on a joke, like antigravity only significantly less funny
and more sexist. The author is a legitimate Python programmer, and the
links go to his blog where he talks about Python stuff.


Legitimate python programmer or not, that does not legitimize spamming 
PyPI.


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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Devin Jeanpierre
Sorry, I lied. It's been a while and I misremembered. The package
mentioned in the blog post was removed of the author's free will, and
PyPI doesn't police submissions.

-- Devin

On Sun, Jan 1, 2012 at 7:05 PM, Devin Jeanpierre jeanpierr...@gmail.com wrote:
 Absolutely not funny. I hope that someday people will understand that sexism
 is just another form of racism.

 One can understand that sexism is a terrible thing, and at the same
 time make sexist jokes.

 Felinx Lee: Do apologize and rename your package/module or I'm going to make
 a racist comment against Chinese people.

 This is a joke, right? Making some kind of racist remark about Chinese
 people wouldn't help anything at all, and it's hypocritical given your
 stance on sexist jokes. It's one thing to make a joke, to make people
 laugh, and inadvertently hurt someone's feelings. It's much worse to
 make a malicious comment to try to hurt someone deliberately.

 On a slightly different note, PyPI uploads are in fact already
 policed. See http://holdenweb.blogspot.com/2011/07/childish-behavior.html
 for an example

 Coincidentally, it also involved a joke that the PyPI maintainers
 found in poor taste. It's also a good example, if you read deeper into
 the history of the name and project, of how overzealous policing of
 these jokes can drive people away from your community, just as
 underzealous policing can. Please be less angry and more careful, and
 appreciate that, most likely, nobody here is operating under evil
 intentions. They are just operating under what you might call poor
 taste.

 -- Devin

 On Sun, Jan 1, 2012 at 6:24 PM, Alexander Kapps alex.ka...@web.de wrote:
 Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I cannot
 resists.


 allow everyone to do import girlfriend


 I'm betting on a joke, like antigravity only significantly less
 funny and more sexist.


 Absolutely not funny. I hope that someday people will understand that sexism
 is just another form of racism.

 I was about to write a really harsh reply, but cooled down before I got a
 chance to hit the Send button.

 Felinx Lee: Do apologize and rename your package/module or I'm going to make
 a racist comment against Chinese people.
 --
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


readline for mac python? (really, reproducing mac python packages)

2012-01-01 Thread K Richard Pixley

I'm having trouble finding a reasonable python environment on mac.

The supplied binaries, (2.7.2, 3.2.2), are built with old versions of 
macosx and are not capable of building any third party packages that 
require gcc.


The source builds easily enough out of the box, (./configure 
--enable-framework  make  sudo make install), but when I do that, I 
end up with a python interpreter that lacks readline.


How do I get readline involved?

Or better... is there an instruction sheet somewhere on how to reproduce 
the python.org binary packages?


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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Ben Finney
Alexander Kapps alex.ka...@web.de writes:

 Absolutely not funny. I hope that someday people will understand that
 sexism is just another form of racism.

That's not right. Racism and sexism are not forms of each other.

Instead, racism and sexism are both forms of bigotry.

And yes, I agree that the packages at issue are unfunny and the intent
is bigoted.

 I was about to write a really harsh reply, but cooled down before I got a
 chance to hit the Send button.

You would do better to send it to the author, rather than here.

 Felinx Lee: Do apologize and rename your package/module or I'm going
 to make a racist comment against Chinese people.

Please don't. We must be better than the bigots whose behaiour you
rightly deplore.

-- 
 \ “God was invented to explain mystery. God is always invented to |
  `\ explain those things that you do not understand.” —Richard P. |
_o__)Feynman, 1988 |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes:

 Alexander Kapps alex.ka...@web.de writes:

  Absolutely not funny. I hope that someday people will understand
  that sexism is just another form of racism.

 That's not right. Racism and sexism are not forms of each other.

 Instead, racism and sexism are both forms of bigotry.

Hmm, even that's not really true. Racism and sexism are both forms of
prejudice.

Bigotry always entails prejudice, but not vice versa.

How complex are the ways humans mistreat each other :-)

-- 
 \   “Everyone is entitled to their own opinions, but they are not |
  `\entitled to their own facts.” —US Senator Pat Moynihan |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: readline for mac python? (really, reproducing mac python packages)

2012-01-01 Thread K Richard Pixley

On 1/1/12 16:49 , K Richard Pixley wrote:

I'm having trouble finding a reasonable python environment on mac.

The supplied binaries, (2.7.2, 3.2.2), are built with old versions of
macosx and are not capable of building any third party packages that
require gcc.

The source builds easily enough out of the box, (./configure
--enable-framework  make  sudo make install), but when I do that, I
end up with a python interpreter that lacks readline.

How do I get readline involved?

Or better... is there an instruction sheet somewhere on how to reproduce
the python.org binary packages?

--rich


Bah.  I just needed to dig a little deeper into the source.  All the doc 
I wanted is in there.


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


Re: Can't write to a directory made w/ os.makedirs

2012-01-01 Thread David Goldsmith
On Jan 1, 7:05 am, Tim Golden m...@timgolden.me.uk wrote:
 On 01/01/2012 12:05, David Goldsmith wrote:
   ie can the Python process creating the directories,
  
   Yes.
  
   and a subprocess called from it create a simple file?
  
   No.
  
   Depending on where you are in the filesystem, it may indeed
   be necessary to be running as administrator. But don't try
   to crack every security nut with an elevated sledgehammer.
  
   If you mean running as admin., those were my sentiments exactly.  So,
   there isn't something specific I should be doing to assure that my
   subproceses can write to directories?

 In the general case, no. By default, a subprocess will have
 the same security context as its parent. The exception is
 where the parent (the Python processing invoking subprocess.call
 in this example) is already impersonating a different user;
 in that case, the subprocess will inherit its grandparent's
 context.

 But unless you're doing something very deliberate here then
 I doubt if that's biting you.

 Can I ask: are you absolutely certain that the processes
 you're calling are doing what you think they are and failing
 where you think they're failing?

 TJG

I'm a mathematician: the only thing I'm absolutely certain of is
nothing.

Here's my script, in case that helps:

import os
import sys
import stat
import os.path as op
import subprocess as sub
from os import remove
from os import listdir as ls
from os import makedirs as mkdir

def doFlac2Mp3(arg, d, fl):
if '.flac' in [f[-5:] for f in fl]:
newD = d.replace('FLACS', 'MP3s')
mkdir(newD)
for f in fl:
if f[-5:]=='.flac':
root = f.replace('.flac', '')
cmd = ['C:\\Program Files (x86)\\aTunes\\win_tools\
\flac.exe -d ' +
   '--output-prefix=' + newD + '\\', f]
res = sub.call(cmd)#, env={'PATH': os.defpath})
if not res:
cmd = ['C:\\Program Files (x86)\\aTunes\\win_tools
\\lame.exe -h',
newD + root + '.wav',  newD + root +
'.mp3']
res = sub.call(cmd)#, env={'PATH': os.defpath})
if not res:
rf = newD + root + '.wav'
remove(rf)

top=sys.argv[1]
op.walk(top, doFlac2Mp3, None)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't write to a directory made w/ os.makedirs

2012-01-01 Thread MRAB

On 02/01/2012 03:14, David Goldsmith wrote:

On Jan 1, 7:05 am, Tim Goldenm...@timgolden.me.uk  wrote:

 On 01/01/2012 12:05, David Goldsmith wrote:
 ie can the Python process creating the directories,
   
 Yes.
   
 and a subprocess called from it create a simple file?
   
 No.
   
 Depending on where you are in the filesystem, it may indeed
 be necessary to be running as administrator. But don't try
 to crack every security nut with an elevated sledgehammer.
   
 If you mean running as admin., those were my sentiments exactly.  So,
 there isn't something specific I should be doing to assure that my
 subproceses can write to directories?

 In the general case, no. By default, a subprocess will have
 the same security context as its parent. The exception is
 where the parent (the Python processing invoking subprocess.call
 in this example) is already impersonating a different user;
 in that case, the subprocess will inherit its grandparent's
 context.

 But unless you're doing something very deliberate here then
 I doubt if that's biting you.

 Can I ask: are you absolutely certain that the processes
 you're calling are doing what you think they are and failing
 where you think they're failing?

 TJG


I'm a mathematician: the only thing I'm absolutely certain of is
nothing.

Here's my script, in case that helps:

import os
import sys
import stat
import os.path as op
import subprocess as sub
from os import remove
from os import listdir as ls
from os import makedirs as mkdir

def doFlac2Mp3(arg, d, fl):
 if '.flac' in [f[-5:] for f in fl]:
 newD = d.replace('FLACS', 'MP3s')
 mkdir(newD)
 for f in fl:
 if f[-5:]=='.flac':
 root = f.replace('.flac', '')
 cmd = ['C:\\Program Files (x86)\\aTunes\\win_tools\
\flac.exe -d ' +
'--output-prefix=' + newD + '\\', f]
 res = sub.call(cmd)#, env={'PATH': os.defpath})
 if not res:
 cmd = ['C:\\Program Files (x86)\\aTunes\\win_tools
\\lame.exe -h',
 newD + root + '.wav',  newD + root +
'.mp3']
 res = sub.call(cmd)#, env={'PATH': os.defpath})
 if not res:
 rf = newD + root + '.wav'
 remove(rf)

top=sys.argv[1]
op.walk(top, doFlac2Mp3, None)


I think that if the command line should be something like:

C:\Program Files (x86)\aTunes\win_tools\flac.exe -d 
--output-prefix=FOO\ BAR


then the cmd should be something like:

cmd = ['C:\\Program Files (x86)\\aTunes\\win_tools\\flac.exe', '-d', 
'--output-prefix=' + newD + '\\', f]

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


Idiot-proof installs for python+pygame+pyopenal+app

2012-01-01 Thread Tim Chase
I'm looking at developing some tools that involve pygame+pyopenal 
and would like to make cross-platform distribution as painless as 
possible.  Is there a best practice for doing this without 
forcing the user to install Python, install (say) pip, pull down 
pygame  pyopenal and install those, install my (simple) app, and 
then finally run it?


On Debian, installation of all the prerequisites would just be

  apt-get install pygame python-openal

(which, via a local apt repository, I could flag as dependencies 
of my app and package it as .deb) but it gets hairier on Mac  Win32.


-tkc



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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Steven D'Aprano
On Mon, 02 Jan 2012 00:24:48 +0100, Alexander Kapps wrote:

 Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I
 cannot resists.
 
 allow everyone to do import girlfriend
 
 I'm betting on a joke, like antigravity only significantly less funny
 and more sexist.
 
 Absolutely not funny. I hope that someday people will understand that
 sexism is just another form of racism.

Perhaps I'm just slow, but what is sexist about this package? Do you even 
know what the package does?


 Felinx Lee: Do apologize and rename your package/module 

So the package itself is not offensive, just the name girlfriend?

Or is it the very concept of girlfriend that offends you?


 or I'm going to
 make a racist comment against Chinese people.

I'm sure he's quaking in his boots. Some random guy on the Internet is 
going to insult him based on a wild assumption about his nationality.



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


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Steven D'Aprano
On Mon, 02 Jan 2012 11:12:28 +1100, Lie Ryan wrote:

 Legitimate python programmer or not, that does not legitimize spamming
 PyPI.

I don't see that half a dozen trivial (pointless) modules should be 
classified as spam.

Personally, I've looked at the modules, and if I were the author, I'd be 
embarrassed to make them public. They aren't useful; they are rather 
immature; they don't demonstrate good Python knowledge or programming 
skill.


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


Re: Generating sin/square waves sound

2012-01-01 Thread Paulo da Silva
Em 30-12-2011 10:05, Dave Angel escreveu:
 On 12/30/2011 02:17 AM, Paulo da Silva wrote:
 Hi,
 Sorry if this is a FAQ, but I have googled and didn't find any
 satisfatory answer.

 Is there a simple way, preferably multiplataform (or linux), of
 generating sinusoidal/square waves sound in python?

 Thanks for any answers/suggestions.
 If you're willing to be Linux-only, then I believe you can do it without
 any extra libraries.
 
 You build up a string (8 bit char, on Python 2.x)  of samples, and write
 it to  /dev/audio.  When i experimented, I was only interested in a
 few seconds, so a single write was all I needed.
 
 Note that the samples are 8 bits, and they are offset by 128.  So a zero
 signal would be a string of 128 values.  A very quiet square wave might
 be a bunch of 126, followed by a bunch of 130.  and so on.  And the
 loudest might be a bunch of 2's followed by a bunch of 253's.
 
 You'll have to experiment with data rate;   The data is sent out at a
 constant rate from your string, but I don't know what that rate is.
 
 
This sounds nice, but then is 8 bits the limit for /dev/audio? What
about stereo? I don't need this one ... just for curiosity.
Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating sin/square waves sound

2012-01-01 Thread Paulo da Silva
Em 30-12-2011 11:23, mblume escreveu:
 Am Fri, 30 Dec 2011 07:17:13 + schrieb Paulo da Silva:
...

 Alternatively you might just generate (t,signal) samples, write them to 
 a file and convert them using sox (under Linux, might also be available
 under Windows) to another format.
 
As much as I could understand at a 1st look you are writing to a wav
file and then play the file.
It would be nice if I could play directly the samples.
Anyway I'll take a look at the wave module.
Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating sin/square waves sound

2012-01-01 Thread Paulo da Silva
Em 31-12-2011 01:19, K Richard Pixley escreveu:
 On 12/29/11 23:17 , Paulo da Silva wrote:
 Hi,
 Sorry if this is a FAQ, but I have googled and didn't find any
 satisfatory answer.

 Is there a simple way, preferably multiplataform (or linux), of
 generating sinusoidal/square waves sound in python?

 Thanks for any answers/suggestions.
 
 I just posted on this elsewhere.  Look for a thread titled: Which
 library for audio playback ?
 
 --rich

Thank you. I have just seen it using google and saved the bookmark of
the link. It's too late now but I'll read it tomorrow.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Spamming PyPI with stupid packages

2012-01-01 Thread Devin Jeanpierre
 Perhaps I'm just slow, but what is sexist about this package? Do you even
 know what the package does?

The dependencies are car, house, and money (and workhard, of
course). The joke being that women only care about how wealthy you
are.

If it's just about naming a package girlfriend, though, I agree. And
honestly that's much better material for a joke anyway.

-- Devin

On Mon, Jan 2, 2012 at 2:08 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 On Mon, 02 Jan 2012 00:24:48 +0100, Alexander Kapps wrote:

 Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I
 cannot resists.

 allow everyone to do import girlfriend

 I'm betting on a joke, like antigravity only significantly less funny
 and more sexist.

 Absolutely not funny. I hope that someday people will understand that
 sexism is just another form of racism.

 Perhaps I'm just slow, but what is sexist about this package? Do you even
 know what the package does?


 Felinx Lee: Do apologize and rename your package/module

 So the package itself is not offensive, just the name girlfriend?

 Or is it the very concept of girlfriend that offends you?


 or I'm going to
 make a racist comment against Chinese people.

 I'm sure he's quaking in his boots. Some random guy on the Internet is
 going to insult him based on a wild assumption about his nationality.



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


[issue13691] pydoc help (or help('help')) claims to run a help utility; does nothing

2012-01-01 Thread Devin Jeanpierre

New submission from Devin Jeanpierre jeanpierr...@gmail.com:

What follows is a copy-paste of a shell session. Notice that at the end, rather 
than being inside the online help utility, I'm still in the interactive 
interpreter. I was able to duplicate this on python3.2, python2.7, and 
python2.6 (verifying it on other versions would have required installing them). 
Reading the source in trunk, there is nothing that looks like it actually 
should run this interactive help session. It's just missing.

I guess nobody used this, eh? I've attached a patch that should fix it. I'm not 
sure how you want to handle adding a test for this, so please advise me on that.

-

 help('help')

Welcome to Python 3.2!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type quit.

To get a list of available modules, keywords, or topics, type modules,
keywords, or topics.  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as spam, type modules spam.



--
components: Library (Lib)
files: r74214.diff
keywords: patch
messages: 150427
nosy: Devin Jeanpierre
priority: normal
severity: normal
status: open
title: pydoc help (or help('help')) claims to run a help utility; does nothing
versions: Python 2.6, Python 2.7, Python 3.2
Added file: http://bugs.python.org/file24121/r74214.diff

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



[issue13683] Docs in Python 3:raise statement mistake

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 420e01156272 by Sandro Tosi in branch '3.2':
Issue #13683: raise with no exception in scope throws a RuntimeError; fix by 
Ramchandra Apte
http://hg.python.org/cpython/rev/420e01156272

--
nosy: +python-dev

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



[issue13683] Docs in Python 3:raise statement mistake

2012-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
nosy: +sandro.tosi
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue13690] Add DEBUG flag to documentation of re.compile

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 9aebb4d07ddf by Sandro Tosi in branch '2.7':
Issue #13690: add re.DEBUG; patch by Filip Gruszczyński
http://hg.python.org/cpython/rev/9aebb4d07ddf

New changeset f4a9c7cf98dd by Sandro Tosi in branch '3.2':
Issue #13690: add re.DEBUG; patch by Filip Gruszczyński
http://hg.python.org/cpython/rev/f4a9c7cf98dd

--
nosy: +python-dev

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



[issue13690] Add DEBUG flag to documentation of re.compile

2012-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python, sandro.tosi
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.2, Python 3.3

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



[issue13692] 2to3 mangles from . import frobnitz

2012-01-01 Thread Henrik Holmboe

New submission from Henrik Holmboe hen...@holmboe.se:

It seems that 2to3 mangles::

 from . import frobnitz

into::

 from ... import frobnitz

This was noticed in the port of ipython to py3k. See 
https://github.com/ipython/ipython/issues/1197

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 150430
nosy: holmbie
priority: normal
severity: normal
status: open
title: 2to3 mangles from . import frobnitz

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



[issue13692] 2to3 mangles from . import frobnitz

2012-01-01 Thread Thomas Kluyver

Thomas Kluyver tak...@gmail.com added the comment:

A couple of things to note:

- This was with the Python 3.1 implementation of 2to3 - the problem doesn't 
appear with the Python 3.2 version.
- The import statement in question was inside a method definition. I wonder if 
the extra two dots correspond to the class and method scopes.

--
nosy: +takluyver

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



[issue13645] import machinery vulnerable to timestamp collisions

2012-01-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 You could add the requisite path_size() method to get the value, and
 assume 0 means unsupported

I thought:
- calling two methods means two stat calls per file, this could be slightly 
inefficient
- if future extensions of the import mechanism require yet more stat 
information (for example owner or chmod), it will be yet another bunch of 
stat'ing methods to create

(besides, calling int() on the timestamp is a loss of information, I don't 
understand why this must be done in path_mtime() rather than let the consumer 
do whatever it wants with the higher-precision timestamp)

--

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



[issue13680] Aifc comptype write fix

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a9cdc3ff2b8e by Sandro Tosi in branch '3.2':
Issue #13680: add lowecase compression type to write header; patch by Oleg 
Plakhotnyuk
http://hg.python.org/cpython/rev/a9cdc3ff2b8e

--
nosy: +python-dev

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



[issue13680] Aifc comptype write fix

2012-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
nosy: +sandro.tosi
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue13693] email.Header.Header incorrect/non-smart on international charset address fields

2012-01-01 Thread kxroberto

New submission from kxroberto kxrobe...@users.sourceforge.net:

the email.* package seems to over-encode international charset address fields - 
resulting even in display errors in the receivers reader - , 
when message header composition is done as recommended in 
http://docs.python.org/library/email.header.html 

Python 2.7.2
 e=email.Parser.Parser().parsestr(getcliptext())
 e['From']
'=?utf-8?q?Martin_v=2E_L=C3=B6wis?= rep...@bugs.python.org'
# note the par
 email.Header.decode_header(_)
[('Martin v. L\xc3\xb6wis', 'utf-8'), ('rep...@bugs.python.org', None)]
# unfortunately there is no comfortable function for this:
 u='Martin v. L\xc3\xb6wis'.decode('utf8') + ' rep...@bugs.python.org'
 u
u'Martin v. L\xf6wis rep...@bugs.python.org'
 msg=email.Message.Message()
 msg['From']=u
 msg.as_string()
'From: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\n\n'
 msg['From']=str(u)
 msg.as_string()
'From: 
=?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\nFrom: 
Martin v. L\xf6wis rep...@bugs.python.org\n\n'
 msg['From']=email.Header.Header(u)
 msg.as_string()
'From: 
=?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\nFrom: 
Martin v. L\xf6wis rep...@bugs.python.org\nFrom: 
=?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\n\n'
 

(BTW: strange is that multiple msg['From']=... _assignments_ end up as multiple 
additions !???   also msg renders 8bit header lines without warning/error or 
auto-encoding, while it does auto on unicode!??)

Whats finally arriving at the receiver is typically like:

From: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?= 
rep...@bugs.python.org

because the servers seem to want the address open, they extract the address and 
_add_ it (duplicating) as ASCII. = error

I have not found any emails in my archives where address header fields are so 
over-encoded like python does. Even in non-address fields mostly only those 
words/groups are encoded which need it.

I assume the sophisticated/high-level looking email.* package doesn't expect 
that the user fiddles things together low-level? with parseaddr, re.search, 
make_header Header.encode , '.join ... Or is it indeed (undocumented) so? IMHO 
it should be auto-smart enough.

Note: there is a old deprecated function mimify.mime_encode_header which seemed 
to try to cautiously auto-encode correct/sparsely (but actually fails too on 
all examples tried).

--
components: Library (Lib)
messages: 150434
nosy: kxroberto
priority: normal
severity: normal
status: open
title: email.Header.Header incorrect/non-smart on international charset address 
fields
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue13640] add mimetype for application/vnd.apple.mpegurl

2012-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

I've also added 'm3u' which is the companion of 'm3u8'.

--
nosy: +sandro.tosi
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue13640] add mimetype for application/vnd.apple.mpegurl

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 7926f594e333 by Sandro Tosi in branch 'default':
Issue #13640: add application/vnd.apple.mpegurl MIME type; (partial) patch by 
Hiroaki Kawai
http://hg.python.org/cpython/rev/7926f594e333

--
nosy: +python-dev

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



[issue10839] email module should not allow some header field repetitions

2012-01-01 Thread kxroberto

kxroberto kxrobe...@users.sourceforge.net added the comment:

I think really ill/strange is that kind of item _assignments_  do _add_ 
multiple.

If   msg[field] = xywould just add-first/replace-frist , and only 
msg.add_/.append(field, xy)  would  add multiples that would be clear and 
understandable/readable. 
(The sophisticated check dictionary is unnecessary IMHO, I don't expect the 
class to be ever smart enough for a full RFC checklist.)

e.g. I remember a bug like

msg[field] = xy
if special_condition:
 msg[field] = abc   # just wanted a alternative


Never ever expected a double header here!

=  with adding behavior is absurd IMHO. Certainly doesn't allow readable code.

--
nosy: +kxroberto

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



[issue2481] locale.strxfrm does not work with Unicode strings

2012-01-01 Thread Jay Freeman (saurik)

Jay Freeman (saurik) sau...@saurik.com added the comment:

Given that Python 3.x is still not ready for general use (and when this is 
discussed people make it quite clear that this is to be expected, and that a 
many year timeline was originally proposed for the Python 3.0 transition), it 
seems like this bug fix should have been backported to 2.x at some point in the 
last four years it has been open. :(

--
nosy: +saurik

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



[issue13645] import machinery vulnerable to timestamp collisions

2012-01-01 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

The patch looks good to me.

--

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



[issue13693] email.Header.Header incorrect/non-smart on international charset address fields

2012-01-01 Thread kxroberto

kxroberto kxrobe...@users.sourceforge.net added the comment:

now I tried to render this address field header 

u'Name abc\u03a3@xy, abc@ewf, Nameß weofij@fjeio'

with 
h = email.Header.Header(continuation_ws='')
h.append ... / email.Header.make_header via these chunks:

[('Name ', us-ascii), ('abc\xce\xa3', utf-8), ('@xy, abc@ewf, ', us-ascii), 
('Name\xc3\x9f', utf-8), (' weofij@fjeio', us-ascii)]

the outcome is:

'Name  =?utf-8?b?YWJjzqM=?= @xy, abc@ewf,  =?utf-8?b?TmFtZcOf?=\n  
weofij@fjeio'


(note: local part of email address can be utf too)

It seems to be impossible to avoid the erronous extra spaces from outside 
within that email.Header framework.
Thus I guess it was not possible up to now to decently format a beyond-ascii 
MIME message using the official email.Header mechanism? - even when 
pre-digesting things

--

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



[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

Attached an updated patch. The custom text_factory case is now fixed, and 
bytes, bytearray and custom factory are all tested.

I also added back the pysqlite_unicode_from_string() function, as this makes 
the patch a bit smaller. It also seems to me (only by looking at the code) that 
the sqlite3.OptimizedUnicode factory isn't currently working as documented.

Antoine: Do you happen to know what's the status of the OptimizeUnicode 
thingie? Has it been changed for a reason or is it just an error that happened 
during the py3k transition?

--
Added file: http://bugs.python.org/file24122/sqlite3_zero_byte_v3.patch

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



[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


Removed file: http://bugs.python.org/file24122/sqlite3_zero_byte_v3.patch

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



[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

(Whoops, I didn't mean to change the magic source coding comment. Updating the 
patch once again.)

--
Added file: http://bugs.python.org/file24123/sqlite3_zero_byte_v3.patch

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



[issue13594] Aifc markers write fix

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset c7a4405835e8 by Sandro Tosi in branch '3.2':
Issue #13594: various fixes to aifc module; patch by Oleg Plakhotnyuk
http://hg.python.org/cpython/rev/c7a4405835e8

--
nosy: +python-dev

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



[issue13594] Aifc markers write fix

2012-01-01 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
nosy: +sandro.tosi
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Attached an updated patch. The custom text_factory case is now fixed,
 and bytes, bytearray and custom factory are all tested.

Thanks, looks good to me.

 Antoine: Do you happen to know what's the status of the
 OptimizeUnicode thingie? Has it been changed for a reason or is it
 just an error that happened during the py3k transition?

It looks obsolete in 3.x to me. If you look at the 2.7 source code, it
had a real meaning there. Probably we could simplify the 3.x source code
by removing that option (but better to do it in a separate patch).

--

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-01-01 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Thanks for the patch, Berker. It seems a bit too simple, though. You should add 
some tests in Lib/test/test_base64.py and run them (using ./python -m test -v 
test_base64), this will allow you to see if your changes are correct.

--

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



[issue13302] Clarification needed in C API arg parsing

2012-01-01 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b2b7104691c9 by Sandro Tosi in branch '2.7':
Issue #13302: backport part of 3ed28f28466f
http://hg.python.org/cpython/rev/b2b7104691c9

--
nosy: +python-dev

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



[issue13302] Clarification needed in C API arg parsing

2012-01-01 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Thanks Antoine for the pointer.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
versions:  -Python 3.2, Python 3.3

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



[issue2481] locale.strxfrm does not work with Unicode strings

2012-01-01 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

saurik: can you propose a patch?

--

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-01-01 Thread Matt Joiner

New submission from Matt Joiner anacro...@gmail.com:

Patch attached

--
components: Library (Lib)
files: dispatcher_connect_addr.patch
keywords: patch
messages: 150449
nosy: anacrolix
priority: normal
severity: normal
status: open
title: asynchronous connect in asyncore.dispatcher does not set addr
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24124/dispatcher_connect_addr.patch

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



[issue2481] locale.strxfrm does not work with Unicode strings

2012-01-01 Thread Jay Freeman (saurik)

Jay Freeman (saurik) sau...@saurik.com added the comment:

I have attached a tested patch against Python-2.7.2.tgz (as I do not know how 
to use hg currently). It should be noted that I also am not 100% certain how 
the Python build environment works, but the way I added the wcsxfrm test was to 
add it to configure.in, then run autoheader and autoconf.

It also should be noted that the original code called strxfrm and did not check 
for an error result: neither does my new code (which is mostly based on 
formulaic modifications of the existing code in addition to educated guesses 
with regards to coding and formatting standards: feel free to change, 
obviously).

Finally, I noticed while working on this that --enable-unicode=no does not work 
(there is a check that enforces that it must be either ucs2 or ucs4): seems 
like an easy fix. That said, I ran into numerous other issues trying to make a 
non-Unicode build, and in the end gave up. My code looks like it should work, 
however, were someone to figure out how to build a non-Unicode Python 2.7.

--
keywords: +patch
Added file: http://bugs.python.org/file24125/wcsxfrm.diff

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



[issue13695] type specific to type-specific

2012-01-01 Thread Boštjan Mejak

New submission from Boštjan Mejak bostjan.me...@gmail.com:

Please visit the following link and fix the below text:

http://docs.python.org/library/unittest.html#unittest.TestCase.assertEqual

Changed in version 2.7: Added the automatic calling of type-specific 
equality function.

Just add the hyphen. Thanks.

--
assignee: docs@python
components: Documentation
messages: 150451
nosy: Retro, docs@python
priority: normal
severity: normal
status: open
title: type specific to type-specific
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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