Cheese Shop Registration error

A

alefnula

I tried to register on the Python Cheese Shop, but I constatnly get a
"GPG key ID is invalid" error.

I made a new GPG key using kgpg, exported the public key to the key
server, and copy/pasted the Key ID into the registration form... But it
doesn't work.
 
R

Richard Jones

I tried to register on the Python Cheese Shop, but I constatnly get a
"GPG key ID is invalid" error.

I made a new GPG key using kgpg, exported the public key to the key
server, and copy/pasted the Key ID into the registration form... But it
doesn't work.

And the key ID you were trying to paste in was?


Richard
 
A

alefnula

The Key ID that the kgpg shows. I tried to paste the key returned by
the quiery on the keyserver. but it also doesn't work. I tried
everything that has any connection with the key, but everything fails.

By the way the key is: 6A61E3AD
 
R

Richard Jones

The Key ID that the kgpg shows. I tried to paste the key returned by
the quiery on the keyserver. but it also doesn't work. I tried
everything that has any connection with the key, but everything fails.

By the way the key is: 6A61E3AD

Here is the code that could generate that error message:

if len(gpgid) != 8:
raise FormError, 'GPG key ID is invalid'
try:
int(gpgid)
except ValueError:
raise FormError, 'GPG key ID is invalid'

So I suspect there might have been some cut-n-paste error. Check that you've
not pasted in any whitespace that could confuse the first test.


Richard
 
J

John Machin

Richard said:
Here is the code that could generate that error message:

if len(gpgid) != 8:
raise FormError, 'GPG key ID is invalid'
try:
int(gpgid)

| >>> int("6A61E3AD")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 6A61E3AD
| >>> int("6A61E3AD", 16)
1784800173

What am I missing?
except ValueError:
raise FormError, 'GPG key ID is invalid'

So I suspect there might have been some cut-n-paste error. Check that you've
not pasted in any whitespace that could confuse the first test.

Cheers,
John
 
R

Richard Jones

John said:
| >>> int("6A61E3AD")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 6A61E3AD
| >>> int("6A61E3AD", 16)
1784800173

What am I missing?

Ah, thankyou! I, on the other hand, looked at that code several times and
saw nothing ;)

I've fixed the code and it'll be fixed on the server soon (once apache
restarts itself).


Richard
 
J

John Machin

Richard said:
Ah, thankyou! I, on the other hand, looked at that code several times and
saw nothing ;)

I've fixed the code and it'll be fixed on the server soon (once apache
restarts itself).

Hi Richard, might be a good idea to spell out the actual criteria
rather than rely on side effects of int -- e.g. if the input is not
subject to .strip() somewhere between the keyboard and your code, you
could get false positives:

| >>> int("1234567 ",16)
| 19088743
| >>> int(" 1234567",16)
| 19088743

re.match("[A-Fa-f0-9]{8,8}", data.strip()) makes it plain what is
intended ...

Cheers,
John


Cheers,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top