Hi All
How can we generate a 6 digit random number from a given number ?
eg:-
def number_generator(id):
random.randint(id,99)
When i am using this it is sometimes giving me five digit and sometimes 6 .
I want to avoid encryption . Can i have alphanumeric 6 digit random number
from this
If you want it as an int:
random.randint(10, 99)
Or as a string:
s = '%06d' % random.randint(0, 99)
On Mon, Mar 26, 2012 at 2:08 AM, Nikhil Verma varma.nikhi...@gmail.comwrote:
Hi All
How can we generate a 6 digit random number from a given number ?
eg:-
def
On Mon, Mar 26, 2012 at 5:08 PM, Nikhil Verma varma.nikhi...@gmail.com wrote:
Hi All
How can we generate a 6 digit random number from a given number ?
eg:-
def number_generator(id):
random.randint(id,99)
When i am using this it is sometimes giving me five digit and sometimes 6 .
* Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]:
Hi All
How can we generate a 6 digit random number from a given number ?
what about this?
given_number=123456
def rand_given_number(x):
... s = list(str(x))
... random.shuffle(s)
... return int(''.join(s))
...
print
Hi
I want something to achieve like this :-
def random_number(id): # I am passing it from request
# do something
return random_number
Output
random_number(5)
AXR670
One input that is a number in return you are getting 6 digit alphanumeric
string.
I tried this
s = '%06d' %
Hi, All
I'm working with a small program to realize P2P file transfer.
Therefore, I have to accomplish the function of NAT traversal. From
the searching result, I know that it always requires a public server
to initialize the transfer, but I don't have one. Now, my idea is
that, we already have
On 26.03.2012, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wroted:
How can we generate a 6 digit random number from a given number ?
what about this?
given_number=123456
def rand_given_number(x):
... s = list(str(x))
... random.shuffle(s)
... return int(''.join(s))
Nikhil Verma wrote:
I want something to achieve like this :-
def random_number(id): # I am passing it from request
# do something
return random_number
Output
random_number(5)
AXR670
That's normally not called a number (though it could be base 36 or similar).
One input
From: MRAB pyt...@mrabarnett.plus.com
To: python-list@python.org
Cc:
Date: Sun, 25 Mar 2012 22:14:28 +0100
Subject: Re: bdb.Bdb (Debugger Base Class) / unittest Interaction
On 25/03/2012 21:42, Ami Tavory wrote:
Hello,
I'm having some difficulties with the interaction between bdb.Bdb and
On Sun, Mar 25, 2012 at 11:16 AM, Kiuhnm
kiuhnm03.4t.yahoo...@mail.python.org wrote:
On 3/25/2012 15:48, Tim Chase wrote:
The old curmudgeon in me likes the Pascal method of using = for
equality-testing, and := for assignment which feels a little closer to
mathematical use of =.
* Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:49]:
Hi
I want something to achieve like this :-
def random_number(id): # I am passing it from request
# do something
return random_number
Output
random_number(5)
AXR670
One input that is a number in return you are
Kiuhnm wrote:
[snip]
numbers - push - avrg - 'med' - pop - filter(lt('med'), ge('med'))\
- ['same', 'same'] - streams(cat) - 'same'
It reads as
take a list of numbers - save it - compute the average and named it
'med' - restore the flow - create two streams which have, respect.,
the
On 3/26/12 8:50 AM, Grzegorz Staniak wrote:
On 26.03.2012, Steven D'Apranosteve+comp.lang.pyt...@pearwood.info wroted:
How can we generate a 6 digit random number from a given number ?
what about this?
given_number=123456
def rand_given_number(x):
... s = list(str(x))
...
Jon Clements wrote:
On Wednesday, 14 March 2012 13:28:58 UTC, Cosmia Luna wrote:
class Foo(object):
def bar(self):
return 'Something'
func = Foo().bar
if type(func) == type 'instancemethod': # This should be always true
pass # do something here
What should type at type
Hi
Thanks Michael I want exactly wanted this. Great
def random_number(id)
...characters = list(string.ascii_lowercase +string.ascii_uppercase
+string.digits)
I used this this earlier and tried then by using choice .
This is great.
On Mon, Mar 26, 2012 at 2:54 PM, Michael Poeltl
On 3/26/12 10:45 AM, Nikhil Verma wrote:
Hi
Thanks Michael I want exactly wanted this. Great
def random_number(id)
...characters = list(string.ascii_lowercase +string.ascii_uppercase
+string.digits)
I used this this earlier and tried then by using choice .
This is great.
Note that
On 03/25/12 17:59, Dennis Lee Bieber wrote:
On Sun, 25 Mar 2012 08:48:31 -0500, Tim Chase
Yeah, it has the same structure internally, but I'm somewhat
surprised that the DB connection object doesn't have an
__iter__() that does something like this automatically under the
covers.
I
On 3/26/2012 10:52, Devin Jeanpierre wrote:
On Sun, Mar 25, 2012 at 11:16 AM, Kiuhnm
kiuhnm03.4t.yahoo...@mail.python.org wrote:
On 3/25/2012 15:48, Tim Chase wrote:
The old curmudgeon in me likes the Pascal method of using = for
equality-testing, and := for assignment which feels a little
Kiuhnm writes:
On 3/26/2012 10:52, Devin Jeanpierre wrote:
On Sun, Mar 25, 2012 at 11:16 AM, Kiuhnm
kiuhnm03.4t.yahoo...@mail.python.org wrote:
On 3/25/2012 15:48, Tim Chase wrote:
The old curmudgeon in me likes the Pascal method of using = for
equality-testing, and := for assignment
Dennis Lee Bieber wrote:
On Sun, 25 Mar 2012 19:09:12 -0400, mwil...@the-wire.com declaimed the
following in gmane.comp.python.general:
Most of my database programs wind up having the boilerplate (not tested):
def rowsof (cursor):
names = [x[0] for x in cursor.description]
r =
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference between
print 3 and print '3' in Python ?
--
http://mail.python.org/mailman/listinfo/python-list
On 3/26/2012 11:27, Jean-Michel Pichavant wrote:
Kiuhnm wrote:
[snip]
numbers - push - avrg - 'med' - pop - filter(lt('med'), ge('med'))\
- ['same', 'same'] - streams(cat) - 'same'
It reads as
take a list of numbers - save it - compute the average and named it
'med' - restore the flow -
On 3/26/2012 13:13, Jussi Piitulainen wrote:
Kiuhnm writes:
On 3/26/2012 10:52, Devin Jeanpierre wrote:
On Sun, Mar 25, 2012 at 11:16 AM, Kiuhnm
kiuhnm03.4t.yahoo...@mail.python.org wrote:
On 3/25/2012 15:48, Tim Chase wrote:
The old curmudgeon in me likes the Pascal method of using = for
On Mon, Mar 26, 2012 at 10:45 PM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference
between print 3 and print '3' in Python ?
One of them takes the integer 3,
In FiPy (a finite volume PDE solver), equations are magically set up as
eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D)
and solved via
eqX.solve(...)
How can eqX be anything than True or False?... This must be via a redefinition
of == but I can't see how that is done. I did look at
On 3/26/2012 13:45, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of
these two instructions are executed ,I just want to know Is there any
difference between print 3 and print '3' in Python ?
The former prints a number while the latter a string.
On 03/26/2012 07:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference between
print 3 and print '3' in Python ?
This is a non-question. The input is the same, the
On 3/26/12 12:45 PM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference between
print 3 and print '3' in Python ?
Yes, there is a difference, but not much.
[~]
|6
On 3/26/12 12:47 PM, André Roberge wrote:
In FiPy (a finite volume PDE solver), equations are magically set up as
eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D)
and solved via
eqX.solve(...)
How can eqX be anything than True or False?... This must be via a redefinition of ==
but I
On Monday, 26 March 2012 09:16:07 UTC-3, Robert Kern wrote:
On 3/26/12 12:47 PM, André Roberge wrote:
In FiPy (a finite volume PDE solver), equations are magically set up as
eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D)
and solved via
eqX.solve(...)
How can eqX be
Kiuhnm wrote:
Why do you write
// Print the number of words...
def printNumWords(): ...
and not
// Prints the number of words...
def printNumWords(): ...
where it is understood?
Is that an imperative or a base form or something else?
Kiuhnm
http://www.python.org/dev/peps/pep-0257/
Hi,
I am learning Python and do not have programming experience.
I was following an exercise from
http://learnpythonthehardway.org/book/ex2.html
and made a mistake in entry :
*PrintI like typing this.*
and got the following error message:
*In [2]: PrintI like typing this.*
Aloke Ghosh wrote:
Hi,
I am learning Python and do not have programming experience.
I was following
an exercise from http://learnpythonthehardway.org/book/ex2.html
and made a mistake in entry :
*PrintI like typing this.*
and got the following error message:
*In [2]: PrintI like typing
I created a new class called CaseInsensitiveDict (by stealing from code I
found on the web, thank you very much). The new class inherits from dict. It
makes it so that if the key has a 'lower' method, it will always access the
key using lower
I'd like to change the place where I previously
On 3/26/12 2:33 PM, Steven W. Orr wrote:
I created a new class called CaseInsensitiveDict (by stealing from code I found
on the web, thank you very much). The new class inherits from dict. It makes it
so that if the key has a 'lower' method, it will always access the key using
lower
I'd like
On Mar 26, 2012 12:28 AM, Steven Dapos;Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Mon, 26 Mar 2012 08:40:00 +0200, Michael Poeltl wrote:
* Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]:
A truly random six digit number will include any number between 10
through
Am 25.03.2012 15:03 schrieb Tim Chase:
Perhaps a DB example
works better. With assignment allowed in an evaluation, you'd be able to
write
while data = conn.fetchmany():
for row in data:
process(row)
whereas you have to write
while True:
data = conn.fetchmany()
if not
Am 26.03.2012 00:59 schrieb Dennis Lee Bieber:
If you use the longer form
con = db.connect()
cur = con.cursor()
the cursor object, in all that I've worked with, does function for
iteration
I use this form regularly with MySQLdb and am now surprised to see that
this is optional according to
在 2012年3月26日星期一UTC+8下午8时11分03秒,Dave Angel写道:
On 03/26/2012 07:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference
between print 3 and print '3' in Python ?
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference
between print 3 and print '3' in Python ?
Sure there is. The first converts the integer 3 to a string (3), the second
just prints the given
On Sunday, March 25, 2012 6:22:10 PM UTC-6, Ben Finney wrote:
jeff writes:
On Sunday, March 25, 2012 4:04:55 PM UTC-6, Heiko Wundram wrote:
Am 25.03.2012 23:32, schrieb jeff:
but I have to be able to get back to root privilege so I can't use
setgid and setuid.
Simply not
redstone-c...@163.com, 26.03.2012 16:28:
在 2012年3月26日星期一UTC+8下午8时11分03秒,Dave Angel写道:
On 03/26/2012 07:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference
On 3/26/2012 9:44 AM, Robert Kern wrote:
On 3/26/12 2:33 PM, Steven W. Orr wrote:
I created a new class called CaseInsensitiveDict (by stealing from code I found
on the web, thank you very much). The new class inherits from dict. It makes it
so that if the key has a 'lower' method, it will
On 3/26/2012 12:59 AM, Mensanator wrote:
OK, GMPY is now called GMPY2. No big deal, I can import as GMPY.
But why were scan0 and scan1 changed to bit_scan0 and bit_scan1?
Guess: Either the functions changed or they want to regularize their names.
What's the justification for that? I use
On 3/26/2012 7:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of
these two instructions are executed ,I just want to know Is there any
difference between print 3 and print '3' in Python ?
If you want to see the difference between the number
On 3/26/12 4:33 PM, Steven W. Orr wrote:
On 3/26/2012 9:44 AM, Robert Kern wrote:
On 3/26/12 2:33 PM, Steven W. Orr wrote:
I created a new class called CaseInsensitiveDict (by stealing from code I found
on the web, thank you very much). The new class inherits from dict. It makes it
so that if
On 3/26/2012 1:36 AM, Steven D'Aprano wrote:
(I seem to recall a language that used a single = for both assignment and
equality testing, guessing which one you meant from context. BASIC
perhaps?
Right. In some Basics, such as MS GW-Basic (I still have their book), a
= b = c meant a = (b =
My name is Sathyaish. I am a software engineer.
Last year, i.e. in 2011, I wanted to do some theater. No one took me,
so I announced that I would start my own group. I wrote a script.
Then, I wrote a screen play from that. Now, I am almost ready to begin
the auditions.
The play will be a comedy
On Mon, Mar 26, 2012 at 3:24 AM, Michael Poeltl
michael.poe...@univie.ac.at wrote:
import random, string
def random_number(id):
... characters = list(string.ascii_lowercase +
... string.ascii_uppercase +
... string.digits)
... coll_rand =
As others have pointed out, the output is the same, because the result
of converting an integer to a string is the string of that integer.
However, other numeric literals might not do what you want, due to the
fact that they are converted to an internal numeric representation, then
converted back
redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these two
instructions are executed ,I just want to know Is there any difference
between print 3 and print '3' in Python ?
The question you really wanted to ask is: under what circumstances will the
On 03/26/12 08:59, Thomas Rachel wrote:
Am 25.03.2012 15:03 schrieb Tim Chase:
while True:
data = conn.fetchmany()
if not data: break
for row in data:
process(row)
Or simpler
for data in iter(conn.fetchmany, []):
for row in data:
process(row)
Nice!
On Mar 26, 10:39 am, Terry Reedy tjre...@udel.edu wrote:
On 3/26/2012 12:59 AM, Mensanator wrote:
OK, GMPY is now called GMPY2. No big deal, I can import as GMPY.
But why were scan0 and scan1 changed to bit_scan0 and bit_scan1?
Guess: Either the functions changed or they want to
On Sunday, March 25, 2012 9:59:56 PM UTC-7, Mensanator wrote:
OK, GMPY is now called GMPY2. No big deal, I can import as GMPY.
But why were scan0 and scan1 changed to bit_scan0 and bit_scan1?
What's the justification for that? I use those functions extensively
in my library of Collatz
I feel the error is in Capital P in print .
However the error indicated with *^*
hints at quote at the end of the line.
Anyway, the hint indicates the last quote because this is the location
where the python interpreter realizes it won't be able to execute the
code. You should not worry
〈Perl Documentation: The Key to Perl〉
http://xahlee.org/perl-python/key_to_perl.html
plain text follows
-
So, i wanted to know what the option perl -C does. So, here's perldoc
perlrun. Excerpt:
-C [*number/list*]
The -C flag controls some
Hi,
I'm working on a module, which needs rather heavy renaming of functions
and methods
(naming style, change of functionality, understandability, orthography)
As these modules are used by quite some projects and as I do not want to
force everybody to rename immediately I just want to warn
On Mon, 26 Mar 2012 22:26:11 +0200
Gelonida N gelon...@gmail.com wrote:
As these modules are used by quite some projects and as I do not want
to force everybody to rename immediately I just want to warn users,
that they call functions, that have been renamed and that will be
obsoleted.
You
On Tue, Mar 27, 2012 at 7:26 AM, Gelonida N gelon...@gmail.com wrote:
One option I though of would be:
def obsolete_func(func):
def call_old(*args, **kwargs):
print func is old psl use new one
return func(*args, **kwargs)
return call_old
and
def get_time(a='high'):
Hi guys just wanted to share one of my first programs. Could you please
tell me, do I use a right logic ?
It works fine what I wanted to do, but is it writen in the right way? My
next step is to make it write the changes of the dictionary on the file :)
## DB
tbook = {'goodie':['Christian','Van
Hi guys just wanted to share one of my first programs. Could you please
tell me, do I use a right logic ?
It works fine what I wanted to do, but is it writen in the right way? My
next step is to make it write the changes of the dictionary on the file :)
When you do get that far, you should
Hi Guys
I am fwding this question from the python tutor list in the hope of
reaching more people experienced in concurrent disk access in python.
I am trying to see if there are ways in which I can read a big file
concurrently on a multi core server and process data and write the
output to a
〈Perl Documentation: The Key to Perl〉
http://xahlee.org/perl-python/key_to_perl.html
plain text follows
-
So, i wanted to know what the option perl -C does. So, here's perldoc
perlrun. Excerpt:
[snip]
Maybe I missed something, but what does this
Hi,
I've just uploaded pypiserver 0.5.2 to the python package index.
pypiserver is a minimal PyPI compatible server. It can be used to serve
a set of packages and eggs to easy_install or pip.
pypiserver is easy to install (i.e. just easy_install pypiserver). It
doesn't have any external
On Sat, 24 Mar 2012 16:30:28 -0700 (PDT), Xah Lee xah...@gmail.com wrote:
?Your Regex Brain?
http://xahlee.org/comp/your_regex_brain.html
That's more like a brain cell.
This is more like a regex brain.
'
img
(?=\s)
(?= (?:[^\']|[^]*|\'[^\']*\')*? (?=\s) width \s*=
(?: (? \s* ([\'])
./plot_stuff2.py --plot stuff1 stuff2
[...]
plot_stuff2.py: error: argument --plot/--with-plot/--enable-plot/--no-plot/--
without-plot/--disable-plot: invalid boolean value: 'stuff1'
Problem is --plot takes an optional argument, and so the positional arg is
assumed to be the arg to --plot.
On Mar 26, 3:56 pm, Abhishek Pratap abhishek@gmail.com wrote:
Hi Guys
I am fwding this question from the python tutor list in the hope of
reaching more people experienced in concurrent disk access in python.
I am trying to see if there are ways in which I can read a big file
Hi,
(sorry for replying to the old topic)
On Tue, Mar 6, 2012 at 10:29 PM, Javier nos...@nospam.com wrote:
I am looking for an automated tool for refactoring/obfuscation.
Something that changes names of functions, variables, or which would
merge all the functions of various modules in a
Hi all,
I'm getting close to an alpha release of an OAuth 2.0 implementation
(https://github.com/demianbrecht/py-sanction). High level features include:
* Support for multiple providers (protocol deviations). This didn't seem to be
supported by any library.
* Actually an OAuth 2.0
Demian Brecht demianbre...@gmail.com writes:
I'm getting close to an alpha release of an OAuth 2.0 implementation
(https://github.com/demianbrecht/py-sanction).
Thank you for doing this work.
As someone who uses OpenID, what can I read about why OAuth is better?
Everything I read is targeted
In article 87haxahh51@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
Demian Brecht demianbre...@gmail.com writes:
I'm getting close to an alpha release of an OAuth 2.0 implementation
(https://github.com/demianbrecht/py-sanction).
Thank you for doing this work.
As
On Mon, 26 Mar 2012 08:11:03 -0400, Dave Angel wrote:
On 03/26/2012 07:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these
two instructions are executed ,I just want to know Is there any
difference between print 3 and print '3' in Python
Roy Smith r...@panix.com writes:
In article 87haxahh51@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
As someone who uses OpenID, what can I read about why OAuth is better?
OpenID is for people who worry about things like how OpenID is different
from OAuth. Oauth is
In article 878vimhfdp@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
Roy Smith r...@panix.com writes:
In article 87haxahh51@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
As someone who uses OpenID, what can I read about why OAuth is better?
Roy Smith r...@panix.com writes:
In article 878vimhfdp@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
So, if I want to be free to choose an identity provider I trust, and
it's not Facebook or Google or Twitter or other privacy-hostile
services, how does OAuth help me
On Mar 27, 8:43 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
On Mon, 26 Mar 2012 08:11:03 -0400, Dave Angel wrote:
On 03/26/2012 07:45 AM, redstone-c...@163.com wrote:
I know the print statement produces the same result when both of these
two instructions are executed ,I
On Tue, Mar 27, 2012 at 12:24 AM, Ben Finney ben+pyt...@benfinney.id.au wrote:
Roy Smith r...@panix.com writes:
In article 878vimhfdp@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
So, if I want to be free to choose an identity provider I trust, and
it's not Facebook or
On Monday, 26 March 2012 21:24:35 UTC-7, Ben Finney wrote:
Roy Smith r...@panix.com writes:
In article 878vimhfdp@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
So, if I want to be free to choose an identity provider I trust, and
it's not Facebook or Google or
On Mar 26, 1:33 pm, cas...@gmail.com wrote:
On Sunday, March 25, 2012 9:59:56 PM UTC-7, Mensanator wrote:
OK, GMPY is now called GMPY2. No big deal, I can import as GMPY.
But why were scan0 and scan1 changed to bit_scan0 and bit_scan1?
What's the justification for that? I use those
Parand Darugar tdaru...@yahoo.com added the comment:
You're absolutely right, it's from paramiko. Apologies.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14395
___
Roger Serwy roger.se...@gmail.com added the comment:
Hi Ankit,
It looks like your configuration files for IDLE has a bug. Can you try renaming
your .idlerc directory (likely located in your home directory) to something
else and then retry using IDLE?
Also, can you post your existing
New submission from Tshepang Lekhonkhobe tshep...@gmail.com:
typo fix
--
assignee: docs@python
components: Documentation
files: typo.patch
keywords: patch
messages: 156801
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: argparse typo
type: enhancement
New submission from Tshepang Lekhonkhobe tshep...@gmail.com:
This text appeared in Lib/rlcompleter.py in 1997, so ought to be outdated:
This requires the latest extension to the readline module...
--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 156802
nosy:
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
I've just started looking at this. Nice job and good attention to detail on
the error checking. Expect to have a few high-level suggestions and a ton of
minor edits.
Here are a couple of quick thoughts:
* The comment style
Cassaigne anthony.cassai...@gmail.com added the comment:
Tanks à lot. To complete Information about this bug.
it up and take a look. The relevant code is in Python, and I'm guessing
there is some logic bug when only the comment is set (and nothing is added
to the zipfile), but I haven't looked
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I don't quite understand what you're saying about line mismatch Victor.
Anyway, if you look at it, it is clear that:
1) sys_update_path() can be called with argc==0 (main.c line 647)
2) 1742 was always setting arg0 to argv[0] that
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +michael.foord
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14408
___
___
Python-bugs-list
Stefan Krah stefan-use...@bytereef.org added the comment:
It's the line argv0 = argv[0] in sys_update_path(). The copies of
argv made in python.c aren't NULL terminated. Kristján's patch
worked around that (and fixes the problem), but I'd prefer to
make a full copy of argv in python.c.
Could
Changes by R. David Murray rdmur...@bitdance.com:
--
type: - enhancement
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14379
___
___
Stefan Krah stefan-use...@bytereef.org added the comment:
3) line 1812 assumes n to be equal to the length of arg0, but depending
on conditional compilation, it may not get set at all, and in any
case in line line 1805 it gets set only if p is not NULL.
n is initialized to 0
Matt Joiner anacro...@gmail.com added the comment:
I've fixed the commenting, and cache_info use.
I've left the element management in pure C as it reduces memory use (56 bytes
for 4 element list, vs. 16 for lru_cache_elem), and avoids ref counting
overhead (3 refs per link, plus GC). The
Changes by Matt Joiner anacro...@gmail.com:
Removed file: http://bugs.python.org/file24958/functools.lru_cache-in-c
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14373
___
New submission from Mendez goatsofmen...@users.sourceforge.net:
There appears to be a problem with the handling of integer fields in SQLite in
the 32-bit release candidate for 2.7.3.
I'm running the 64-bit version of Windows 7.
I've attached a script which reproduces the issue. The following
STINNER Victor victor.stin...@gmail.com added the comment:
Kristján's patch is wrong: n should be set to 0 even if argc 0. The
patch is also useless with argv-alloc.diff.
@Stefan: Your patch is correct and solves the issue. You can commit it
to 2.7, 3.2 and 3.3.
--
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I'm sure you didn't intend to use words such as wrong and useless Victor.
Perhaps n must be 0 even for argc0, but I did that as an afterthought. Which
is the reason I asked you to take a look rather than committing this right
Antoine Pitrou pit...@free.fr added the comment:
Can't reproduce under Linux. Can someone test under Windows?
--
components: +Library (Lib)
nosy: +benjamin.peterson, brian.curtin, pitrou, tim.golden
priority: normal - release blocker
___
Python
Stefan Krah stefan-use...@bytereef.org added the comment:
I only have the C99 standard. It says [5.1.2.2.1]:
- argv[argc] shall be a NULL pointer.
Is this different in C89?
Also, my patch terminates the *copies* of argv, not argv itself.
--
___
Stefan Krah stefan-use...@bytereef.org added the comment:
KR page 115 also says: The standard requires that argv[argc] be a NULL pointer.
So it must be in C89 as well.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3367
STINNER Victor victor.stin...@gmail.com added the comment:
New patch replacing dictproxy() builtin type with collections.mappingview()
type:
- dictproxy() type doesn't need to be a builtin type
- it is not specific to dict so replace dict prefix with mapping
- view is a better suffix than
STINNER Victor victor.stin...@gmail.com added the comment:
I'm sure you didn't intend to use words such as wrong and useless Victor.
Perhaps n must be 0 even for argc0, but I did that as an afterthought.
If n is initialized as wcslen(argv[0]), test_cmd_line_script fails.
--
1 - 100 of 209 matches
Mail list logo