← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 828959] Re: Import CSV file fails

 

Hi my friend,

The problem with your test is that you created the .csv file on linux, so
the file is still in UTF8 format...

Try creating the file on Windows, and then import it...  You can confirm the
file has non UTF8 characters if you open it on linux and it shows squares or
weird symbols instead of the intended characters you included on the Windows
machine...

The problem goes away with just adding a try...except to the data.append
instruction on win_import.py file...


Regards,
-Mario

On Fri, Aug 19, 2011 at 4:23 AM, Vishal Parmar(Open ERP) <
828959@xxxxxxxxxxxxxxxxxx> wrote:

> ** Attachment added: "Importcsv.ogv"
>
> https://bugs.launchpad.net/openobject-client/+bug/828959/+attachment/2291339/+files/Importcsv.ogv
>
> ** Changed in: openobject-client
>       Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/828959
>
> Title:
>  Import CSV file fails
>
> Status in OpenERP GTK Client:
>   Incomplete
>
> Bug description:
>  Hi,  when you try to import a CSV file and it has any non UTF-8
>  character, the load fails with no warning...
>
>  on win_import.py, if a try.... except is added this can be avoided,
>  like...
>
>          try:
>              datas.append(map(lambda
> x:x.decode(csv_data['combo']).encode('utf-8'), line))
>          except:
>              common.warning(_('Error on text file.\nCorrect %s and try
> again !') % (line,), _('Import Error.'), parent=parent)
>              return False
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-client/+bug/828959/+subscriptions
>

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/828959

Title:
  Import CSV file fails

Status in OpenERP GTK Client:
  Incomplete

Bug description:
  Hi,  when you try to import a CSV file and it has any non UTF-8
  character, the load fails with no warning...

  on win_import.py, if a try.... except is added this can be avoided,
  like...

          try:
              datas.append(map(lambda x:x.decode(csv_data['combo']).encode('utf-8'), line))
          except:
              common.warning(_('Error on text file.\nCorrect %s and try again !') % (line,), _('Import Error.'), parent=parent)
              return False

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-client/+bug/828959/+subscriptions


References