0.11 does not work as expected

Bug #312456 reported by Rolf Leggewie
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pastebinit
Fix Released
Undecided
Unassigned
pastebinit (Debian)
Fix Released
Unknown
pastebinit (Ubuntu)
Fix Released
High
Unassigned

Bug Description

while preparing a package for 0.11, I ran into the following issue:

root@Rie:~# pastebinit
Error parsing configuration file!
Please ensure that your configuration file looks similar to the following:
<pastebinit>
<pastebin>http://paste.debian.net</pastebin>
<author>A pastebinit user</author>
<jabberid><email address hidden></jabberid>
<format>text</format>
</pastebinit>

root@Rie:~# cat ~/.pastebinit.xml
<pastebinit>
<pastebin>http://rafb.net/paste</pastebin>
<author>me</author>
<jabberid><email address hidden></jabberid>
<format>text</format>
</pastebinit>

Related branches

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Actually, I believe this is a bug that was introduced between version 0.9 and 0.10. I was still using the official hardy release which necessitated <pastebin>http://rafb.net/paste</pastebin> for rafb.net. Apparently that changed between 0.9 and 0.10.

Revision history for this message
Spiro Harvey (spiro.harvey) wrote :

the problem is that it is trying to parse "configfile", rather than "configtext"

I have included a patch which I have changed the version number to 0.11a to save confusion.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

This makes pastebinit almost unusable for me in Jaunty.

Spiro, thank you for the patch. I'll release it shortly.

Changed in pastebinit:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pastebinit - 0.11.1-0ubuntu1

---------------
pastebinit (0.11.1-0ubuntu1) jaunty; urgency=low

  * new bugfix release (0.11.1)
   * Update translations
   * Fix pastebinit bugs as reported on Launchpad.
   * Disable 1t2.us as it no longer works.
   * Disable all options specifc to 1t2.us (commented out).
   * Fix remainning pastebins.
   * Update manpage. (LP: #157082)
   * Merge fix from Spiro Harvey (LP: #312456)
   * Change pastebinit's default behavior to reading from stdin (Thanks fta)
   * Code cleanup

 -- Stephane Graber <email address hidden> Tue, 10 Mar 2009 01:05:36 -0400

Changed in pastebinit:
status: Confirmed → Fix Released
Changed in pastebinit:
status: New → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Stephane, why was it better to release this as 0ubuntu1 instead of pushing it through debian?

Revision history for this message
Stéphane Graber (stgraber) wrote : Re: [Bug 312456] Re: 0.11 does not work as expected

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rolf Leggewie wrote:
> Stephane, why was it better to release this as 0ubuntu1 instead of
> pushing it through debian?

Because we're already in feature freeze and will soon be in complete
freeze, I simply didn't have the time to get it in Debian and ask for a
sync before the freeze.

I'll resync with Debian when Karmic opens.

Stéphane

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm2S8IACgkQjxyfqkjBhuzKegCeLc4Cvjsr8CoXmC1dC4wYdr16
FOIAn0WZM8D7oIa6dMPmfGxdtYp03x4X
=Jdhn
-----END PGP SIGNATURE-----

Revision history for this message
mich (d206757) wrote :

I'm using pastebinit on Debian Squeeze and still have this issue:

~$ pastebinit .vimrc
Error parsing configuration file!
Please ensure that your configuration file looks similar to the following:
<pastebinit>
<pastebin>http://paste.debian.net</pastebin>
<author>A pastebinit user</author>
<jabberid><email address hidden></jabberid>
<format>text</format>
</pastebinit>

~$ cat ~/.pastebinit.xml
<pastebinit>
    <pastebin>http://pastebin.ca</pastebin>
    <author>ml</author>
    <jabberid><email address hidden></jabberid>
    <format>text</format>
</pastebinit>

Works fine without .pastebinit.xml.

Revision history for this message
Spiro Harvey (spiro.harvey) wrote :

Hasn't made its way to Sid, which uses pastebinit-0.11-2.

The patch I sent in fixes your problem. The code is trying to parse the xml file as a string, rather than trying to parse the data it extracted from the xml file.

There are two important variables. One is 'configfile' which is the actual xml pathname. The other is 'configtext' which is where the contents of the configfile is read into.

the code does an

f=open(configfile)

then

configtext=f.read()

so here we have configfile which probably contains something like "/home/user/.pastebinit.xml" and configtext which should be something like:
"<pastebinit>
    <pastebin>http://pastebin.ca</pastebin>
    <author>ml</author>
    <jabberid><email address hidden></jabberid>
    <format>text</format>
</pastebinit>"

the broken version of the code then checks to see if a configfile exists, then if it does, it tries to read CONFIGFILE, but it should be trying to read configTEXT.

I think once this is fixed 'upstream' not in the distros, then it will make its way into the distros.

I will email this page to the developers in case they're not aware of it.

Revision history for this message
Spiro Harvey (spiro.harvey) wrote :

oops, looks like it is fixed here, and just noticed stephane's post above.

all code here on lp is correct. mich you can use what I posted to fix the problem for you until it makes its way to debian.

Revision history for this message
mich (d206757) wrote :

Spiro,

I did what you suggested and I don't get that error. But it is not reading .pastebinit.xml. It is using the default pastebin, username, and file format. I tried with:

<pastebinit>
    <pastebin>http://pastebin.ca</pastebin>
    <author>ml</author>
    <jabberid><email address hidden></jabberid>
    <format>haskell</format>
</pastebinit>

<pastebinit>
    <pastebin>http://paste.debian.net</pastebin>
    <author>ml</author>
    <jabberid><email address hidden></jabberid>
    <format>text</format>
</pastebinit>

Thank You for the quick reply.

Rolf Leggewie (r0lf)
Changed in pastebinit (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in pastebinit (Debian):
status: Unknown → New
Changed in pastebinit (Debian):
status: New → Confirmed
Changed in pastebinit (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.