MRAB wrote:
Xavier Ho wrote:
def t(a, *b = (3, 4)):
File input, line 1
def t(a, *b = (3, 4)):
^
SyntaxError: invalid syntax
What was the rationale behind this design?
The concept of a default value for the * argument doesn't
really apply, because there is always a
I am currently dealing with sparse matrices and have doubts on whether
we can use
1.) dot (for matrix multiplication) and inv (inverse) operations of
numpy on sparse matrices of CSR format.
I initially constructed my sparse matrix using COO format and then
converted it to CSR format now I want to
On Apr 17, 2:23 pm, John Nagle na...@animats.com wrote:
Is there a usable street address parser available? There are some
bad ones out there, but nothing good that I've found other than commercial
products with large databases. I don't need 100% accuracy, but I'd like
to be able to
John Nagle, 17.04.2010 21:23:
Is there a usable street address parser available?
What kind of street address are you talking about? Only US-American ones?
Because street addresses are spelled differently all over the world. Some
have house numbers, some use letters or a combination, some
Dear all,
I'm wondering why in Python's grammar, keyword arguments are specified
as:
argument: ... | test '=' test
I would have expected something like
argument: ... | NAME '=' test
Indeed, I cannot imagine a case where the keyword is something else
than an identifier. Moreover, in
Hi,
I am working in gnuradio compiler. I need some help in debugging python and c
together.
By this i mean that i have written some blocks in c that are connected together
using python. So i need to debug( breakpoints ect ) python such that when a
specific c block is called at the back end
On Sun, 18 Apr 2010 23:29:44 -0700, franck wrote:
Dear all,
I'm wondering why in Python's grammar, keyword arguments are specified
as:
argument: ... | test '=' test
Where are you finding that?
I would have expected something like
argument: ... | NAME '=' test
Indeed, I
Do I need to do something especial to get repr to work strictly
with unicode?
Yes, you need to switch to Python 3 :-)
Or should __repr__ *always* return bytes rather than unicode?
In Python 2.x: yes.
What about __str__ ?
Likewise.
If both of these are supposed to return bytes,
then
Does any one knows why the grammar is so coded? Any intuition?
The 2.7 Grammar clarifies that:
# The reason that keywords are test nodes instead of NAME is that using
# NAME results in an ambiguity. ast.c makes sure it's a NAME.
argument: test [comp_for] | test '=' test
The ambiguity is this:
On 4/18/2010 7:23 PM, Xavier Ho wrote:
G'day Pythoneers,
I ran into a strange problem today: why does Python not allow default
paranmeters for packed arguments in a function def?
def test(a = 1, b = (2, 3)):
... print a, b
...
test()
1 (2, 3)
def t(a, *b = (3, 4)):
File input,
Thank you for this very clear (and quick) explanation! :-)
Cheers,
Franck
On 19 avr, 08:58, Martin v. Loewis mar...@v.loewis.de wrote:
# The reason that keywords are test nodes instead of NAME is that using
# NAME results in an ambiguity. ast.c makes sure it's a NAME.
argument: test
argument: ... | test '=' test
Where are you finding that?
This comes from Python-2.6/Grammar/Grammar in the source distribution.
This tells you that keyword arguments cannot have keywords that aren't
identifiers:
sum(1=2)
File stdin, line 1
SyntaxError: keyword can't be an
I tried csr_matrix.dot(A,N) where A and N are two sparse matrices.
is it correct for multiplication of two sparse matrices ?
I still do not now how to perform matrix inversion for a sparse
matrix. Can anyone please help.
Thanks!!
On Apr 19, 12:03 am, pp parul.pande...@gmail.com wrote:
I am
hi,
i am using ubuntu 9.10. it comes with preinstalled python2.6 having no debug
symbols.How can i add debug symbols to it. Secondly i cant afford to install a
fresh python version using OPT=-g way. Please tell me how can i add symbols to
existing python2.6.
The error that i get in gdb when i
Hi,
I am working in gnuradio compiler. I need some help in debugging python and c
together.
By this i mean that i have written some blocks in c that are connected
together using python. So i need to debug
( breakpoints ect ) python such that when a specific c block is called at the
back end
Dave Angel da...@ieee.org wrote:
2) In original C, and I think in C++, the lifetime of i lasted long
after the loop ended.
for (int i=0; i limit; ++i)
{
z += i;
}
i is still valid after this curly brace
In C99, and at least in later C++, the scope of i
Hi all,
I am passing a ctypes struct byref to a dll. When I get the struct
back, it looks like the char array in the struct was truncated at the
first null char. It should be 192 bytes long, but I know the 3rd
through 6th byte are null chars and the array was truncated right
before byte 3.
Is
After at least 3 false starts on my programming introduction's chapter 3, and
some good and bad feedback from this group[1], I finally think the present
chapter 3 approach is Good (enough).
So no, I haven't given up in this book project, even though 4 months to produce
these chapter 3's first
Alexander wrote:
On 17.04.2010 18:32, Steven D'Aprano wrote:
On Sat, 17 Apr 2010 13:09:43 +0400, Alexander wrote:
Hi, list.
I've some nontrivial class implementation MyClass and its instance my:
my = MyClass(args)
MyClass uses in internals some variable which is not defined in
Hi friends,
I want to program Python to copy some video files (.flv) from the IE folder
temporary internet files, but
os.listdir('C:\\Documents and Settings\\Administrator\\Local
Settings\\Temporary Internet Files')
seemed unable to find any video file (although they really exist and can
Hi All,
I am working on porting python on vxworks and hence was updating the PC
\pyconfig.h file for configurng python. As I am reading the file and
updating manually I come across lot many preprocessor directives which
I dont understand e.g. HAVE_NICE etc. May be this is standard
nomenclature
Le Sun, 18 Apr 2010 22:37:30 -0700, John Nagle a écrit :
The cert file is the same PEM file I use with M2Crypto, and it's derived
from Firefox's cert file.
Why am I getting a private key related error? I'm not submitting a
keyfile, just a cert file.
I'm not an expert but this is what the
Hi,
You need to install the python debugging packages for your ubuntu version. I
guess its python-dbg
Regards,
Shaunak
2010/4/19 sanam singh sanamsi...@hotmail.com
hi,
i am using ubuntu 9.10. it comes with preinstalled python2.6 having no
debug symbols.How can i add debug symbols to it.
On 30 March 2010 18:40, gentlestone tibor.b...@hotmail.com wrote:
Hi, how can I write the popular C/JAVA syntax in Python?
Java example:
return (a==b) ? 'Yes' : 'No'
My first idea is:
return ('No','Yes')[bool(a==b)]
Is there a more elegant/common python expression for this?
I'm a
Hi,
just a quick one,
Is it possible to achieve a default value in a list comprehension
where the if-clause is false?
Ie, something similar to:
[ a for a in b if something(a) else 'default' ]
the idea being that, rather than skip a value if the if-clause is
false, to place a default value at
On Apr 19, 2:20 pm, AlienBaby matt.j.war...@gmail.com wrote:
Hi,
just a quick one,
Is it possible to achieve a default value in a list comprehension
where the if-clause is false?
Ie, something similar to:
[ a for a in b if something(a) else 'default' ]
the idea being that, rather than
On 19/04/2010 10:49, CHEN Guang wrote:
Hi friends,
I want to program Python to copy some video files (.flv) from the IE folder
temporary internet files, but
os.listdir('C:\\Documents and Settings\\Administrator\\Local
Settings\\Temporary Internet Files')
seemed unable to find any video file
On Apr 19, 1:23 pm, eb303 eric.brunel.pragma...@gmail.com wrote:
On Apr 19, 2:20 pm, AlienBaby matt.j.war...@gmail.com wrote:
Hi,
just a quick one,
Is it possible to achieve a default value in a list comprehension
where the if-clause is false?
Ie, something similar to:
[ a
i have this code
def example(a):
return lambda b: a+b+1
fun = example(10)
k_1 = fun(7)
...
and pylint tells me
[...]
C: 4: Invalid name fun (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 5: Invalid name k_1 (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
[...]
afaict, [A-Z_][A-Z0-9_]*
handler = urllib2.urlopen(req) is taking way too much time to retrieve
the URL. The same code using sockets in PHP doesn't delay this long.
I had 'Authorization':'Basic ' + base64.b64encode(username:password)
in my header though.
[ I didnt use HTTPPasswordMgr HTTPPasswordMgrWithDefaultRealm
Hi,
Thanks for your reply. well the problem is that for gfb you need a python
interpreter with debugging symbols, but unfortunately as i am using ubuntu9.10
it has python2.6 without debugging symbols. now there are two ways out of
it.first is that if we could add debug symbols to pre installed
Dynamic Languages Symposium 2010
October 18, 2010
Co-located with SPLASH (OOPSLA) 2010
In cooperation with ACM SIGPLAN
John Ascuaga's Nugget, Reno/Tahoe, Nevada, USA
http://www.dynamic-languages-symposium.org/dls-10/
* Call for papers *
The 6th Dynamic Languages Symposium (DLS) at the
top level variables in real code are often constants and pylint tries to help
you get rid of global variables.
---
frmsrcurl:
http://compgroups.net/comp.lang.python/-pylint-why-pylint-wants-only-capitals-identifiers
--
http://mail.python.org/mailman/listinfo/python-list
Gilles Ganault a écrit :
On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers
bruno.42.desthuilli...@websiteburo.invalid wrote:
The PHP execution model (mostly based on CGI FWIW) tends to be a bit
unpractical for non-trivial applications since you have to rebuild the
whole world for each
eb303 a écrit :
On Apr 19, 2:20 pm, AlienBaby matt.j.war...@gmail.com wrote:
Hi,
just a quick one,
Is it possible to achieve a default value in a list comprehension
where the if-clause is false?
Ie, something similar to:
[ a for a in b if something(a) else 'default' ]
the idea being that,
Change PATH and LD_LIBRARY_PATH variable to use /usr/local instead of /usr
2010/4/19 sanam singh sanamsi...@hotmail.com
Hi,
Thanks for your reply. well the problem is that for gfb you need a python
interpreter with debugging symbols, but unfortunately as i am using
ubuntu9.10 it has
Hello,
I live in Paris, my roommate and I would gladly host a poor soul
blocked at the airport due to the ash cloud.
See me for details,
Cheers,
PS: disambiguation: talking about real physical cloud here... :)
--
http://mail.python.org/mailman/listinfo/python-list
Giacomo Boffi wrote:
i have this code
def example(a):
return lambda b: a+b+1
fun = example(10)
k_1 = fun(7)
...
and pylint tells me
[...]
C: 4: Invalid name fun (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 5: Invalid name k_1 (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
[...]
First, before I get farther,
Is there a way for the logging module to natively handle lists and
dict objects when logging?
e.g. take this {'key1':'val1','key2':'val2'} and have it logged like this:
INFO: key1: val1
INFO: key2: val2
If I pass the dict or list directly to the logger, it is
chris cannady booo...@gmail.com wrote in message
news:b103e85a-05d5-4195-a18f-bd143e9f5...@b33g2000yqc.googlegroups.com...
Hi all,
I am passing a ctypes struct byref to a dll. When I get the struct
back, it looks like the char array in the struct was truncated at the
first null char. It
On 18.04.2010 13:23, Steven D'Aprano wrote:
On Sat, 17 Apr 2010 19:55:44 +0400, Alexander wrote:
Ok, I'll try to explain on the following example. Let's consider class
MyClass that holds one string and concatenate it with other not defined
in this class:
[...]
and with
Oltmans rolf.oltm...@gmail.com writes:
Greetings Python superstars,
I've a directory structure like following
tests /
__init__.py
testfile.py
testfile.py contains following code
import unittest
class Calculator(unittest.TestCase):
def test_add(self):
print
Jean-Michel Pichavant jeanmic...@sequans.com writes:
Giacomo Boffi wrote:
i have this code
def example(a):
return lambda b: a+b+1
fun = example(10)
k_1 = fun(7)
...
and pylint tells me
[...]
C: 4: Invalid name fun (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 5: Invalid
Giacomo Boffi giacomo.bo...@polimi.it writes:
However, given you example, you should not insert code execution at
you module level, unless it's required only at the module import. I
dont know what is your module
module? this was not well specified in my OP, but i'd rather speak of
a script
hello,
I want to use Python to give users the possibility to analyze data and
create their custom reports.
So I want a very simple language definition for the user, like :
- the script must be case-insensitive
- user-words are automatically translated into function names
- users strings, should
I have been fighting the same bug for weeks now with zero success: I
am trying to get images to come up on my buttons, but they are way too
small. Regardless of whether I used my old Python 2.5.1 or now 2.6.5,
the following code:
'''Minesweeper.'''
from Tkinter import *
Antoine Pitrou wrote:
Perhaps you are using the wrong parameters and looking for ca_certs
instead:
That's right. Thanks.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Giacomo Boffi wrote:
Jean-Michel Pichavant jeanmic...@sequans.com writes:
Giacomo Boffi wrote:
i have this code
def example(a):
return lambda b: a+b+1
fun = example(10)
k_1 = fun(7)
...
and pylint tells me
[...]
C: 4: Invalid name fun (should match
I'm converting some code from M2Crypto to the new ssl module, and
I've found what looks like a security hole. The ssl module will
validate the certificate chain, but it doesn't check that the certificate
is valid for the domain.
Here's the basic code:
sk =
Tkinter scrollbar widget's background and relief options seem not
work.
The below is the codes I tried and the python/tk information:
===
ActivePython 2.6.4.8 (ActiveState Software Inc.) based on
Python 2.6.4 (r264:75706, Nov 3 2009, 13:23:17) [MSC v.1500 32 bit
(Intel)] on
On 04:51 pm, na...@animats.com wrote:
I'm converting some code from M2Crypto to the new ssl module, and
I've found what looks like a security hole. The ssl module will
validate the certificate chain, but it doesn't check that the
certificate
is valid for the domain.
Here's the basic
In hqguja$t...@online.de Martin v. Loewis mar...@v.loewis.de writes:
Do I need to do something especial to get repr to work strictly
with unicode?
Yes, you need to switch to Python 3 :-)
Or should __repr__ *always* return bytes rather than unicode?
In Python 2.x: yes.
What about __str__ ?
I installed scipy (and all the required libraries) and the following error
appears when i tried run a simple example which uses the optimize package of
scipy. I tried also numpy alone and it works ( at least for printing
numpy.array([10,20,10]))
error:
Traceback (most recent call last):
File
exar...@twistedmatrix.com wrote:
On 04:51 pm, na...@animats.com wrote:
I'm converting some code from M2Crypto to the new ssl module, and
I've found what looks like a security hole. The ssl module will
validate the certificate chain, but it doesn't check that the certificate
is valid for the
On Apr 19, 7:15 pm, gerardob gberbeg...@gmail.com wrote:
I installed scipy (and all the required libraries) and the following error
appears when i tried run a simple example which uses the optimize package of
scipy. I tried also numpy alone and it works ( at least for printing
On Mon, Apr 19, 2010 at 1:49 PM, John Nagle na...@animats.com wrote:
exar...@twistedmatrix.com wrote:
On 04:51 pm, na...@animats.com wrote:
I'm converting some code from M2Crypto to the new ssl module, and
I've found what looks like a security hole. The ssl module will
validate the
On 4/19/10 1:03 AM, pp wrote:
I am currently dealing with sparse matrices and have doubts on whether
we can use
1.) dot (for matrix multiplication) and inv (inverse) operations of
numpy on sparse matrices of CSR format.
I initially constructed my sparse matrix using COO format and then
On 4/19/10 12:15 PM, gerardob wrote:
I installed scipy (and all the required libraries) and the following error
appears when i tried run a simple example which uses the optimize package of
scipy. I tried also numpy alone and it works ( at least for printing
numpy.array([10,20,10]))
error:
On 05:49 pm, na...@animats.com wrote:
exar...@twistedmatrix.com wrote:
On 04:51 pm, na...@animats.com wrote:
I'm converting some code from M2Crypto to the new ssl module,
and
I've found what looks like a security hole. The ssl module will
validate the certificate chain, but it doesn't
omnia neo wrote:
Hi All,
I am working on porting python on vxworks and hence was updating the PC
\pyconfig.h file for configurng python. As I am reading the file and
updating manually I come across lot many preprocessor directives which
I dont understand e.g. HAVE_NICE etc. May be this is
I am trying to create a list of consisting of multiple instances of the
same class, The Problems i am having is that i seem to be accessing the
same memory.. How should i solve this Python problem ?
Here is some sample code demonstraing my problem (same memory) :
from copy import copy as cp
On Tue, Apr 20, 2010 at 7:21 AM, Robert Somerville
rsomervi...@sjgeophysics.com wrote:
class ctest():
x = int
y = [1,2,3]
Variables defined directly under the class are known as static variables
in many other languages. Here in Python it's called a class variable, but
they're still the
On Mon, Apr 19, 2010 at 2:29 PM, Xavier Ho cont...@xavierho.com wrote:
On Tue, Apr 20, 2010 at 7:21 AM, Robert Somerville
rsomervi...@sjgeophysics.com wrote:
class ctest():
x = int
y = [1,2,3]
Variables defined directly under the class are known as static variables
in many other
Hi,
I released Oktest 0.2.1.
homepage: http://packages.python.org/Oktest/
download: http://pypi.python.org/pypi/Oktest/
repository: http://bitbucket.org/kwatch/oktest/
Oktest is a new-style testing library for Python.
from oktest import ok
ok (x) 0 # same as
On Tue, Apr 20, 2010 at 7:38 AM, Chris Rebert c...@rebertia.com wrote:
Additionally, `self.x = int` might not do what you thought it does. It
does *not* create a new instance variable of type 'int'. Instead, it
literally assigns to a new instance variable x the *function*† that
converts
On Mon, Apr 19, 2010 at 3:41 PM, Xavier Ho cont...@xavierho.com wrote:
On Tue, Apr 20, 2010 at 7:38 AM, Chris Rebert c...@rebertia.com wrote:
Additionally, `self.x = int` might not do what you thought it does. It
does *not* create a new instance variable of type 'int'. Instead, it
literally
From: Vlastimil Brom vlastimil.b...@gmail.com
Date: 2010/4/16
Subject: unexpected output from difflib.SequenceMatcher
...
Instead of just reporting the insertion and deletion of these single
characters ... the output of the
SequenceMatcher decides to delete a large part of the string in
between
On Apr 17, 11:52 am, Jonathan Hartley tart...@tartley.com wrote:
On Apr 16, 5:59 pm, Lie Ryan lie.1...@gmail.com wrote:
On 04/16/10 19:28, Jonathan Hartley wrote:
I'm playing with ideas of what API to expose. My favourite one is to
simply embed ANSI codes in the stream to be printed.
i know it's not very hard to get that solution.
just by implementing simple function like below.
def partition(target, predicate):
split a list into two partitions with a predicate
provided.
any better ideas? :)
true = []
On Mon, Apr 19, 2010 at 6:00 PM, knifenomad knifeno...@gmail.com wrote:
i know it's not very hard to get that solution.
just by implementing simple function like below.
def partition(target, predicate):
split a list into two partitions with a predicate
provided.
On 4월20일, 오전10시16분, Chris Rebert c...@rebertia.com wrote:
On Mon, Apr 19, 2010 at 6:00 PM, knifenomad knifeno...@gmail.com wrote:
i know it's not very hard to get that solution.
just by implementing simple function like below.
def partition(target, predicate):
gb345 wrote:
In hqguja$t...@online.de Martin v. Loewis mar...@v.loewis.de writes:
Do I need to do something especial to get repr to work strictly
with unicode?
Yes, you need to switch to Python 3 :-)
Or should __repr__ *always* return bytes rather than unicode?
Hello!
Is it assured the following statement is always True?
If it is always True, in which version, python2.x or python3.x?
a = dict()
...
assert(a.values == [a[k] for k in a.keys()])
-- ?
Menghan Zheng
--
http://mail.python.org/mailman/listinfo/python-list
exar...@twistedmatrix.com wrote:
On 05:49 pm, na...@animats.com wrote:
exar...@twistedmatrix.com wrote:
On 04:51 pm, na...@animats.com wrote:
I'm converting some code from M2Crypto to the new ssl module, and
I've found what looks like a security hole. The ssl module will
validate the
On 20Apr2010 11:03, Menghan Zheng menghan...@gmail.com wrote:
| Is it assured the following statement is always True?
| If it is always True, in which version, python2.x or python3.x?
|
| a = dict()
| ...
| assert(a.values == [a[k] for k in a.keys()])
| -- ?
It is always true. At this URL:
On Apr 20, 1:03 pm, Menghan Zheng menghan...@gmail.com wrote:
Is it assured the following statement is always True?
If it is always True, in which version, python2.x or python3.x?
I believe its an implementation detail and should not be relied on. If
you need consistent ordering, use an
On Tue, Apr 20, 2010 at 3:40 AM, segunai osk@gmail.com wrote:
On 4월20일, 오전10시16분, Chris Rebert c...@rebertia.com wrote:
On Mon, Apr 19, 2010 at 6:00 PM, knifenomad knifeno...@gmail.com wrote:
i know it's not very hard to get that solution.
just by implementing simple function like below.
Cameron Simpson c...@zip.com.au wrote:
If items(), keys(), values(), iteritems(), iterkeys(), and
itervalues() are called with no intervening modifications to the
dictionary, the lists will directly correspond. This allows the
creation of (value, key) pairs using zip(): pairs =
John Nagle wrote:
Is there a usable street address parser available? There are some
bad ones out there, but nothing good that I've found other than commercial
products with large databases. I don't need 100% accuracy, but I'd like
to be able to extract street name and street number for at
On 19Apr2010 21:31, alex23 wuwe...@gmail.com wrote:
| Cameron Simpson c...@zip.com.au wrote:
| If items(), keys(), values(), iteritems(), iterkeys(), and
| itervalues() are called with no intervening modifications to the
| dictionary, the lists will directly correspond. This allows the
|
New submission from Martin v. Löwis mar...@v.loewis.de:
The current build_installer fails to build dependencies, e.g. with
gcc-4.0 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o
bzip2 bzip2.o -L. -lbz2
collect2: cannot find 'ld'
collect2: cannot find 'ld'
lipo: can't open
Changes by Sean Reifschneider j...@tummy.com:
Added file: http://bugs.python.org/file16983/syslog-kwargs2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8451
___
Virgil Dupras hs...@hardcoded.net added the comment:
Here's another one. I hadn't realized that it was useless to target the 2.x
codebase. So I re-worked this on py3k. The change is non-trivial, since the
non-windows/non-os2 part of the code has significantly changed in 3k. This
time, since
failures
To: python-bugs-list@python.org
From: STINNER Victor rep...@bugs.python.org
Date: Sun, 18 Apr 2010 23:17:46 +
Precedence: bulk
X-Roundup-Name: Python tracker
X-Roundup-Loop: hello
X-Roundup-Version: 1.4.10
Reply-To: Python tracker rep...@bugs.python.org
Message-Id:
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
It does not work on Windows:
subprocess.Popen(c:/windows/notepad.exe, cwd=b'c:/temp')
Traceback (most recent call last):
File stdin, line 1, in module
File D:\afa\python\py3k-1\lib\subprocess.py, line 681, in __init__
Ezio Melotti ezio.melo...@gmail.com added the comment:
The 'See also' in the documentation should also be updated:
http://docs.python.org/dev/library/urlparse.html#urlparse.urldefrag
--
nosy: +ezio.melotti
priority: - normal
status: closed - open
versions: +Python 3.2 -Python 3.0
Marc-Andre Lemburg m...@egenix.com added the comment:
STINNER Victor wrote:
STINNER Victor victor.stin...@haypocalc.com added the comment:
I think it would be best to backport the handler (even though
it is not needed in Python 2.7), since it makes porting apps
to 3.x easier.
Ezio Melotti ezio.melo...@gmail.com added the comment:
I consider this an important missing backport for 2.7, since
without this handler, the UTF-8 codecs in 2.7 and 3.x are
incompatible and there's no other way to work around this
other than to make use of the errorhandler conditionally
STINNER Victor victor.stin...@haypocalc.com added the comment:
And please add unit tests...
I'm thinking on this. I plan to write tests for all my last changes about
surrogates.
--
___
Python tracker rep...@bugs.python.org
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
It does not work on Windows:
ctypes.CDLL(b'kernel32')
Traceback (most recent call last):
File stdin, line 1, in module
File D:\afa\python\py3k-1\lib\ctypes\__init__.py, line 350, in __init__
self._handle = _dlopen(self._name,
STINNER Victor victor.stin...@haypocalc.com added the comment:
It does not work on Windows
I always consider Windows as a special case because Windows uses unicode
internally. Byte string are converted quickly to unicode using the current
locale.
My patch was for UNIX/BSD which uses byte
STINNER Victor victor.stin...@haypocalc.com added the comment:
load_library() uses LoadLibraryW() which use a WCHAR*. To support bytes, we can
use LoadLibraryA() and TCHAR*.
--
___
Python tracker rep...@bugs.python.org
Marc-Andre Lemburg m...@egenix.com added the comment:
Ezio Melotti wrote:
Ezio Melotti ezio.melo...@gmail.com added the comment:
I consider this an important missing backport for 2.7, since
without this handler, the UTF-8 codecs in 2.7 and 3.x are
incompatible and there's no other way to
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
PEP 277 explicitly states that unicode strings should be passed to
wide-character functions, whereas byte strings use standard functions.
This is done in posixmodule.c, for example.
The current locale is a moving thing.
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
I only fixed UNIX/BSD versions of subprocess/ctypes.dlopen() because it's not
possible to open some files with an undecodable filename. On Windows, the file
system and Python3 use Unicode, and so there is no such corner case.
On
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
yes, except that TCHAR* depends on compilation settings (it resolves to wchar_t
when UNICODE is #defined); simply use char*.
--
___
Python tracker rep...@bugs.python.org
Ned Deily n...@acm.org added the comment:
Odd, works for me on 10.4, 10.5, and 10.6 (but I have never tried running under
buildbot, if that is what is happening here).
For 10.4 with its most-recent Xcode installed:
$ /usr/bin/ld -v
Apple Computer, Inc. version cctools-622.9~2
$ /usr/bin/gcc
STINNER Victor victor.stin...@haypocalc.com added the comment:
PEP 277 explicitly states that unicode strings should be passed to
wide-character functions, whereas byte strings use standard
functions. This is done in posixmodule.c, for example.
CreateProcessW takes a lot of arguments.
Antoine Pitrou pit...@free.fr added the comment:
Some notes about the patch:
- NEWS blurbs generally appear antichronologically, that is newest first :-)
- you don't have to mention that The 3.2 changes mentioned above are included
in 2.7
- the part of the PyArg_ParseTupleAndKeywords string
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Also, _POSIX_SEMAPHORES must be defined to be greater than 200112L. If it
isn't, then it isn't supported.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8410
1 - 100 of 218 matches
Mail list logo