Skip to main content
question solved
Source Link
LarsH
  • 111
  • 4

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

P.P.S.

If I take away the fromdate and todate keywords, it runs successfully:

questions = so.questions(sort=Sort.Creation, order=DESC)

So I guess the problem has to do with those keywords. Probably I'm using Py-SE incorrectly (as opposed to trying to get the SE API to do something it's not designed to do).

SOLVED.

I figured it out: I'm supposed to pass from_date and to_date, not fromdate and todate, despite the SE API parameter names.

I figured that out by guessing. Next, I would like to know how I was supposed to find that out? Naming conventions? If so, where are they documented? Just by example?

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

P.P.S.

If I take away the fromdate and todate keywords, it runs successfully:

questions = so.questions(sort=Sort.Creation, order=DESC)

So I guess the problem has to do with those keywords. Probably I'm using Py-SE incorrectly (as opposed to trying to get the SE API to do something it's not designed to do).

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

P.P.S.

If I take away the fromdate and todate keywords, it runs successfully:

questions = so.questions(sort=Sort.Creation, order=DESC)

So I guess the problem has to do with those keywords. Probably I'm using Py-SE incorrectly (as opposed to trying to get the SE API to do something it's not designed to do).

SOLVED.

I figured it out: I'm supposed to pass from_date and to_date, not fromdate and todate, despite the SE API parameter names.

I figured that out by guessing. Next, I would like to know how I was supposed to find that out? Naming conventions? If so, where are they documented? Just by example?

noted that error only occurs with the *date keywords
Source Link
LarsH
  • 111
  • 4

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

P.P.S.

If I take away the fromdate and todate keywords, it runs successfully:

questions = so.questions(sort=Sort.Creation, order=DESC)

So I guess the problem has to do with those keywords. Probably I'm using Py-SE incorrectly (as opposed to trying to get the SE API to do something it's not designed to do).

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

P.P.S.

If I take away the fromdate and todate keywords, it runs successfully:

questions = so.questions(sort=Sort.Creation, order=DESC)

So I guess the problem has to do with those keywords. Probably I'm using Py-SE incorrectly (as opposed to trying to get the SE API to do something it's not designed to do).

added my code
Source Link
LarsH
  • 111
  • 4

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

I'm running a program using py-stackexchange that gets an error,

HTTPError: HTTP Error 500: Internal Server Error

Do you have any debugging suggestions? If I could turn on a debugging flag, that would cause py-SE to print the exact URL that was requested, that would help... Then I could visit that URL myself in the browser and see if a more detailed error message was shown, such as "your parameter X was invalid" or "you've exceeded your API key limit" or something.

I could modify __init__.py myself to print such debugging messages, but I'm not up on how to recompile python functions within an egg and redeploy them.

Thanks...

Update:

P.S. It wasn't my intention to ask you to find the actual problem, but heck, I'd be just as happy to have that answer as to have the debugging tool described above, and it might be easier to supply. So here's my code:

currentDate = floor(time.time())
aWhileAgo = currentDate - 10

# E.g. fromdate=1293840000&todate=1294444800

questions = so.questions(sort=Sort.Creation, order=DESC, fromdate=aWhileAgo, \
    todate=currentDate)

The last line is where I get the 500 error.

But calling this URL directly (which is what I think py-SE should be using under the hood):

http://api.stackoverflow.com/1.1/questions?fromdate=1305580368&order=desc&sort=creation&todate=1305580478

is successful.

Source Link
LarsH
  • 111
  • 4
Loading