Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Runtime error

edited October 2019 in OpenSesame

Hi,

How can I correct this error ?


Extension OpenScienceFramework misbehaved on event startup (see debug window for stack trace)
Extension error
item-stack: 
exception type: UnicodeDecodeError
exception message: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte
time: Sat Oct 26 15:17:07 2019
Traceback:
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\extensions\_extension_manager.py", line 133, in fire
   ext.fire(event, **kwdict)
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\extensions\_base_extension.py", line 410, in fire
   getattr(self, u'event_%s' % event)(**kwdict)
 File "C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py", line 680, in event_startup
   self.__initialize()
 File "C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py", line 838, in __initialize
   tmp_dir = safe_decode(tempfile.gettempdir())
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\py3compat.py", line 42, in safe_decode
   return s.decode(enc, errors)
 File "C:\Program Files (x86)\OpenSesame\lib\encodings\utf_8.py", line 16, in decode
   return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte

Thank you in advance,

Gérard

Comments

  • Hi Gérard,

    Thanks for reporting this. This is a bug in the OpenScienceFramework extension, related to special characters in the file paths. The bug seems easily fixed, but it would be helpful if you can test it for us. Could you replace this file:

    C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py
    

    By the attached version of the same file? And then please report back to us as to whether this fixes this issue.

    Cheers!

    Sebastiaan

    Ping @Daniel, if this fixes it, I'll submit a PR.

  • Hi Sebastiaan,

    Your correction fixes the issue. There is no error message any more at startup. However there is another problem: the audio files do not execute correctly, I only hear a click. These problems appear only on a certain computer. Let me give you more information about the context. OpenSesame runs perfectly on 2 computers. I have installed it also on a third one in order to make a certain number of audio feedbacks available in real time. That computer is a Dell Optiplex 9020 whose mother board has been replaced in September because of an overvoltage. However, the operating system, the applications and the data were OK. Only a few drivers had to be replaced. I thought this information might be useful for you.

    The problems with OpenSesame occur on that third computer, although all the other programs run fine. Audio files are OK when executed by a standard player. After fixing the original problem with your patch, I deleted and reinstalled Opensesame but the problems appeared again. Applying the patch once again suppressed the error message. Now I am stuck with that problem of sound ...

    Cheers,

    Gérard

  • Hi Gérard,

    If you only hear a click when playing sound files, this generally indicates that the format of the sound file is different from what OpenSesame expects. (Although I'm not sure why this would happen on some systems and not others.) Unlike most other software, OpenSesame does not automatically detect the format of .wav files. You can either:

    • Open your sound files in a sound editor, such as Audacity, check their format (sampling frequency, mono/stereo, bit depth) and then adjust the sampler settings in the OpenSesame backend settings.
    • Convert the sound files to .ogg , which should be automatically detected.

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    The problem is really unusual because it happens whatever the file format, including .ogg. Moreover, the same exact programs and audio files run fine on two other computers. There is obviously a bad interaction between that specific computer and OpenSesame. Could it be that some Python or other underlying files would not have been deleted when I have uninstalled and reinstalled the OS package ? Have you any other idea ?

    Cheers,

    Gérard

  • Hi Gérard,

    Could it be that some Python or other underlying files would not have been deleted when I have uninstalled and reinstalled the OS package ? 

    No, that strikes me as very unlikely. But what it could be I don't know … As you say, it sounds like an interaction between OpenSesame and the computer.

    Sorry that I cannot be of more help!

    Cheers,

    Sebastiaan

  • Hi Sebastiaan,

    I have modified various parameters in OS, including the underlying background package. With PsychoPy, that I use all the time, the only symptom of error is the production of a click in place of a sound. But with Expyriment, the program is stuck and I get the following error message, that shows that the correction of the bug related to special characters in the file path is not fully effective (my user name is gérard and not grard):

    item-stack: Tronc[run].Boucle[run].Signal[run].Rep[run]

    exception type: error

    exception message: Couldn't open c:\users\grard\appdata\local\temp\expyriment_4vp6ot\tmponv4fi.tga

    Does it help ? Don't hesitate to request additional testing if needed.

    Cheers,

    Gérard

  • Hi Sebastiaan (and everyone else),

    I continue to investigate the origin of the problem of the sounds that are replaced by a click.

    I discovered that, if I use PsychoPy, the error that I documented in my previous message does not appear. I verified that the problem is not due to the special character " é " because image files in the temporary pool of OS are correctly handled. So I presume that the path is identified.

    Another interesting information is that if I put a Synth element in the OS sequence, it sounds perfectly. Only the Sampler elements do not work and produce a click. The problem is not linked to the type of sound file (.wav or .ogg). And, of course, I verified that the sound files do work fine with any other program like VLC or Audacity.

    And the same OS sequences work perfectly on two other PCs.

    So where is the bug hiding ??

    Cheers,

    Gérard

  • Hi Gérard,

    Could you upload one of the clicky samples here?

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    Please note that ALL the audio files that I use (wav and ogg) behave in the same way on that computer, but not on the others.

    Thank you for your time,

    Gérard

  • Hi Gérard,

    What format is this wave file in exactly? Audacity detects it as a 11025 Khz, mono, float format, but it looks funky to me.

    Cheers,

    Sebastiaan

  • Hi Sebastiaan,

    You will find attached the two versions of another file that is more typical. The previous file may be indeed confusing because it is very short and may look like a clik by itself. This one is more meaningful to the ear.

    As far as the format is concerned, I did not pay attention to it while selecting and adapting the sounds, because I never had any problem working on the computer where I created the programs, as well as on another computer. Moreover, sampling or other sound parameter adjustment is not available in OS with Psychopy in the background. And in addition to that, I don't know how to modify the sampling if needed ...

    The problem is definitely on THAT computer but it is weired to see that only OS is concerned. I have also verified in Windows parameters that the sound card assignment is correct while an OS sequence is running. The sound goes to the right place, but it is shrinked to a short click, whatever the content or the length of the audio file.

    Thank you again for the time that you spend on this very particular case.

    Cheers!

    Gérard

  • Hi Gérard,

    The .wav file format is 32 bit float, 11Khz mono. It does play correctly on my system, although I'm actually surprised by this, because I didn't think that PyGame would be able to handle this format. In any case, what happens if you open this file in a tool like Audacity, and then change its format to 24 bit PC, 48Khz mono?

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    I have investigated into many directions and explored the trails that you suggested, with no result. I have also discovered that the same problem has already been reported by Charlotte1990 in October 2018. Apparently it has not been solved yet. I'm pretty stoked...

    Cheers,

    Gérard

  • Hi Sebastiaan,

    I continue to investigate the problems related to OS with the DELL Optiplex 9020 computer. Apart the question of the clicks in place of sounds, there are also other failures with OpenGL and the Legacy background, for instance. I try to identify some specific features of that computer that could explain the problems.

    About the sounds, I checked all the drivers and codecs and did not find anything abnormal. It is coherent with the fact that all other sound programs work fine. I also tried the execution in a web browser and I got the following error. Does it help ?

    Cheers,

    Gérard


  • edited January 2020

    Hi Gérard,

    The error message appears to be another character encoding bug due to special characters in the temporary file names. If you open the file oswebext_widget.py (see the traceback for the full path) in a text editor, and from line 191 change this:

    	def _tmp_osexp(self):
    
    		with tempfile.NamedTemporaryFile(suffix=u'.osexp', delete=False) as fd:
    			pass
    		osexpwriter(self.experiment, fd.name)
    		return fd.name
    
    	def _tmp_html(self):
    
    		with tempfile.NamedTemporaryFile(suffix=u'.html', delete=False) as fd:
    			pass
    		return fd.name
    

    To this:

    	def _tmp_osexp(self):
    
    		with tempfile.NamedTemporaryFile(suffix='.osexp', delete=False) as fd:
    			pass
    		osexpwriter(self.experiment, fd.name)
    		return fd.name
    
    	def _tmp_html(self):
    
    		with tempfile.NamedTemporaryFile(suffix='.html', delete=False) as fd:
    			pass
    		return fd.name
    

    That is, remove the u prefix in the suffix keywords. Does that resolve the issue?

    Regarding the sounds: I honestly don't know. I doubt that we'll be able to resolve this, unfortunately.

    Cheers!

    Sebastiaan

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games